Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/briancabbott_huawon.json
T

1 line
1.6 KiB
JSON

{"repo": "briancabbott/huawon", "files": {"Chinese-Code-Resources/CLUEbenchmark/SuperCLUE/model_cards/360GPT_S2_V9_94.md": {"0e04355956e3fd22bdb2600313b29c03e60dd4a1": {"t": 1785768143.993474, "n": 1280, "h": "9be9407ac87d3ae6", "c": "\n# API 调用代码\n```python\ndef call_360GPT_S2_V9_94(prompt,history=[]):\n api_key=get_available_api_key()\n while not api_key:\n api_key=get_available_api_key()\n\n # url = \"https://ai.360.cn/api/v1/chat/completions\"\n url = \"https://api.360.cn/v1/chat/completions\"\n\n # for user_msg, bot_msg in history:\n # messages.append({\"role\": \"user\", \"content\": user_msg})\n # messages.append({\"role\": \"assistant\", \"content\": bot_msg})\n messages=history+[{\n \"role\": \"user\",\n \"content\": prompt\n }]\n payload = json.dumps({\n \"model\": \"360GPT_S2_V9.4\",\n \"messages\": messages,\n \"stream\": False,\n \"temperature\": 0.9,\n \"max_tokens\": 2048,\n \"top_p\": 0.7,\n \"top_k\": 0,\n \"repetition_penalty\": 1.1,\n \"num_beams\": 1,\n \"user\": \"andy\"\n })\n headers = {\n 'Authorization': api_key,\n 'Content-Type': 'application/json'\n }\n\n response = requests.request(\"POST\", url, headers=headers, data=payload)\n # print(response)\n # print(response.json())\n # print(json.loads(response.text))\n response_text=json.loads(response.text)['choices'][0]['message']['content']\n history.append({\n \"role\": \"assistant\",\n \"content\": response_text\n })\n```\n\n# 服务部署代码\n```python\n```\n\n# 参考\nhttps://ai.360.cn/platform/docs/overview"}}}}