mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 17:44:38 +00:00
Fix tool spec, this spec is kinda.... (#1458)
This commit is contained in:
parent
c0adaabfa4
commit
4291e1575b
1 changed files with 2 additions and 2 deletions
|
@ -1964,7 +1964,7 @@ def transform_genparams(genparams, api_format):
|
||||||
# tools handling
|
# tools handling
|
||||||
tools_array = genparams.get('tools', [])
|
tools_array = genparams.get('tools', [])
|
||||||
chosen_tool = genparams.get('tool_choice', "auto")
|
chosen_tool = genparams.get('tool_choice', "auto")
|
||||||
tool_json_formatting_instruction = " Use this style of JSON object formatting to give your answer if you think the user is asking you to perform an action: " + json.dumps([{"id": "insert an id for the response", "type": "function", "function": {"name": "insert the name of the function you want to call", "arguments": {"first property key": "first property value", "second property key": "second property value"}}}], indent=0)
|
tool_json_formatting_instruction = " Use this style of JSON object formatting to give your answer if you think the user is asking you to perform an action: " + json.dumps([{"id": "insert an id for the response", "type": "function", "function": {"name": "insert the name of the function you want to call", "arguments": "{\"first property key\": \"first property value\", \"second property key\": \"second property value\"}"}}], indent=0)
|
||||||
if tools_array and len(tools_array) > 0 and chosen_tool is not None:
|
if tools_array and len(tools_array) > 0 and chosen_tool is not None:
|
||||||
try:
|
try:
|
||||||
specified_function = ""
|
specified_function = ""
|
||||||
|
@ -1981,7 +1981,7 @@ def transform_genparams(genparams, api_format):
|
||||||
if located_tooljson:
|
if located_tooljson:
|
||||||
tools_array = []
|
tools_array = []
|
||||||
tools_array.append(located_tooljson)
|
tools_array.append(located_tooljson)
|
||||||
tool_json_formatting_instruction = f"The user is asking you to use the style of this JSON object formatting to complete the parameters for the specific function named {specified_function} in the following format: " + json.dumps([{"id": "insert an id for the response", "type": "function", "function": {"name": f"{specified_function}", "arguments": {"first property key": "first property value", "second property key": "second property value"}}}], indent=0)
|
tool_json_formatting_instruction = f"The user is asking you to use the style of this JSON object formatting to complete the parameters for the specific function named {specified_function} in the following format: " + json.dumps([{"id": "insert an id for the response", "type": "function", "function": {"name": f"{specified_function}", "arguments": "{\"first property key\": \"first property value\", \"second property key\": \"second property value\"}"}}], indent=0)
|
||||||
except Exception:
|
except Exception:
|
||||||
# In case of any issues, just revert back to no specified function
|
# In case of any issues, just revert back to no specified function
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue