Chat API Reference
Following are the steps to use Test it
feature.
Replace the {{url}} with the deployed url.
Get the api key from the GenAI Stack for authentication.
Now you're ready to test the APIs.
Last updated
Following are the steps to use Test it
feature.
Replace the {{url}} with the deployed url.
Get the api key from the GenAI Stack for authentication.
Now you're ready to test the APIs.
Last updated
Successful Response
Initiates or continues a chat session by sending a payload to the specified chat session.
This endpoint allows users to interact with a chat session by sending a payload. The payload will be processed according to the chat session's logic, and a response will be streamed back. This endpoint requires user authentication and is subject to rate limiting to ensure fair usage.
Parameters:
stack_app_id
: str - The unique identifier of the stack app associated with the chat session. It is a path parameter.chat_session_id
: str - The unique identifier of the chat session to which the message is being sent. It is a path parameter.payload
: dict - A JSON object containing the chatKey & inputs. The values of chatKey & inputs will be dynamic check the form_keys_data object in stack app data in which chatKey is key given in input_keys & inputs is object containing all the required inputs. When there are multiple input_keys chatKey can be the key which you want to make it primary.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Successful Response:
text/event-stream
format.Errors:
Retry-After
header indicating how long the client should wait before retrying.404 HTTPException
if stack app doesn't existNotes:
Successful Response
This endpoint lists all files, URLs, or text snippets associated with a chat session, allowing for a comprehensive view of the resources related to a conversation.
Parameters:
stack_app_id
: str - The unique identifier of the stack app associated with the chat session.chat_session_id
: str - The unique identifier of the chat session for which to list uploads.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Successfully returns a list of uploads for the chat session.401 Unauthorized
: User authentication failed.404 HTTPException
if stack app doesn't existThis endpoint provides an overview of all resources uploaded or linked in the context of a specific chat session.
Successful Response
Retrieve details of a specific chat session by its ID and associated stack app ID.
Parameters:
stack_app_id
: UUID - Path parameter to specify the stack app ID.chat_session_id
: str - Path parameter to specify the chat session ID.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Successfully retrieves and returns the details of the chat session.400 Bad Request
: If the chat_session_id
is not a valid UUID.401 Unauthorized
: If user authentication fails.404 Not Found
: If no chat session is found matching the criteria.Exceptions:
400 HTTPException
if chat_session_id
is invalid.401 HTTPException
for unauthorized access.404 HTTPException
if the chat session is not found.404 HTTPException
if stack app doesn't existSuccessful Response
Upload a file, or provide a URL or text to be associated with a chat session. This endpoint supports file uploads for further processing and inclusion in the chat session's context or data pipelines.
Parameters:
stack_app_id
: str - The unique identifier for the stack app associated with this chat session.chat_session_id
: str - The unique identifier for the chat session where the file or text is to be uploaded.input_key
: str - A key identifying the type of input or the specific pipeline this upload is associated with.url
: str (optional) - A URL pointing to a resource to be associated with the chat session.file
: UploadFile (optional) - The file to be uploaded. Files should be less than 50MB in size.text
: str (optional) - Text content to be associated with the chat session.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Returns the details of the uploaded file or the provided URL/text including any metadata.401 Unauthorized
: User authentication failed.400 Bad Request
: Data pipeline for the provided input_key not found or the file size exceeds the limit.429 Too Many Requests
: The request is throttled based on rate limiting.404 HTTPException
if stack app doesn't existUsage:
This endpoint is subject rate limiting to ensure smooth experience for all the users.
Successful Response
Create a new chat session associated with a specific stack app.
Parameters:
stack_app_id
: UUID - Path parameter to specify the stack app ID the chat session will be associated with.title
: Optional[str] - A custom title for the chat session. If not provided, a default title "New Chat" is used.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Returns the created chat session's details.401 Unauthorized
: If user authentication fails.429 Too Many Requests
: If the request is throttled based on rate limiting.Exceptions:
401 HTTPException
for unauthorized access.429 HTTPException
for exceeding rate limit, with retry information.404 HTTPException
if stack app doesn't existSuccessful Response
Retrieve the status and details of a specific file upload, URL, or text associated with a chat session. This allows for detailed tracking and management of resources within a chat context.
Parameters:
stack_app_id
: str - The unique identifier of the stack app associated with the chat session.upload_id
: str - The unique identifier of the upload whose details are being retrieved.chat_session_id
: str - The unique identifier of the chat session associated with the upload.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Successfully returns the details of the specified upload.401 Unauthorized
: User authentication failed.404 HTTPException
if stack app doesn't existSuccessful Response
Retrieve the stack app instance.
This endpoint fetches the stack app, including its associated chat sessions or text generations based on the interface type selected, using the provided token/api key.
Parameters:
authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Returns a detailed view of the stack app including chat sessions and text generations.404 Not Found
: If no stack app is found for the given criteria.Exceptions:
404 HTTPException
if no stack app is found.Successful Response
Update details of an existing chat session, such as its title.
Parameters:
stack_app_id
: UUID - Path parameter for the associated stack app.chat_session_id
: UUID - Path parameter for the chat session to update.update_request
: ChatSessionUpdate - The request body containing the update details.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Returns the updated chat session details.401 Unauthorized
: If user authentication fails.404 Not Found
: If no chat session is found matching the criteria.Exceptions:
401 HTTPException
for unauthorized access.404 HTTPException
if the chat session not found404 HTTPException
if stack app doesn't existSuccessful Response