# Demand from the agent and get a full response when it finishes Executes a chain of AI-powered reasoning and actions to respond to a given query or task. The agent leverages its configured tools and knowledge to: - Analyze the input query - Plan necessary steps - Execute relevant tools - Synthesize a comprehensive response ## Image Support Include images in your request using the images field: - Base64 Format: Set type="base64" with base64-encoded image data - File Path: Set type="file_path" with path to existing image Maximum 5 images per request. Invalid images will trigger a 400 response. ## Authentication Requires API key via x-wabee-access header. ## Session Management Use session-id header to maintain conversation context across requests. Endpoint: POST /core/v1/chain Version: v1 Security: APIKeyHeader ## Header parameters: - `session-id` (any) Session unique identifier, used to keep track of previous interations and enhanced observability. We recommend using a UUID string. - `request-id` (any) Custom request unique identifier, if not provided a new one will be generated. We recommend using a UUID string. ## Request fields (application/json): - `messages` (array, required) List of messages to be processed by the agent Example: [{"content":"What is the economic outlook?","role":"user"}] - `messages.role` (string, required) defines the role associated with the message Example: "assistant" - `messages.content` (string, required) message content Example: "Hello, I am your virtual assistant" - `data_filter_hints` (any) Special metadata-like hints to be passed to the agent in order to instruct him on how to filter the data on some tools that support filter Example: [{"filter_key":"unitname","filter_type":"equals","filter_value":"Unit 1","tool_name":"bubble_data"}] - `auto_memory_retain` (boolean) Indicates whether the agent should automatically retain information from the session in memory. When enabled, allows the agent to learn from experiences and feedback. - `context_files` (any) The path for files which the agent already has access to and should be considered by it when processing the messages Example: ["inputs/chat-files/test123/file.pdf"] - `images` (any) List of images associated with the message ## Response 200 fields (application/json): - `body` (object, required) The complete agent response - `body.input` (string, required) The original input message sent to the agent Example: "What is the economic outlook?" - `body.output` (string, required) The final response generated by the agent Example: "The economic outlook varies significantly by region..." - `body.intermediate_steps` (array, required) The sequence of steps taken by the agent to generate the response, including tool usage and reasoning Example: [[{"log":"Retrieving news data","tool":"api_tool","tool_input":"curl https://newsapi.org/v2/everything","type":"AgentAction"},"Explanation: Gathering real-time economic data from trusted sources"]] - `body.usage` (array, required) Resource usage metrics for the request - `body.usage.costAttribute` (string, required) The name of the resource being measured (e.g. model name) Example: "gpt-4-32k" - `body.usage.usage` (string, required) The quantity of the resource used Example: "100" - `body.usage.unit` (string, required) The unit of measurement (e.g. tokens, requests) Example: "tokens" ## Response 400 fields (application/json): - `body` (string, required) Error message or description - `status_code` (integer, required) HTTP status code Example: 400 - `details` (any) Additional error details if available ## Response 401 fields (application/json): - `body` (string, required) Error message or description - `status_code` (integer, required) HTTP status code Example: 400 - `details` (any) Additional error details if available ## Response 403 fields (application/json): - `body` (string, required) Error message or description - `status_code` (integer, required) HTTP status code Example: 400 - `details` (any) Additional error details if available ## Response 413 fields (application/json): - `body` (string, required) Error message or description - `status_code` (integer, required) HTTP status code Example: 400 - `details` (any) Additional error details if available ## Response 422 fields (application/json): - `body` (string, required) Error message or description - `status_code` (integer, required) HTTP status code Example: 400 - `details` (any) Additional error details if available ## Response 500 fields (application/json): - `body` (string, required) Error message or description - `status_code` (integer, required) HTTP status code Example: 400 - `details` (any) Additional error details if available