Skip to content

Commit

Permalink
Convert routing cookbook to an actual aiconfig.json (#1492)
Browse files Browse the repository at this point in the history
Convert routing cookbook to an actual aiconfig.json


Summary:

Test Plan:
  • Loading branch information
saqadri authored May 21, 2024
2 parents 9aadf46 + 2aacea6 commit cc3d6b4
Showing 1 changed file with 96 additions and 0 deletions.
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"
}

0 comments on commit cc3d6b4

Please sign in to comment.