Api
LiteralAPI
get_users
Retrieves a list of users based on pagination and optional filters.
Arguments:
filters
Optional[users_filters] - Filters to apply to the user query.
Returns:
get_user
Retrieves a user based on the provided ID or identifier.
Arguments:
Returns:
The user data as returned by the GraphQL helper function.
create_user
Creates a new user with the specified identifier and optional metadata.
Arguments:
Returns:
The result of the GraphQL call to create a user.
update_user
Updates an existing user identified by the given ID, with optional new identifier and metadata.
Arguments:
Returns:
The result of the GraphQL call to update the user.
delete_user
Deletes a user identified by the given ID.
Arguments:
Returns:
The result of the GraphQL call to delete the user.
get_or_create_user
Retrieves a user by their identifier, or creates a new user if they do not exist.
Arguments:
Returns:
The existing or newly created user data.
get_threads
Fetches a list of threads based on pagination and optional filters.
Arguments:
filters
Optional[threads_filters] - Filters to apply on the threads query.order_by
Optional[threads_order_by] - Order by clause for threads. step_types_to_keep (Optional[List[StepType]]) : If set, only steps of the corresponding types will be returned
Returns:
A list of threads that match the criteria.
list_threads
Lists threads based on pagination and optional filters, similar to get_threads but may include additional processing.
Arguments:
filters
Optional[threads_filters] - Filters to apply on the threads listing.order_by
Optional[threads_order_by] - Order by clause for threads.
Returns:
A list of threads that match the criteria.
get_thread
Retrieves a single thread by its ID.
Arguments:
Returns:
The thread corresponding to the provided ID.
create_thread
Creates a new thread with the specified details.
Arguments:
Returns:
The newly created thread.
upsert_thread
Updates an existing thread or creates a new one if it does not exist.
Arguments:
Returns:
The updated or newly created thread.
update_thread
Updates the specified details of an existing thread.
Arguments:
Returns:
The updated thread.
delete_thread
Deletes a thread identified by its ID.
Arguments:
Returns:
The result of the deletion operation.
create_score
Creates a single score in the database.
Arguments:
Returns:
The created Score object.
update_score
Updates a score identified by its ID with new parameters.
Arguments:
Returns:
The result of the update operation.
delete_score
Deletes a score identified by its ID.
Arguments:
Returns:
The result of the deletion operation.
upload_file
Uploads a file to the server.
Arguments:
Returns:
create_attachment
Creates an attachment associated with a thread and step, potentially uploading file content.
Arguments:
Returns:
update_attachment
Updates an existing attachment with new parameters.
Arguments:
Returns:
The result of the update operation.
get_attachment
Retrieves an attachment by its ID.
Arguments:
Returns:
The attachment data as returned by the GraphQL helper function.
delete_attachment
Deletes an attachment identified by its ID.
Arguments:
Returns:
The result of the deletion operation.
create_step
Creates a new step with the specified parameters.
Arguments:
Returns:
The result of the GraphQL helper function for creating a step.
update_step
Updates an existing step identified by its ID with new parameters.
Arguments:
Returns:
The result of the GraphQL helper function for updating a step.
get_steps
Fetches a list of steps based on pagination and optional filters.
Arguments:
filters
Optional[steps_filters] - Filters to apply on the steps query.order_by
Optional[steps_order_by] - Order by clause for steps.
Returns:
A list of steps that match the criteria.
get_step
Retrieves a step by its ID.
Arguments:
Returns:
The step data as returned by the GraphQL helper function.
delete_step
Deletes a step identified by its ID.
Arguments:
Returns:
The result of the deletion operation.
send_steps
Sends a list of steps to be processed.
Arguments:
Returns:
The result of the GraphQL helper function for sending steps.
get_generations
Fetches a list of generations based on pagination and optional filters.
Arguments:
filters
Optional[generations_filters] - Filters to apply to the generations query.order_by
Optional[generations_order_by] - Order by clause for generations.
Returns:
A list of generations that match the criteria.
create_generation
Creates a new generation, either a chat or completion type.
Arguments:
Returns:
The result of the creation operation.
create_dataset
Creates a new dataset with the specified properties.
Arguments:
Returns:
The result of the dataset creation operation.
get_dataset
Retrieves a dataset by its ID or name.
Arguments:
Returns:
The dataset data as returned by the REST helper function.
update_dataset
Updates an existing dataset identified by its ID with new properties.
Arguments:
Returns:
The result of the dataset update operation.
delete_dataset
Deletes a dataset identified by its ID.
Arguments:
Returns:
The result of the deletion operation.
create_experiment
Creates a new experiment associated with a specific dataset.
Arguments:
Returns:
create_experiment_item
Creates an experiment item within an existing experiment.
Arguments:
Returns:
create_dataset_item
Creates a new dataset item with the specified properties.
Arguments:
Returns:
get_dataset_item
Retrieves a dataset item by its unique identifier.
Arguments:
Returns:
delete_dataset_item
Deletes a dataset item by its unique identifier.
Arguments:
Returns:
add_step_to_dataset
Adds a step to a dataset.
Arguments:
Returns:
add_generation_to_dataset
Adds a generation to a dataset.
Arguments:
Returns:
get_or_create_prompt_lineage
Creates a prompt lineage with the specified name and optional description. If the prompt lineage with that name already exists, it is returned.
Arguments:
Returns:
get_or_create_prompt
A Prompt
is fully defined by its name
, template_messages
, settings
and tools.
If a prompt already exists for the given arguments, it is returned.
Otherwise, a new prompt is created.
Arguments:
Returns:
get_prompt
Gets a prompt either by:
id
- or
name
and (optional)version
Either the id
or the name
must be provided.
If both are provided, the id
is used.
Arguments:
Returns:
get_prompt_ab_testing
Get the A/B testing configuration for a prompt lineage.
Arguments:
Returns:
List[PromptRollout]
update_prompt_ab_testing
Update the A/B testing configuration for a prompt lineage.
Arguments:
Returns:
Dict
get_my_project_id
Retrieves the projectId associated to the API key.
Returns:
The projectId associated to the API key.
AsyncLiteralAPI
get_users
Asynchronously fetches a list of users based on pagination and optional filters.
Arguments:
filters
Optional[users_filters] - Filters to apply to the user query.
Returns:
The result of the GraphQL helper function for fetching users.
get_user
Asynchronously retrieves a user by ID or identifier.
Arguments:
Returns:
The result of the GraphQL helper function for fetching a user.
create_user
Asynchronously creates a new user with the specified identifier and optional metadata.
Arguments:
Returns:
The result of the GraphQL helper function for creating a user.
update_user
Asynchronously updates an existing user identified by ID with new identifier and/or metadata.
Arguments:
Returns:
The result of the GraphQL helper function for updating a user.
delete_user
Asynchronously deletes a user identified by ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting a user.
get_or_create_user
Asynchronously retrieves a user by identifier or creates a new one if it does not exist.
Arguments:
Returns:
The existing or newly created user.
get_threads
Asynchronously fetches a list of threads based on pagination and optional filters and ordering.
Arguments:
filters
Optional[threads_filters] - Filters to apply to the thread query.order_by
Optional[threads_order_by] - Ordering criteria for the threads. step_types_to_keep (Optional[List[StepType]]) : If set, only steps of the corresponding types will be returned
Returns:
The result of the GraphQL helper function for fetching threads.
list_threads
Asynchronously lists threads based on pagination and optional filters and ordering, similar to get_threads
.
Arguments:
filters
Optional[threads_filters] - Filters to apply to the thread query.order_by
Optional[threads_order_by] - Ordering criteria for the threads.
Returns:
The result of the GraphQL helper function for listing threads.
get_thread
Asynchronously retrieves a thread by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for fetching a thread.
create_thread
Asynchronously creates a new thread with specified details.
Arguments:
Returns:
The result of the GraphQL helper function for creating a thread.
upsert_thread
Asynchronously updates or inserts a thread based on the provided ID.
Arguments:
Returns:
The result of the GraphQL helper function for upserting a thread.
update_thread
Asynchronously updates an existing thread identified by ID with new details.
Arguments:
Returns:
The result of the GraphQL helper function for updating a thread.
delete_thread
Asynchronously deletes a thread identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting a thread.
get_scores
Asynchronously fetches scores based on pagination and optional filters.
Arguments:
filters
Optional[scores_filters] - Filters to apply to the scores query.order_by
Optional[scores_order_by] - Ordering options for the scores.
Returns:
The result of the GraphQL helper function for fetching scores.
create_scores
Asynchronously creates multiple scores.
Arguments:
Returns:
The result of the GraphQL helper function for creating scores.
create_score
Asynchronously creates a single score.
Arguments:
Returns:
The result of the GraphQL helper function for creating a score.
update_score
Asynchronously updates a score identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for updating a score.
delete_score
Asynchronously deletes a score identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting a score.
upload_file
Asynchronously uploads a file to the server.
Arguments:
Returns:
A dictionary containing the object key and URL of the uploaded file.
create_attachment
Asynchronously creates an attachment and uploads it if content is provided.
Arguments:
Returns:
The attachment object created after the upload and creation process.
update_attachment
Asynchronously updates an attachment identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for updating an attachment.
get_attachment
Asynchronously retrieves an attachment by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for fetching an attachment.
delete_attachment
Asynchronously deletes an attachment identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting an attachment.
create_step
Asynchronously creates a new step with the specified parameters.
Arguments:
Returns:
The result of the GraphQL helper function for creating a step.
update_step
Asynchronously updates an existing step identified by its ID with new parameters.
Arguments:
Returns:
The result of the GraphQL helper function for updating a step.
get_step
Asynchronously retrieves a step by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for fetching a step.
delete_step
Asynchronously deletes a step identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting a step.
send_steps
Asynchronously sends a list of steps to be processed.
Arguments:
Returns:
The result of the GraphQL helper function for sending steps.
get_generations
Asynchronously fetches a list of generations based on pagination and optional filters.
Arguments:
filters
Optional[generations_filters] - Filters to apply to the generations query.order_by
Optional[generations_order_by] - Ordering options for the generations.
Returns:
The result of the GraphQL helper function for fetching generations.
create_generation
Asynchronously creates a new generation with the specified details.
Arguments:
Returns:
The result of the GraphQL helper function for creating a generation.
create_dataset
Asynchronously creates a new dataset with the specified details.
Arguments:
Returns:
The result of the GraphQL helper function for creating a dataset.
get_dataset
Asynchronously retrieves a dataset by its ID or name.
Arguments:
Returns:
The processed response from the REST API call.
update_dataset
Asynchronously updates an existing dataset identified by its ID with new details.
Arguments:
Returns:
The result of the GraphQL helper function for updating a dataset.
delete_dataset
Asynchronously deletes a dataset identified by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting a dataset.
create_experiment_item
Asynchronously creates an item within an experiment.
Arguments:
Returns:
create_dataset_item
Asynchronously creates a dataset item.
Arguments:
Returns:
The result of the GraphQL helper function for creating a dataset item.
get_dataset_item
Asynchronously retrieves a dataset item by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for fetching a dataset item.
delete_dataset_item
Asynchronously deletes a dataset item by its ID.
Arguments:
Returns:
The result of the GraphQL helper function for deleting a dataset item.
add_step_to_dataset
Asynchronously adds a step to a dataset.
Arguments:
Returns:
The result of the GraphQL helper function for adding a step to a dataset.
add_generation_to_dataset
Asynchronously adds a generation to a dataset.
Arguments:
Returns:
The result of the GraphQL helper function for adding a generation to a dataset.