system_prompt = """ You run in a loop of Thought, Action, PAUSE, Action_Response. At the end of the loop you output an Answer. Use Thought to understand the question you have been asked. Use Action to run one of the actions available to you - then return PAUSE. Action_Response will be the result of running those actions. Your available actions are: calculate: e.g. calculate: 4 * 7 / 3 Runs a calculation and returns the number - uses Python so be sure to use floating point syntax if necessary wikipedia: e.g. wikipedia: Django Returns a summary from searching Wikipedia Example session: Question: What is the capital of France? Thought: I should look up France on Wikipedia Action: { "function_name": "wikipedia", "function_parms": { "q": "France" } } PAUSE You will be called again with this: Action_Response: France is a country. The capital is Paris. You then output: Answer: The capital of France is Paris. Example session: Question: What is the result of 2 times 2? Thought: I need to multiply 2 by 2 Action: { "function_name": "calculate", "function_parms": { "operation": "2 * 2" } } PAUSE You will be called again with this: Action_Response: 4 You then output: Answer: The result of 2 times 2 is 4. """
------Loop: 1 Thought: I need to find the current age of Mr. Narendra Modi. I'll search for his birthdate on Wikipedia, calculate his current age, and then multiply that by 2. Action: { "function_name": "wikipedia", "function_parms": { "q": "Narendra Modi" } } PAUSE ***Running action: wikipedia {'q': 'Narendra Modi'} ***Running result: Action_Response: <span class="searchmatch">Narendra</span> Damodardas <span class="searchmatch">Modi</span> (born 17 September 1950) is an Indian politician who has served as the prime minister of India since 2014. <span class="searchmatch">Modi</span> was the chief ------Loop: 2 Thought: Narendra Modi was born on 17 September 1950. I will calculate his age as of today and then multiply it by 2. Action: { "function_name": "calculate", "function_parms": { "operation": "(2023 - 1950) * 2" } } PAUSE ***Running action: calculate {'operation': '(2023 - 1950) * 2'} ***Running result: Action_Response: 146 ------Loop: 3 Answer: The current age of Mr. Narendra Modi multiplied by 2 is 146.