Skip to main content

Query LMT (Language Model Testing)

Used to query the Language Model Testing endpoint for conversational interactions with AI agents. This endpoint processes user queries and returns AI-generated responses along with follow-up suggestions.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/ai-agent/query-lmt

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/ai-agent/query-lmt' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"query": "What are the key features of your platform?",
"session_id": "session_abc123"
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"project_key": "string",
"query": "string",
"session_id": "string"
}

Request Body Parameters

FieldTypeRequiredDescription
project_keystringYesThe project key for your project.
querystringYesThe user's question or message to the AI agent.
session_idstringYesUnique identifier for the conversation session to maintain context.
note

Session Management

  • The session_id is used to maintain conversation context across multiple queries
  • Use the same session_id for related queries in a conversation
  • Generate a new session_id for each new conversation session
  • The AI agent uses the session history to provide contextually relevant responses

Response

Success Response (200 OK)

Returns an object containing the AI agent's response and additional metadata.

{
"is_success": true,
"detail": "Query processed successfully",
"query": "What are the key features of your platform?",
"response": "Our platform offers several key features including: multi-language support for over 50 languages, real-time analytics and reporting, comprehensive API documentation, scalable architecture for high-volume requests, and advanced AI-powered automation capabilities. Each feature is designed to help businesses streamline their operations and improve customer engagement.",
"response_timestamp": "2026-01-11T13:24:48.085Z",
"next_step_questions": [
"Can you tell me more about the multi-language support?",
"What kind of analytics are available?",
"How does the API integration work?"
],
"session_id": "session_abc123"
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the query was processed successfully.
detailstringSuccess or failure message with additional context.
querystringThe original user query that was processed.
responsestringThe AI agent's generated response to the query.
response_timestampstringISO 8601 timestamp of when the response was generated.
next_step_questionsarrayArray of suggested follow-up questions.
session_idstringThe session identifier used for this conversation.
tip

Using Next Step Questions The next_step_questions array contains AI-generated suggestions for follow-up queries. These can be presented to users as clickable options to:

  • Guide the conversation naturally
  • Help users discover relevant information
  • Improve user engagement
  • Reduce friction in finding answers

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"query"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid query or sessionBad Request
422Validation Error - Invalid request parametersUnprocessable Entity
500Internal Server Error - LLM processing failedServer Error