{
"model": "hy3",
"messages": [
{
"role": "system",
"content": "你是一个专业的 AI 编程助手。"
},
{
"role": "user",
"content": "Python 中如何读取 JSON 文件?"
},
{
"role": "assistant",
"content": "可以使用内置的 json 模块:import json; with open(\\"data.json\\") as f: data = json.load(f)"
},
{
"role": "user",
"content": "如果 JSON 文件很大怎么办?"
}
]
}curl --location '/v1/chat/completions' \
--header 'Accept: application/json' \
--header 'Authorization: {{YOUR API KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"model": "hy3",
"messages": [
{
"role": "system",
"content": "你是一个专业的 AI 编程助手。"
},
{
"role": "user",
"content": "Python 中如何读取 JSON 文件?"
},
{
"role": "assistant",
"content": "可以使用内置的 json 模块:import json; with open(\\"data.json\\") as f: data = json.load(f)"
},
{
"role": "user",
"content": "如果 JSON 文件很大怎么办?"
}
]
}'{
"Created": 0,
"Usage": {
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
},
"Note": "string",
"Id": "string",
"Choices": [
{}
],
"ErrorMsg": {},
"SearchInfo": {},
"Replaces": [
{}
],
"RecommendedQuestions": [
"string"
],
"Processes": {},
"RequestId": "string"
}