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
ストリーミングかどうか、デフォルトはストリーミング応答
history
array [object {2}]
requiredベクターライブラリからtop n件を取得し、コンテクストダイアログとして使用します。
フィルタ重み、この値より大きいレコードのみが使用されます
{
"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-mfYQzy0XTFfz4P16vRE4gFrKK1Nly4TozsMqbbb9PSiJUvFO' \
--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-25 03:10:39