Crate llm_sdk

Crate llm_sdk 

Source

Modules§

anthropic
audio_part_utils
boxed_stream
google
llm_sdk_test
openai
types_ext
usage_ext

Structs§

AssistantMessage
Represents a message generated by the model.
AudioOptions
Options for audio generation.
AudioPart
A part of the message that contains an audio.
AudioPartDelta
A delta update for an audio part, used in streaming of an audio message.
Citation
CitationDelta
A delta update for a citation part, used in streaming of citation messages.
ContentDelta
Represents a delta update in a message’s content, enabling partial streaming updates in LLM responses.
ImagePart
A part of the message that contains an image.
ImagePartDelta
A delta update for an image part, used in streaming of an image message.
LanguageModelInput
Defines the input parameters for the language model completion.
LanguageModelMetadata
LanguageModelPricing
A metadata property that describes the pricing of the model.
ModelResponse
Represents the response generated by the model.
ModelTokensDetails
Represents the token usage of the model.
ModelUsage
Represents the token usage of the model.
PartialModelResponse
Represents a partial response from the language model, useful for streaming output via async generator.
ReasoningOptions
Options for reasoning generation.
ReasoningPart
ReasoningPartDelta
ResponseFormatJson
Specifies that the model response should be in JSON format adhering to a specified schema.
SourcePart
A part of the message that contains a source with structured content. It will be used for citation for supported models.
StreamAccumulator
Manages the accumulation and merging of content deltas for streaming responses
TextPart
A part of the message that contains text.
TextPartDelta
A delta update for a text part, used in streaming or incremental updates of a message.
Tool
Represents a tool that can be used by the model.
ToolCallPart
A part of the message that represents a call to a tool the model wants to use.
ToolCallPartDelta
A delta update for a tool call part, used in streaming of a tool invocation.
ToolChoiceTool
The model will use the specified tool.
ToolMessage
Represents tool result in the message history. The only parts of ToolMessage should be Part(ToolResultPart).
ToolResultPart
A part of the message that represents the result of a tool call.
UserMessage
Represents a message sent by the user.

Enums§

AudioFormat
Loosely describe audio format. Some values (e.g., ‘wav’) denote containers; others (e.g., ‘linear16’) specify encoding only; cannot describe containers that can contain different audio encodings.
LanguageModelCapability
A metadata property that describes the capability of the model.
LanguageModelError
Message
A message in an LLM conversation history.
Modality
Defines the modality of content (e.g., text or audio) in LLM responses.
Part
A part of the message.
PartDelta
Delta parts used in partial updates.
ResponseFormatOption
The format that the model must output.
ToolChoiceOption
Determines how the model should choose which tool to use.

Traits§

LanguageModel

Type Aliases§

JSONSchema
Represents a JSON schema.
LanguageModelInputExtra
LanguageModelResult
LanguageModelStream