Create a model response
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.
A message exchanged within the AI chat conversation.
-
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 '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" }