How to end dead loop of multi-turn and enter parallel responses?

#4
by DiTy - opened

Hey,
In the process of using your model, I had a question. How did you mean to stop multi-turn?
Is the prompt filling correct (Will the generation be stable?), after the request A, if I just want to get a response from the executed function and just get a response from AI, should I collect the next step with an empty user_input?

<s> [INST] [BEGIN OF TASK INSTRUCTION]
Based on the previous context and API request history, generate an API request or a response as an AI assistant.
[END OF TASK INSTRUCTION]

[BEGIN OF AVAILABLE TOOLS]
[{"name": "get_weather", "description": "Get the current weather for a location", "parameters": {"location": {"type": "string", "description": "The city and state, e.g. San Francisco, New York"}, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"], "description": "The unit of temperature to return"}}}, {"name": "search", "description": "Search for information on the internet", "parameters": {"query": {"type": "string", "description": "The search query, e.g. 'latest news on AI'"}}}]
[END OF AVAILABLE TOOLS]

[BEGIN OF FORMAT INSTRUCTION]
The output should be of the JSON format, which specifies a list of generated function calls. The example format is as follows, please make sure the parameter type is correct. If no function call is needed, please make 
tool_calls an empty list "[]".
#```
{"thought": "the thought process, or an empty string", "tool_calls": [{"name": "api_name1", "arguments": {"argument1": "value1", "argument2": "value2"}}]}
#```
[END OF FORMAT INSTRUCTION]

[BEGIN OF QUERY]
What's the weather like in New York in fahrenheit?
[END OF QUERY]


[BEGIN OF HISTORY STEPS]
[{"step_id": 0, "thought": "I need to get the current weather for New York in fahrenheit.", "tool_calls": [{"name": "get_weather", "arguments": {"location": "New York", "unit": "fahrenheit"}}], "next_observation": {"temperature": "61F"}, "user_input": ""}]
[END OF HISTORY STEPS]
 [/INST]

agent_action:

'{"thought": "AI: The current temperature in New York is 61 degrees Fahrenheit.", "tool_calls": []}'

Did I understand everything correctly?
In addition, what is the correct format for providing parallel tool responses?

Thank you in advance for your reply!

DiTy changed discussion title from How to end dead loop of multi-turn? to How to end dead loop of multi-turn and enter parallel responses?

Sign up or log in to comment