LiteralAPI
get_users
Optional[int]
The number of users to retrieve.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[users_filters] - Filters to apply to the user query.
A dictionary containing the queried user data.
get_user
Optional[str]
The unique ID of the user.
Optional[str]
A unique identifier for the user, such as a username or email.
create_user
str
A unique identifier for the user, such as a username or email.
Optional[Dict]
Additional data associated with the user.
update_user
str
The unique ID of the user to update.
Optional[str]
A new identifier for the user, such as a username or email.
Optional[Dict]
New or updated metadata for the user.
delete_user
str
The unique ID of the user to delete.
get_or_create_user
str
The identifier of the user to retrieve or create.
Optional[Dict]
Metadata to associate with the user if they are created.
get_threads
Optional[int]
Number of threads to fetch.
Optional[str]
Cursor for pagination, fetch threads after this cursor.
Optional[str]
Cursor for pagination, fetch threads before this cursor.
filtersOptional[threads_filters] - Filters to apply on the threads query.order_byOptional[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
list_threads
Optional[int]
Number of threads to list.
Optional[str]
Cursor for pagination, list threads after this cursor.
Optional[str]
Cursor for pagination, list threads before this cursor.
filtersOptional[threads_filters] - Filters to apply on the threads listing.order_byOptional[threads_order_by] - Order by clause for threads.
get_thread
str
The unique identifier of the thread.
create_thread
Optional[str]
Name of the thread.
Optional[Dict]
Metadata associated with the thread.
Optional[str]
Identifier for the participant.
Optional[List[str]]
List of tags associated with the thread.
upsert_thread
str
The unique identifier of the thread.
Optional[str]
Name of the thread.
Optional[Dict]
Metadata associated with the thread.
Optional[str]
Identifier for the participant.
Optional[List[str]]
List of tags associated with the thread.
update_thread
str
The unique identifier of the thread to update.
Optional[str]
New name of the thread.
Optional[Dict]
New metadata for the thread.
Optional[str]
New identifier for the participant.
Optional[List[str]]
New list of tags for the thread.
delete_thread
str
The unique identifier of the thread to delete.
create_score
str
The name of the score.
float
The numerical value of the score.
ScoreType
The type of the score.
Optional[str]
The ID of the step associated with the score.
Optional[str]
The ID of the generation associated with the score.
Optional[str]
The ID of the dataset experiment item associated with the score.
Optional[str]
An optional comment about the score.
Optional[List[str]]
Optional tags associated with the score.
update_score
str
The unique identifier of the score to update.
ScoreUpdate
A dictionary of parameters to update in the score.
delete_score
str
The unique identifier of the score to delete.
upload_file
Union[bytes, str]
The content of the file to upload.
Optional[str]
The ID of the thread associated with the file.
Optional[str]
The MIME type of the file. Defaults to ‘application/octet-stream’.
A dictionary containing the object key and URL of the uploaded file, or None values if the upload fails.
create_attachment
str
The ID of the thread to which the attachment is linked.
str
The ID of the step to which the attachment is linked.
Optional[str]
The ID of the attachment, if updating an existing one.
Optional[Dict]
Metadata associated with the attachment.
Optional[str]
MIME type of the file, if content is provided.
Optional[str]
Name of the attachment.
Optional[str]
Object key of the uploaded file, if already known.
Optional[str]
URL of the uploaded file, if already known.
Optional[Union[bytes, str]]
File content to upload.
Optional[str]
Path where the file should be stored.
The created or updated attachment object.
update_attachment
str
The unique identifier of the attachment to update.
AttachmentUpload
The parameters to update in the attachment.
get_attachment
str
The unique identifier of the attachment to retrieve.
delete_attachment
str
The unique identifier of the attachment to delete.
create_step
Optional[str]
The ID of the thread this step is associated with.
Optional[StepType]
The type of the step, defaults to “undefined”.
Optional[str]
The start time of the step.
Optional[str]
The end time of the step.
Optional[Dict]
Input data for the step.
Optional[Dict]
Output data from the step.
Optional[Dict]
Metadata associated with the step.
Optional[str]
The ID of the parent step, if any.
Optional[str]
The name of the step.
Optional[List[str]]
Tags associated with the step.
Optional[str]
The ID of the root run, if any.
update_step
str
The unique identifier of the step to update.
Optional[StepType]
The type of the step.
Optional[str]
Input data for the step.
Optional[str]
Output data from the step.
Optional[Dict]
Metadata associated with the step.
Optional[str]
The name of the step.
Optional[List[str]]
Tags associated with the step.
Optional[str]
The start time of the step.
Optional[str]
The end time of the step.
Optional[str]
The ID of the parent step, if any.
get_steps
Optional[int]
Number of steps to fetch.
Optional[str]
Cursor for pagination, fetch steps after this cursor.
Optional[str]
Cursor for pagination, fetch steps before this cursor.
filtersOptional[steps_filters] - Filters to apply on the steps query.order_byOptional[steps_order_by] - Order by clause for steps.
get_step
str
The unique identifier of the step to retrieve.
delete_step
str
The unique identifier of the step to delete.
send_steps
List[Union[StepDict, Step]]
A list of steps or step dictionaries to send.
get_generations
Optional[int]
The number of generations to retrieve.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[generations_filters] - Filters to apply to the generations query.order_byOptional[generations_order_by] - Order by clause for generations.
create_generation
Union[ChatGeneration, CompletionGeneration]
The generation data to create.
create_dataset
str
The name of the dataset.
Optional[str]
A description of the dataset.
Optional[Dict]
Additional metadata for the dataset.
DatasetType
The type of the dataset, defaults to “key_value”.
get_dataset
Optional[str]
The unique identifier of the dataset.
Optional[str]
The name of the dataset.
update_dataset
str
The unique identifier of the dataset to update.
Optional[str]
A new name for the dataset.
Optional[str]
A new description for the dataset.
Optional[Dict]
New or updated metadata for the dataset.
delete_dataset
str
The unique identifier of the dataset to delete.
create_experiment
str
The name of the experiment.
Optional[str]
The unique identifier of the dataset.
Optional[str]
The identifier of the prompt associated with the experiment.
Optional[Dict]
Additional parameters for the experiment.
The newly created experiment object.
create_experiment_item
DatasetExperimentItem
The experiment item to be created, containing all necessary data.
The newly created experiment item with scores attached.
create_dataset_item
str
The unique identifier of the dataset.
Dict
The input data for the dataset item.
Optional[Dict]
The expected output data for the dataset item.
Optional[Dict]
Additional metadata for the dataset item.
The result of the dataset item creation operation.
get_dataset_item
str
The unique identifier of the dataset item to retrieve.
The dataset item data.
delete_dataset_item
str
The unique identifier of the dataset item to delete.
The result of the dataset item deletion operation.
add_step_to_dataset
str
The unique identifier of the dataset.
str
The unique identifier of the step to add.
Optional[Dict]
Additional metadata for the step being added.
The result of adding the step to the dataset.
add_generation_to_dataset
str
The unique identifier of the dataset.
str
The unique identifier of the generation to add.
Optional[Dict]
Additional metadata for the generation being added.
The result of adding the generation to the dataset.
get_or_create_prompt_lineage
str
The name of the prompt lineage.
Optional[str]
An optional description of the prompt lineage.
The result of the prompt lineage creation operation.
get_or_create_prompt
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:
str
The name of the prompt to retrieve or create.
List[GenerationMessage]
A list of template messages for the prompt.
Optional[Dict]
Optional settings for the prompt.
Optional[List[Dict]]
Optional tool options for the model
The prompt that was retrieved or created.
get_prompt
id- or
nameand (optional)version
id or the name must be provided.
If both are provided, the id is used.
Arguments:
str
The unique identifier of the prompt to retrieve.
str
The name of the prompt to retrieve.
Optional[int]
The version number of the prompt to retrieve.
The prompt with the given identifier or name.
get_prompt_ab_testing
str
The name of the prompt lineage.
update_prompt_ab_testing
str
The name of the prompt lineage.
List[PromptRollout]
The percentage rollout for each prompt version.
get_my_project_id
AsyncLiteralAPI
get_users
Optional[int]
The number of users to retrieve.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[users_filters] - Filters to apply to the user query.
get_user
Optional[str]
The unique identifier of the user to retrieve.
Optional[str]
An alternative identifier for the user.
create_user
str
The identifier for the new user.
Optional[Dict]
Additional metadata for the user.
update_user
str
The unique identifier of the user to update.
Optional[str]
New identifier for the user.
Optional[Dict]
New metadata for the user.
delete_user
str
The unique identifier of the user to delete.
get_or_create_user
str
The identifier of the user to retrieve or create.
Optional[Dict]
Metadata for the user if creation is necessary.
get_threads
Optional[int]
The number of threads to retrieve.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[threads_filters] - Filters to apply to the thread query.order_byOptional[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
list_threads
get_threads.
Arguments:
Optional[int]
The number of threads to list.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[threads_filters] - Filters to apply to the thread query.order_byOptional[threads_order_by] - Ordering criteria for the threads.
get_thread
str
The unique identifier of the thread to retrieve.
create_thread
Optional[str]
The name of the thread.
Optional[Dict]
Metadata associated with the thread.
Optional[str]
Identifier for the participant associated with the thread.
Optional[List[str]]
Tags associated with the thread.
upsert_thread
str
The unique identifier of the thread to upsert.
Optional[str]
The name of the thread.
Optional[Dict]
Metadata associated with the thread.
Optional[str]
Identifier for the participant associated with the thread.
Optional[List[str]]
Tags associated with the thread.
update_thread
str
The unique identifier of the thread to update.
Optional[str]
New name of the thread.
Optional[Dict]
New metadata for the thread.
Optional[str]
New identifier for the participant.
Optional[List[str]]
New list of tags for the thread.
delete_thread
str
The unique identifier of the thread to delete.
get_scores
Optional[int]
The number of scores to retrieve.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[scores_filters] - Filters to apply to the scores query.order_byOptional[scores_order_by] - Ordering options for the scores.
create_scores
List[literalai.observability.step.ScoreDict]
A list of dictionaries representing the scores to be created.
create_score
str
The name of the score.
float
The numerical value of the score.
ScoreType
The type of the score.
Optional[str]
The ID of the step associated with the score.
Deprecated - use step_id
Optional[str]
The ID of the dataset experiment item associated with the score.
Optional[str]
A comment associated with the score.
Optional[List[str]]
A list of tags associated with the score.
update_score
str
The unique identifier of the score to update.
ScoreUpdate
A dictionary of parameters to update.
delete_score
str
The unique identifier of the score to delete.
upload_file
Union[bytes, str]
The content of the file to upload.
str
The ID of the thread associated with the file.
Optional[str]
The MIME type of the file.
create_attachment
str
The ID of the thread associated with the attachment.
str
The ID of the step associated with the attachment.
Optional[str]
An optional unique identifier for the attachment.
Optional[Dict]
Optional metadata for the attachment.
Optional[str]
The MIME type of the attachment.
Optional[str]
The name of the attachment.
Optional[str]
The object key for the attachment if already uploaded.
Optional[str]
The URL of the attachment if already uploaded.
Optional[Union[bytes, str]]
The content of the attachment to upload.
Optional[str]
The file path of the attachment if it is to be uploaded from a local file.
update_attachment
str
The unique identifier of the attachment to update.
AttachmentUpload
A dictionary of parameters to update the attachment.
get_attachment
str
The unique identifier of the attachment to retrieve.
delete_attachment
str
The unique identifier of the attachment to delete.
create_step
Optional[str]
The ID of the thread associated with the step.
Optional[StepType]
The type of the step, defaults to “undefined”.
Optional[str]
The start time of the step.
Optional[str]
The end time of the step.
Optional[Dict]
Input data for the step.
Optional[Dict]
Output data from the step.
Optional[Dict]
Metadata associated with the step.
Optional[str]
The ID of the parent step, if any.
Optional[str]
The name of the step.
Optional[List[str]]
Tags associated with the step.
Optional[str]
The ID of the root run, if any.
update_step
str
The unique identifier of the step to update.
Optional[StepType]
The type of the step.
Optional[str]
Input data for the step.
Optional[str]
Output data from the step.
Optional[Dict]
Metadata associated with the step.
Optional[str]
The name of the step.
Optional[List[str]]
Tags associated with the step.
Optional[str]
The start time of the step.
Optional[str]
The end time of the step.
Optional[str]
The ID of the parent step, if any.
get_step
str
The unique identifier of the step to retrieve.
delete_step
str
The unique identifier of the step to delete.
send_steps
List[Union[StepDict, Step]]
A list of steps or step dictionaries to send.
get_generations
Optional[int]
The number of generations to retrieve.
Optional[str]
A cursor for use in pagination, fetching records after this cursor.
Optional[str]
A cursor for use in pagination, fetching records before this cursor.
filtersOptional[generations_filters] - Filters to apply to the generations query.order_byOptional[generations_order_by] - Ordering options for the generations.
create_generation
Union[ChatGeneration, CompletionGeneration]
The generation data to create.
create_dataset
str
The name of the dataset.
Optional[str]
A description of the dataset.
Optional[Dict]
Metadata associated with the dataset.
DatasetType
The type of the dataset, defaults to “key_value”.
get_dataset
Optional[str]
The unique identifier of the dataset to retrieve.
Optional[str]
The name of the dataset to retrieve.
update_dataset
str
The unique identifier of the dataset to update.
Optional[str]
The new name of the dataset.
Optional[str]
A new description for the dataset.
Optional[Dict]
New metadata for the dataset.
delete_dataset
str
The unique identifier of the dataset to delete.
create_experiment_item
DatasetExperimentItem
The experiment item to be created.
The created experiment item with updated scores.
create_dataset_item
str
The unique identifier of the dataset.
Dict
The input data for the dataset item.
Optional[Dict]
The expected output data for the dataset item.
Optional[Dict]
Additional metadata for the dataset item.
get_dataset_item
str
The unique identifier of the dataset item.
delete_dataset_item
str
The unique identifier of the dataset item to delete.
add_step_to_dataset
str
The unique identifier of the dataset.
str
The unique identifier of the step to add.
Optional[Dict]
Additional metadata for the step being added.
add_generation_to_dataset
str
The unique identifier of the dataset.
str
The unique identifier of the generation to add.
Optional[Dict]
Additional metadata for the generation being added.