Create a model response
Create a model response for the given chat conversation.
Query parameters
-
content_references_disabled
boolean If true, the response will not include content references.
Default value is
false
.
Body
Required
-
connectorId
string Required Required connector identifier to route the request.
-
conversationId
string(nonempty) The ID of the anonymization field.
Minimum length is
1
. -
isStream
boolean If true, the response will be streamed in chunks.
-
langSmithApiKey
string API key for LangSmith integration.
-
langSmithProject
string LangSmith project name for tracing.
-
messages
array[object] Required List of chat messages exchanged so far.
A message exchanged within the AI chat conversation.
-
model
string Model ID or name to use for the response.
-
persist
boolean Required Whether to persist the chat and response to storage.
-
promptId
string Prompt template identifier.
-
responseLanguage
string ISO language code for the assistant's response.
POST
/api/security_ai_assistant/chat/complete
curl \
--request POST 'https://localhost:5601/api/security_ai_assistant/chat/complete' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"model":"gpt-4","persist":true,"isStream":true,"messages":[{"data":{"user_id":"user_789"},"role":"user","content":"What are some common phishing techniques?","fields_to_anonymize":["user.name","source.ip"]}],"promptId":"prompt_456","connectorId":"conn-001","conversationId":"abc123","langSmithApiKey":"sk-abc123","langSmithProject":"security_ai_project","responseLanguage":"en"}'
Request example
{
"model": "gpt-4",
"persist": true,
"isStream": true,
"messages": [
{
"data": {
"user_id": "user_789"
},
"role": "user",
"content": "What are some common phishing techniques?",
"fields_to_anonymize": [
"user.name",
"source.ip"
]
}
],
"promptId": "prompt_456",
"connectorId": "conn-001",
"conversationId": "abc123",
"langSmithApiKey": "sk-abc123",
"langSmithProject": "security_ai_project",
"responseLanguage": "en"
}