mirror of
https://github.com/iSharkFly-Docs/opensearch-docs-cn
synced 2025-03-08 00:29:08 +00:00
Fix API call to create connector in ml-commons->conversational-search->rag-pipeline (#5614)
* Update conversational-search.md Signed-off-by: Kalyan <kalyan.ben10@live.com> * Update conversational-search.md Signed-off-by: Kalyan <kalyan.ben10@live.com> * fix connector create json Signed-off-by: kalyanr <kalyan.ben10@live.com> --------- Signed-off-by: Kalyan <kalyan.ben10@live.com> Signed-off-by: kalyanr <kalyan.ben10@live.com>
This commit is contained in:
parent
bb269db70b
commit
72ef804197
@ -250,29 +250,29 @@ Use the following steps to set up an HTTP connector using the OpenAI GPT 3.5 mod
|
|||||||
```json
|
```json
|
||||||
POST /_plugins/_ml/connectors/_create
|
POST /_plugins/_ml/connectors/_create
|
||||||
{
|
{
|
||||||
"name": "OpenAI Chat Connector",
|
"name": "OpenAI Chat Connector",
|
||||||
"description": "The connector to public OpenAI model service for GPT 3.5",
|
"description": "The connector to public OpenAI model service for GPT 3.5",
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
"endpoint": "[api.openai.com](http://api.openai.com/)",
|
"endpoint": "api.openai.com",
|
||||||
"model": "gpt-3.5-turbo",
|
"model": "gpt-3.5-turbo",
|
||||||
"temperature": 0
|
"temperature": 0
|
||||||
},
|
},
|
||||||
"credential": {
|
"credential": {
|
||||||
"openAI_key": "<your OpenAI key>"
|
"openAI_key": "<your OpenAI key>"
|
||||||
},
|
},
|
||||||
"actions": [
|
"actions": [
|
||||||
{
|
{
|
||||||
"action_type": "predict",
|
"action_type": "predict",
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
"url": "[https://$](https://%24/){parameters.endpoint}/v1/chat/completions",
|
"url": "https://${parameters.endpoint}/v1/chat/completions",
|
||||||
"headers": {
|
"headers": {
|
||||||
"Authorization": "Bearer ${credential.openAI_key}"
|
"Authorization": "Bearer ${credential.openAI_key}"
|
||||||
},
|
},
|
||||||
"request_body": "{ \"model\": \"${parameters.model}\", \"messages\": ${parameters.messages}, \"temperature\": $ {parameters.temperature} }"
|
"request_body": "{ \"model\": \"${parameters.model}\", \"messages\": ${parameters.messages}, \"temperature\": ${parameters.temperature} }"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
{% include copy-curl.html %}
|
{% include copy-curl.html %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user