Update unit1/dummy_agent_library.ipynb

#114
Files changed (1) hide show
  1. unit1/dummy_agent_library.ipynb +2 -2
unit1/dummy_agent_library.ipynb CHANGED
@@ -437,7 +437,7 @@
437
  " 'content': 'Answer the following questions as best you can. You have access to the following tools:\\n\\nget_weather: Get the current weather in a given location\\n\\nThe way you use the tools is by specifying a json blob.\\nSpecifically, this json should have a `action` key (with the name of the tool to use) and a `action_input` key (with the input to the tool going here).\\n\\nThe only values that should be in the \"action\" field are:\\nget_weather: Get the current weather in a given location, args: {{\"location\": {{\"type\": \"string\"}}}}\\nexample use :\\n```\\n{{\\n \"action\": \"get_weather\",\\n \"action_input\": {\"location\": \"New York\"}\\n}}\\n\\nALWAYS use the following format:\\n\\nQuestion: the input question you must answer\\nThought: you should always think about one action to take. Only one action at a time in this format:\\nAction:\\n```\\n$JSON_BLOB\\n```\\nObservation: the result of the action. This Observation is unique, complete, and the source of truth.\\n... (this Thought/Action/Observation can repeat N times, you should take several steps when needed. The $JSON_BLOB must be formatted as markdown and only use a SINGLE action at a time.)\\n\\nYou must always end your output with the following format:\\n\\nThought: I now know the final answer\\nFinal Answer: the final answer to the original input question\\n\\nNow begin! Reminder to ALWAYS use the exact characters `Final Answer:` when you provide a definitive answer. '},\n",
438
  " {'role': 'user', 'content': \"What's the weather in London ?\"},\n",
439
  " {'role': 'assistant',\n",
440
- " 'content': 'Thought: To find out the weather in London, I should use the `get_weather` tool with \"London\" as the location.\\n\\nAction:\\n```json\\n{\\n \"action\": \"get_weather\",\\n \"action_input\": {\"location\": \"London\"}\\n}\\n```\\n\\nthe weather in London is sunny with low temperatures. \\n'}]"
441
  ]
442
  },
443
  "metadata": {},
@@ -449,7 +449,7 @@
449
  "messages=[\n",
450
  " {\"role\": \"system\", \"content\": SYSTEM_PROMPT},\n",
451
  " {\"role\": \"user\", \"content\": \"What's the weather in London ?\"},\n",
452
- " {\"role\": \"assistant\", \"content\": output.choices[0].message.content+get_weather('London')},\n",
453
  "]\n",
454
  "messages"
455
  ]
 
437
  " 'content': 'Answer the following questions as best you can. You have access to the following tools:\\n\\nget_weather: Get the current weather in a given location\\n\\nThe way you use the tools is by specifying a json blob.\\nSpecifically, this json should have a `action` key (with the name of the tool to use) and a `action_input` key (with the input to the tool going here).\\n\\nThe only values that should be in the \"action\" field are:\\nget_weather: Get the current weather in a given location, args: {{\"location\": {{\"type\": \"string\"}}}}\\nexample use :\\n```\\n{{\\n \"action\": \"get_weather\",\\n \"action_input\": {\"location\": \"New York\"}\\n}}\\n\\nALWAYS use the following format:\\n\\nQuestion: the input question you must answer\\nThought: you should always think about one action to take. Only one action at a time in this format:\\nAction:\\n```\\n$JSON_BLOB\\n```\\nObservation: the result of the action. This Observation is unique, complete, and the source of truth.\\n... (this Thought/Action/Observation can repeat N times, you should take several steps when needed. The $JSON_BLOB must be formatted as markdown and only use a SINGLE action at a time.)\\n\\nYou must always end your output with the following format:\\n\\nThought: I now know the final answer\\nFinal Answer: the final answer to the original input question\\n\\nNow begin! Reminder to ALWAYS use the exact characters `Final Answer:` when you provide a definitive answer. '},\n",
438
  " {'role': 'user', 'content': \"What's the weather in London ?\"},\n",
439
  " {'role': 'assistant',\n",
440
+ " 'content': 'Thought: To find out the weather in London, I should use the `get_weather` tool with \"London\" as the location.\\n\\nAction:\\n```json\\n{\\n \"action\": \"get_weather\",\\n \"action_input\": {\"location\": \"London\"}\\n}\\n```\\n\\nObservation:\\nthe weather in London is sunny with low temperatures. \\n'}]"
441
  ]
442
  },
443
  "metadata": {},
 
449
  "messages=[\n",
450
  " {\"role\": \"system\", \"content\": SYSTEM_PROMPT},\n",
451
  " {\"role\": \"user\", \"content\": \"What's the weather in London ?\"},\n",
452
+ " {\"role\": \"assistant\", \"content\": output.choices[0].message.content+"Observation:\n"+get_weather('London')},\n",
453
  "]\n",
454
  "messages"
455
  ]