Spaces method and path for this operation:
post /s/{space_id}/api/security_ai_assistant/chat/complete
Refer to Spaces for more information.
Create a model response for the given chat conversation.
Body
Required
-
Required connector identifier to route the request.
-
A string that does not contain only whitespace characters.
Minimum length is
1. -
If true, the response will be streamed in chunks.
-
API key for LangSmith integration.
-
LangSmith project name for tracing.
-
List of chat messages exchanged so far.
-
Model ID or name to use for the response.
-
Whether to persist the chat and response to storage.
-
Prompt template identifier.
-
ISO language code for the assistant's response.
POST
/api/security_ai_assistant/chat/complete
curl \
--request POST 'http://localhost:5601/api/security_ai_assistant/chat/complete' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{"connectorId":"conn-001","persist":true,"messages":[{"role":"user","content":"What are common phishing techniques?"}]}'
Request example
{
"connectorId": "conn-001",
"conversationId": "abc123",
"isStream": true,
"langSmithApiKey": "<LANGSMITH_API_KEY>",
"langSmithProject": "security_ai_project",
"messages": [
{
"content": "What are some common phishing techniques?",
"data": {
"user_id": "user_789"
},
"fields_to_anonymize": [
"user.name",
"source.ip"
],
"role": "user"
}
],
"model": "gpt-4",
"persist": true,
"promptId": "prompt_456",
"responseLanguage": "en"
}
Response examples (200)
(streaming binary response)
Response examples (400)
{
"error": "Bad Request",
"message": "Invalid request payload.",
"statusCode": 400
}