Open alanhe421 opened 1 year ago
curl https://api.openai.com/v1/engines/davinci-codex/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_OPENAI_API_KEY" \
-d '{
"prompt": "Translate the following English text to French: '{}'",
"max_tokens": 60
}'
https://github.com/THUDM/ChatGLM-6B/tree/main#api%E9%83%A8%E7%BD%B2
curl -X POST "http://127.0.0.1:8000" \
-H 'Content-Type: application/json' \
-d '{"prompt": "你好", "history": []}'
import fetch from 'node-fetch';
fetch('https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation', {
method: 'POST',
headers: {
'Authorization': 'Bearer xxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'qwen-turbo',
input: {
messages: [
{
"role": "system",
"content": "你是WebShell AI助手."
},
{
"role": "user",
"content": "如何安装szrz?"
}
]
},
parameters: {
result_format: 'message'
}
})
})
.then(res=>res.json()).then(res => {
return res.output.choices[0].message;
}).then(console.log)
.catch(console.error);
百度文心一言
虽然垃圾,但也有一定市场
https://cloud.baidu.com/doc/WENXINWORKSHOP/s/flfmc9do2
https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant