GenerationRequestTextMessageContent
GenerationRequestImageMessageContent
GenerationRequestMessage
GenerationConfigDict
get_generation_config_dict
| Name | Type | Description |
|---|---|---|
config | Union[GenerationConfig, GenerationConfigDict] | The config to get the dict from. |
GenerationToolCallFunction
GenerationToolCall
TextContent
ImageContent
AudioContent
GenerationResultMessage
GenerationResultChoice
TokenDetails
GenerationUsage
GenerationResult
get_generation_error_config_dict
| Name | Description |
|---|---|
config | Either a TraceConfig object or a TraceConfigDict dictionary. |
Generation
__init__
| Name | Description |
|---|---|
config | The config to initialize the generation with. |
writer | The writer to use. |
set_provider_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to set the provider for. |
provider | The provider to set. |
set_provider
| Name | Description |
|---|---|
provider | The provider to set. |
set_model_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to set the model for. |
model | The model to set. |
set_model
| Name | Description |
|---|---|
model | The model to set. |
add_message_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to add the message to. |
message | The message to add. |
add_message
| Name | Description |
|---|---|
message | The message to add. |
set_model_parameters_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to set the model parameters for. |
model_parameters | The model parameters to set. |
set_model_parameters
| Name | Description |
|---|---|
model_parameters | The model parameters to set. |
add_attachment
| Name | Description |
|---|---|
attachment | The attachment to add. |
add_attachment_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
generation_id | The ID of the generation to add the attachment to. |
attachment | The attachment to add. |
result_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to add the result to. |
result | The result to add. |
end_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to end. |
data | The data to add to the trace. |
add_tag_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to add the tag to. |
key | The key of the tag to add. |
value | The value of the tag to add. |
convert_chat_completion
| Name | Description |
|---|---|
chat_completion | The chat completion to convert. |
convert_result
| Name | Description |
|---|---|
result | The result to convert. |
result
| Name | Description |
|---|---|
result | The result to add. |
error
| Name | Description |
|---|---|
error | The error to add. |
error_
| Name | Description |
|---|---|
writer | The LogWriter instance to use. |
id | The ID of the trace to add the error to. |
error | The error to add. |