-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from cofacts/ai-phase0
feat(airesponses): add ai response index
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export const VERSION = '1.0.0'; | ||
|
||
// A response from AI. Can be AI reply, OCR, speech to text, etc. | ||
// | ||
export default { | ||
properties: { | ||
// the document ID for this response | ||
docId: { type: 'keyword' }, | ||
|
||
// type of this AI response. | ||
type: { type: 'keyword' }, | ||
|
||
// The user that requests an AI response | ||
// | ||
userId: { type: 'keyword' }, | ||
appId: { type: 'keyword' }, | ||
|
||
// LOADING | SUCCESS | ERROR | ||
status: { type: 'keyword' }, | ||
|
||
// AI response text | ||
text: { type: 'text', analyzer: 'cjk_url_email' }, | ||
|
||
// The request to AI endpoint. Just for record, not indexed. | ||
request: { type: 'keyword', index: false, doc_values: false }, | ||
|
||
// Token stats from AI endpoint response. | ||
usage: { | ||
type: 'object', | ||
properties: { | ||
promptTokens: { type: 'long' }, | ||
completionTokens: { type: 'long' }, | ||
totalTokens: { type: 'long' }, | ||
}, | ||
}, | ||
|
||
createdAt: { type: 'date' }, | ||
updatedAt: { type: 'date' }, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters