-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YAML is a superset of JSON, and allows for much better readability. We can easily support YAML for AIConfig with our existing JSON schema. I have also created a PR to add AIConfig schema to schemastore: SchemaStore/schemastore#3474. Once that gets approved, it will automatically hook up syntax validation for *.aiconfig.yml/*.aiconfig.yaml, *.aiconfig.json in VSCode and other IDEs. Test Plan: (Tried in both TS and Python) Validated idempotence of the following: ``` from aiconfig import AIConfigRuntime config = AIConfigRuntime.load('travel.aiconfig.json') config.save("travel.aiconfig.yaml", mode="yaml") config = AIConfigRuntime.load('travel.aiconfig.yaml') config.save("travel2.aiconfig.json") config.save() ``` `travel.aiconfig.json`: ```json { "name": "NYC Trip Planner", "description": "Intrepid explorer with ChatGPT and AIConfig", "schema_version": "latest", "metadata": { "models": { "gpt-3.5-turbo": { "model": "gpt-3.5-turbo", "top_p": 1, "temperature": 1 }, "gpt-4": { "model": "gpt-4", "max_tokens": 3000, "system_prompt": "You are an expert travel coordinator with exquisite taste." } }, "default_model": "gpt-3.5-turbo", }, "prompts": [ { "name": "get_activities", "input": "Tell me 10 fun attractions to do in NYC.", "metadata": { } }, { "name": "gen_itinerary", "input": "Generate an itinerary ordered by {{order_by}} for these activities: {{get_activities.output}}.", "metadata": { "model": "gpt-4", "parameters": { "order_by": "geographic location" } } } ] } ``` `travel.aiconfig.yaml`: ```yaml description: Intrepid explorer with ChatGPT and AIConfig metadata: default_model: gpt-3.5-turbo models: gpt-3.5-turbo: model: gpt-3.5-turbo temperature: 1 top_p: 1 gpt-4: max_tokens: 3000 model: gpt-4 system_prompt: You are an expert travel coordinator with exquisite taste. parameters: {} name: NYC Trip Planner prompts: - input: Tell me 10 fun attractions to do in NYC. name: get_activities outputs: [] - input: 'Generate an itinerary ordered by {{order_by}} for these activities: {{get_activities.output}}.' metadata: model: gpt-4 parameters: order_by: geographic location name: gen_itinerary outputs: [] schema_version: latest ```
- Loading branch information
Showing
7 changed files
with
135 additions
and
67 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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
requests | ||
# Editor server | ||
black | ||
flake8 | ||
pylint | ||
pytest | ||
pydantic>=2.1 | ||
pybars3 | ||
flask-cors | ||
flask[async] | ||
google-generativeai | ||
openai >= 1.0.0, < 1.5 | ||
python-dotenv | ||
huggingface_hub | ||
result | ||
hypothesis==6.91.0 | ||
lastmile-utils==0.0.13 | ||
mock | ||
nest_asyncio | ||
nltk | ||
openai >= 1.0.0, < 1.5 | ||
prompt_toolkit | ||
mock | ||
pybars3 | ||
pydantic>=2.1 | ||
pylint | ||
pytest | ||
pytest-asyncio | ||
lastmile-utils==0.0.13 | ||
hypothesis==6.91.0 | ||
nltk | ||
# Editor server | ||
flask[async] | ||
flask-cors | ||
python-dotenv | ||
pyyaml | ||
requests | ||
result |
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