Skip to main content
View module source on GitHub

GenerationRequestTextMessageContent

This class is used to represent a text message in a generation request.

GenerationRequestImageMessageContent

This class is used to represent an image message in a generation request.

GenerationRequestMessage

This class is used to represent a message in a generation request.

GenerationConfigDict

Generation config dict. This class represents a generation config dictionary.

get_generation_config_dict

Convert a generation config to a generation config dict else return the config. Arguments: Returns: dict[str, Any]: The generation config dict.

GenerationToolCallFunction

Generation tool call function. This class represents a tool call function.

GenerationToolCall

Generation tool call. This class represents a tool call.

TextContent

Text content. This class represents a text content.

ImageContent

Image content. This class represents an image content.

AudioContent

Audio content. This class represents an audio content.

GenerationResultMessage

Generation result message. This class represents a generation result message.

GenerationResultChoice

Generation result choice. This class represents a generation result choice.

TokenDetails

Token details. This class represents token details.

GenerationUsage

Generation usage. This class represents generation usage.

GenerationResult

Generation result. This class represents a generation result.

get_generation_error_config_dict

Convert a generation error to a generation error dict else return the error. Arguments: Returns: A TraceConfigDict dictionary representation of the config.

Generation

__init__

Initialize a generation. Arguments:

set_provider_

Static method to set the provider for a trace. Arguments:

set_provider

Set the provider for this trace. Arguments:

set_model_

Static method to set the model for a trace. Arguments:

set_model

Set the model for this trace. Arguments:

add_message_

Static method to add a message to a trace. Arguments:

add_message

Add a message to this trace. Arguments:

set_model_parameters_

Static method to set the model parameters for a trace. Arguments:

set_model_parameters

Set the model parameters for this trace. Arguments:

add_attachment

Add an attachment to this trace. Arguments:

add_attachment_

Static method to add an attachment to a trace. Arguments:

result_

Static method to add a result to a trace. Arguments:

end_

Static method to end a trace. Arguments:

add_tag_

Static method to add a tag to a trace. Arguments:

convert_chat_completion

Convert a chat completion to a generation result. Arguments: Returns: A generation result.

convert_result

Convert a result to a generation result. Arguments: Returns: A generation result.

result

Add a result to this trace. Arguments:

error

Add an error to this trace. Arguments:

error_

Static method to add an error to a trace. Arguments:

data

Get the data for this trace. Returns: A dictionary containing the data for this trace.