智谱的官方文档中glm4.6支持thinking字段开启思考,请问心流的api怎么开启思考呢
curl -X POST “https://api.z.ai/api/paas/v4/chat/completions”
-H “Content-Type: application/json”
-H “Authorization: Bearer your-api-key”
-d ‘{
“model”: “glm-4.6”,
“messages”: [
{
“role”: “user”,
“content”: “As a marketing expert, please create an attractive slogan for my product.”
},
{
“role”: “assistant”,
“content”: “Sure, to craft a compelling slogan, please tell me more about your product.”
},
{
“role”: “user”,
“content”: “Z.AI Open Platform”
}
],
“thinking”: {
“type”: “enabled”
},
“max_tokens”: 4096,
“temperature”: 1.0
}’
测试了不支持这个字段。
{
"model": "glm-4.6",
"stream": true,
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "你是谁"
}
],
"thinking": {
"type": "enabled"
}
}
这样试试
感谢 可以了
怎么用的啊,我在roocode插件里应该怎么调整啊?
/qa 问问iflow?
\# 使用OpenAI SDK调用
response = await self.client.chat.completions.create(
model=self.model,
messages=self.conversation_history,
thinking={
"type": "enabled" # 启用思考模式
}
)
你: 你好
AI:
错误: AsyncCompletions.create() got an unexpected keyword argument ‘thinking’
这种不支持吗?
response = await self.client.chat.completions.create(
3 model=self.model,
4 messages=self.conversation_history,
5 extra_body={
6 “thinking”: {“type”: “enabled”}
7 }
8 )
运行成功了
试过了 其实不可以的。开了没用。只有postman给的普通请求可以。agent的请求不可以的