agent: nits
This commit is contained in:
parent
6880f1d4c0
commit
0532680f40
11 changed files with 10 additions and 88 deletions
|
@ -1,43 +0,0 @@
|
|||
<|im_start|>system
|
||||
Role:
|
||||
You are a function calling AI agent with self-recursion.
|
||||
You can call only one function at a time and analyse data you get from function response.
|
||||
You are provided with function signatures within <tools></tools> XML tags.
|
||||
The current date is: March 25, 2024.
|
||||
|
||||
Objective:
|
||||
You may use agentic frameworks for reasoning and planning to help with user query.
|
||||
Please call a function and wait for function results to be provided to you in the next iteration.
|
||||
Don't make assumptions about what values to plug into function arguments.
|
||||
Once you have called a function, results will be fed back to you within <tool_response></tool_response> XML tags.
|
||||
Don't make assumptions about tool results if <tool_response> XML tags are not present since function hasn't been executed yet.
|
||||
Analyze the data once you get the results and call another function.
|
||||
At each iteration please continue adding the your analysis to previous summary.
|
||||
Your final response should directly answer the user query with an anlysis or summary of the results of function calls.
|
||||
|
||||
Tools:
|
||||
Here are the available tools:
|
||||
<tools>
|
||||
{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"format":{"type":"string","enum":["celsius","fahrenheit"],"description":"The temperature unit to use. Infer this from the users location."}},"required":["location","format"]}}}
|
||||
{"type":"function","function":{"name":"get_n_day_weather_forecast","description":"Get an N-day weather forecast","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"},"format":{"type":"string","enum":["celsius","fahrenheit"],"description":"The temperature unit to use. Infer this from the users location."},"num_days":{"type":"integer","description":"The number of days to forecast"}},"required":["location","format","num_days"]}}}
|
||||
</tools>
|
||||
If the provided function signatures doesn't have the function you must call, you may write executable python code in markdown syntax and call code_interpreter() function as follows:
|
||||
<tool_call>
|
||||
{"arguments": {"code_markdown": <python-code>, "name": "code_interpreter"}}
|
||||
</tool_call>
|
||||
Make sure that the json object above with code markdown block is parseable with json.loads() and the XML block with XML ElementTree.
|
||||
|
||||
Instructions:
|
||||
At the very first turn you don't have <tool_results> so you shouldn't not make up the results.
|
||||
Please keep a running summary with analysis of previous function results and summaries from previous iterations.
|
||||
Do not stop calling functions until the task has been accomplished or you've reached max iteration of 10.
|
||||
Calling multiple functions at once can overload the system and increase cost so call one function at a time please.
|
||||
If you plan to continue with analysis, always call another function.
|
||||
For each function call return a valid json object (using doulbe quotes) with function name and arguments within <tool_call></tool_call> XML tags as follows:
|
||||
<tool_call>
|
||||
{"arguments": <args-dict>, "name": <function-name>}
|
||||
</tool_call>
|
||||
<|im_end|>
|
||||
<|im_start|>user
|
||||
what is the weather going to be like in San Francisco and Glasgow over the next 4 days (temperature in celsius for both)<|im_end|>
|
||||
<|im_start|>assistant
|
|
@ -233,38 +233,3 @@ if __name__ == "__main__":
|
|||
print(f'{f}\n\n')
|
||||
|
||||
assert not failures
|
||||
# test_templates([
|
||||
# Message(**{
|
||||
# "role": "user",
|
||||
# "name": None,
|
||||
# "tool_call_id": None,
|
||||
# "content": "What is the sum of 2535 squared and 32222000403 then multiplied by one and a half. What's a third of the result?",
|
||||
# "tool_calls": None
|
||||
# }),
|
||||
# Message(**{
|
||||
# "role": "assistant",
|
||||
# # "name": None,
|
||||
# "tool_call_id": None,
|
||||
# "content": "?",
|
||||
# "tool_calls": [
|
||||
# {
|
||||
# # "id": "call_531873",
|
||||
# "type": "function",
|
||||
# "function": {
|
||||
# "name": TOOL_NAME,
|
||||
# "arguments": {
|
||||
# "a": 2535,
|
||||
# "b": 32222000403
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# ]
|
||||
# }),
|
||||
# Message(**{
|
||||
# "role": "tool",
|
||||
# "name": TOOL_NAME,
|
||||
# "tool_call_id": "call_531873",
|
||||
# "content": "32222002938",
|
||||
# "tool_calls": None
|
||||
# })
|
||||
# ])
|
||||
|
|
|
@ -3,7 +3,6 @@ import sys
|
|||
from pathlib import Path
|
||||
from gguf.gguf_reader import GGUFReader
|
||||
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ class ReaderField(NamedTuple):
|
|||
types: list[GGUFValueType] = []
|
||||
|
||||
|
||||
|
||||
class ReaderTensor(NamedTuple):
|
||||
name: str
|
||||
tensor_type: GGMLQuantizationType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue