Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert routing cookbook to an actual aiconfig.json #1492

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions cookbooks/Basic-Prompt-Routing/assistant.aiconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"name": "assistant_config",
"schema_version": "latest",
"metadata": {
"parameters": {
"student_question": "Prove that 1+1=2?",
"philosophy_question": "What is the meaning of life?",
"physics_question": "What is entropy?"
},
"models": {
"gpt-4": {
"top_k": 40,
"top_p": 1,
"model": "gpt-4",
"temperature": 0.0
}
}
},
"description": "teaching assistant config",
"prompts": [
{
"name": "router",
"input": "{{student_question}}",
"metadata": {
"model": {
"name": "gpt-4",
"settings": {
"system_prompt": "\n You will be given a question. Classify the question as one of the following topics: \n 1. Math\n 2. Physics\n 3. General\n Output the topic name.\n "
}
},
"parameters": {}
},
"outputs": [
{
"output_type": "execute_result",
"execution_count": 0,
"data": "Math",
"metadata": {
"id": "chatcmpl-9RNSj6btMFAysTVV3GegTZWE8ft3Y",
"created": 1716312073,
"model": "gpt-4-0613",
"object": "chat.completion.chunk",
"raw_response": {
"content": "Math",
"role": "assistant"
},
"role": "assistant"
}
}
]
},
{
"name": "math",
"input": "\n Student Question: {{router.input}}\n Topic: {{router.output}}\n ",
"metadata": {
"model": {
"name": "gpt-4",
"settings": {
"system_prompt": "\n You are a very good mathematician. You are great at answering math questions. \n You are so good because you are able to break down hard problems into their component parts, \n answer the component parts, and then put them together to answer the broader question.\n \n Output: If topic is Math, introduce yourself as 'Hi! I'm your Math Professor' and then answer the question. \n If the topic is not Math, output 'Sorry I only answer Math questions'.\n "
}
},
"parameters": {}
},
"outputs": []
},
{
"name": "physics",
"input": "\n Student Question: {{router.input}}\n Topic: {{router.output}}\n ",
"metadata": {
"model": {
"name": "gpt-4",
"settings": {
"system_prompt": "\n You are a very smart physics professor. You are great at answering questions about physics in a concise and easy\n to understand manner. When you don't know the answer to a question you admit that you don't know.\n \n Output: If topic is Physics, introduce yourself as 'Hi! I'm your Physics Professor' and then answer the question. \n If the topic is not Physics, output 'Sorry I only answer Physics questions'.\n "
}
},
"parameters": {}
},
"outputs": []
},
{
"name": "general",
"input": "\n Student Question: {{router.input}}\n Topic: {{router.output}}\n ",
"metadata": {
"model": {
"name": "gpt-4",
"settings": {
"system_prompt": "\n You are a helpful assistant. Answer the question as accurately as you can. \n \n Introduce yourself as \"Hi I'm your general assistant\". Then answer the question. \n "
}
},
"parameters": {}
},
"outputs": []
}
],
"$schema": "https://json.schemastore.org/aiconfig-1.0"
}
Loading