"src/vscode:/vscode.git/clone" did not exist on "dcf320f2937f19581bad195e35d6ba796d807c42"
Commit ccd82bfe authored by dengjb's avatar dengjb
Browse files

Update api_request.py

parent 68df1089
......@@ -68,22 +68,23 @@ client = OpenAI(
base_url=openai_api_base,
)
completion = client.chat.completions.create(
model="zai-org/GLM-4.5",
model="glm-4.5",
messages=messages,
max_tokens=4096,
temperature=0.0,
# extra_body={"chat_template_kwargs": {"enable_thinking": False}} # Uncomment this line to disable thinking
)
tool_call = completion.choices[0].message.tool_calls[0]
args = json.loads(tool_call.function.arguments)
print("===== TOOL CALL =====")
print(tool_call)
print(completion.choices[0].message)
# tool_call = completion.choices[0].message.tool_calls[0]
# args = json.loads(tool_call.function.arguments)
# print("===== TOOL CALL =====")
# print(tool_call)
messages.append(completion.choices[0].message)
messages.append(tools_messages[0])
## This part is to simulate the tool response
completion_2 = client.chat.completions.create(
model="zai-org/GLM-4.5",
model="glm-4.5",
messages=messages,
tools=tools,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment