Text Generation 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
Retrieves a list of text generations created by the authenticated user, ordered by creation date in descending order.
Parameters:
authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Responses:
200 OK
: Returns a list of TextGenerationRead
objects, each representing a text generation instance.401 Unauthorized
: User authentication failed.Exceptions:
401 HTTPException
for unauthorized access.This endpoint allows users to view all their text generation activities within the system, providing a comprehensive history of generated texts.
Successful Response
Creates a new text generation request based on the input provided and associates it with the authenticated user.
Parameters:
request
: Request - The request object, allowing access to the request body.authorization
: str - Provide your API key as a Bearer token in the Authorization header to authenticate requests.Request Body: The body should contain form data representing the inputs for text generation. form data should be a list of dict(s).
input_key
: str - A key for identifying a input or the specific pipeline this upload is associated with.input_value
: str | UploadFile - A resource to be associated with the input_key for Text Generation session.Responses:
200 OK
: Successfully creates a new text generation instance and returns its details as a TextGenerationRead
object.401 Unauthorized
: User authentication failed.Exceptions:
401 HTTPException
for unauthorized access.Upon successful creation, this endpoint asynchronously triggers the text generation process and returns the created instance's details without waiting for the generation to complete.
Successful Response
Updates the title of a text generation session.
Parameters:
text_gen_id
: str - The unique identifier of the text generation instance to retrieve.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 specified text generation instance as a TextGenerationRead
object after updating it.400 Bad Request
: If the text_gen_id
is not a valid UUID.401 Unauthorized
: User authentication failed.404 Not Found
: If no text generation instance is found matching the text_gen_id
for the authenticated user.This endpoint allows users to update the title of text generation session.
Successful Response
Retrieves the details of a specific text generation instance by its ID, for the authenticated user.
Parameters:
text_gen_id
: str - The unique identifier of the text generation instance to retrieve.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 specified text generation instance as a TextGenerationRead
object.400 Bad Request
: If the text_gen_id
is not a valid UUID.401 Unauthorized
: User authentication failed.404 Not Found
: If no text generation instance is found matching the text_gen_id
for the authenticated user.This endpoint allows users to access detailed information about a specific text generation activity, including its inputs and any generated outputs.
Successful 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