Chat with your knowledge base
This page will help you get started with GenAI Agent.
Authorization
bearerAuth JWT access token returned by Signing In (POST /auth/v1/tokens/).
In: header
Request Body
application/json
User Input/Question content
"hello"The mode of response return, supporting: streaming Streaming mode, implements a typewriter-like output through SSE (Server-Sent Events). blocking Blocking mode, returns result after execution is complete. (Requests may be interrupted if the process is long) Due to Cloudflare restrictions, the request will be interrupted without a return after 100 seconds. Note: blocking mode is not supported in Agent Assistant mode
"blocking"User identifier, used to define the identity of the end-user for retrieval and statistics. Should be uniquely defined by the developer within the application.
"abc-123"Allows the entry of various variable values defined by the App. The inputs parameter contains multiple key/value pairs, with each key corresponding to a specific variable and each value being the specific value for that variable. Default {}
json"{}"Converation ID, to continue the conversation based on previous chat records, it is necessary to pass the previous message's conversation_id.
File list, suitable for inputting files (images) combined with text understanding and answering questions, available only when the model supports Vision capability.
Supported type: image (currently only supports image type)
Transfer method, remote_url for image URL / local_file for file upload
Image URL (when the transfer method is remote_url)
Uploaded file ID, which must be obtained by uploading through the File Upload API in advance (when the transfer method is local_file)
Auto-generate title, default is true. If set to false, can achieve async title generation by calling the conversation rename API and setting auto_generate to true.
Response Body
application/json
text/plain
text/plain
curl -X POST "https://example.com/chat-messages" \ -H "Content-Type: application/json" \ -d '{ "query": "hello", "response_mode": "blocking", "user": "abc-123", "inputs": "{}" }'"{\n \"code\": \"invalid_param\",\n \"message\": \"string is not a valid uuid.\",\n \"params\": \"conversation_id\"\n}"Sending Message POST
Use this API to send a Text message or media message (Image, Video, Audio and Document) to your end-user. You can send a card message using your cards created in Cequens Chat.
Knowledge list GET
This API retrieves a list of all existing knowledge bases, including their details such as names, IDs, and creation dates, to help you manage and organize their data sources.