-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typescript] Save output.data with text content instead of response data
This comes after Sarmad's schema updates in #589. To keep diffs small and easier to review, this simply converts from model-specific outputs --> pure text. I have a diff in #610 which converts from pure text --> `OutputData` format. We only needed to update the `hf.py` and `openai.py`, because `palm.py` already returns output in the form of `string | null` type. Ran yarn automated tests, but there aren't any specifically for openai. I also ran the typescript demos to make sure that they still work. Run these commands from `aiconfig` top-level dir: ``` npx ts-node typescript/demo/function-call-stream.ts npx ts-node typescript/demo/demo.ts npx ts-node typescript/demo/test-hf.ts ``` For the extensions, we only have typescript for `hf.ts` (trivial: just changed `response` to `response.generated_text`), while `llama.ts` already outputs it in text format so no changes needed ## TODO I still need to add function call support directly to `OutputData` format. See
- Loading branch information
1 parent
5e336f0
commit 15c2e66
Showing
10 changed files
with
6,956 additions
and
122 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,39 @@ | ||
{ | ||
"name": "exploring nyc through chatgpt config", | ||
"description": "", | ||
"schema_version": "latest", | ||
"metadata": { | ||
"parameters": {}, | ||
"models": { | ||
"mistralai/Mistral-7B-v0.1": { | ||
"model": "mistralai/Mistral-7B-v0.1", | ||
"top_p": 0.9, | ||
"temperature": 0.9, | ||
"stream": true | ||
} | ||
} | ||
}, | ||
"prompts": [ | ||
{ | ||
"name": "prompt1", | ||
"input": "Hi! Tell me 10 cool things to do in NYC.", | ||
"metadata": { | ||
"model": { | ||
"name": "mistralai/Mistral-7B-v0.1" | ||
}, | ||
"remember_chat_context": true | ||
} | ||
}, | ||
{ | ||
"name": "prompt2", | ||
"input": "Hello, world!", | ||
"metadata": { | ||
"model": { | ||
"name": "HuggingFaceTextGenerationParser" | ||
}, | ||
"parameters": {} | ||
} | ||
} | ||
], | ||
"$schema": "https://json.schemastore.org/aiconfig-1.0" | ||
} |
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
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
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
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
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
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
Oops, something went wrong.