Request
Provide your bearer token in the Authorization
header when making requests to protected resources. Example:Authorization: Bearer ********************
Example:Bearer {{YOUR_API_KEY}}
Body Params application/json
Need for models for chat use
Streaming or not, default streaming response
history
array [object {2}]
requiredGet top n from the vector library to use as a contextual dialog
Filter weights, only records greater than this value will be used
{
"kb_id": 0,
"model_name": "gpt-4o-mini",
"query": "你好",
"stream": false,
"history": [
{"role": "user","content": "你好啊"},
{"role": "assistant","content": "你好"}
],
"top_k": 5,
"score_threshold": 1,
"temperature":0.5
}
Request samples
curl --location --request POST 'https://api.302.ai/302/kb/chat/knowledge_base_chat' \
--header 'Authorization: Bearer sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header 'Content-Type: application/json' \
--data-raw '{
"kb_id": 0,
"model_name": "gpt-4o-mini",
"query": "你好",
"stream": false,
"history": [
{"role": "user","content": "你好啊"},
{"role": "assistant","content": "你好"}
],
"top_k": 5,
"score_threshold": 1,
"temperature":0.5
}'
Responses
application/json Modified at 2024-10-24 08:36:42