# Packages

No description provided by the author

# Functions

BinaryPart creates a new BinaryContent from the given MIME type (e.g.
CalculateMaxTokens calculates the max number of tokens that could be added to a text.
ConvertChatMessageToModel Convert a ChatMessage to a ChatMessageModel.
CountTokens gets the number of tokens the text contains.
GenerateFromSinglePrompt is a convenience function for calling an LLM with a single string prompt, expecting a single string response.
GetBufferString gets the buffer string of messages.
GetModelContextSize gets the max number of tokens for a language model.
ImageURLPart creates a new ImageURLContent from the given URL.
ImageURLWithDetailPart creates a new ImageURLContent from the given URL and detail.
ShowMessageContents is a debugging helper for MessageContent.
TextPart creates TextContent from a given string.
TextParts is a helper function to create a MessageContent with a role and a list of text parts.
WithCandidateCount specifies the number of response candidates to generate.
WithFrequencyPenalty will add an option to set the frequency penalty for sampling.
WithJSONMode will add an option to set the response format to JSON.
WithMaxLength will add an option to set the maximum length of the generated text.
WithMaxTokens specifies the max number of tokens to generate.
WithMetadata will add an option to set metadata to include in the request.
WithMinLength will add an option to set the minimum length of the generated text.
WithModel specifies which model name to use.
WithMultiContent SupportMultiContent multiContent is supported.
WithN will add an option to set how many chat completion choices to generate for each input message.
WithOptions specifies options.
WithPresencePenalty will add an option to set the presence penalty for sampling.
WithRepetitionPenalty will add an option to set the repetition penalty for sampling.
WithSeed will add an option to use deterministic sampling.
WithStopWords specifies a list of words to stop generation on.
WithStreamingFunc specifies the streaming function to use.
WithTemperature specifies the model temperature, a hyperparameter that regulates the randomness, or creativity, of the AI's responses.
WithToolChoice will add an option to set the choice of tool to use.
WithTools will add an option to set the tools to use.
WithTopK will add an option to use top-k sampling.
WithTopP will add an option to use top-p sampling.

# Constants

ChatMessageTypeAI is a message sent by an AI.
ChatMessageTypeFunction is a message sent by a function.
ChatMessageTypeGeneric is a message sent by a generic user.
ChatMessageTypeHuman is a message sent by a human.
ChatMessageTypeSystem is a message sent by the system.
ChatMessageTypeTool is a message sent by a tool.
FunctionCallBehaviorAuto will call functions automatically.
FunctionCallBehaviorNone will not call any functions.

# Variables

ErrUnexpectedChatMessageType is returned when a chat message is of an unexpected type.

# Structs

AIChatMessage is a message sent by an AI.
BinaryContent is content holding some binary data with a MIME type.
CallOptions is a set of options for calling models.
No description provided by the author
No description provided by the author
ContentChoice is one of the response choices returned by GenerateContent calls.
ContentResponse is the response returned by a GenerateContent call.
FunctionCall is the name and arguments of a function call.
FunctionDefinition is a definition of a function that can be called by the model.
FunctionReference is a reference to a function.
GenericChatMessage is a chat message with an arbitrary speaker.
HumanChatMessage is a message sent by a human.
ImageURLContent is content with an URL pointing to an image.
MessageContent is the content of a message sent to a LLM.
SystemChatMessage is a chat message representing information that should be instructions to the AI system.
TextContent is content with some text.
Tool is a tool that can be used by the model.
ToolCall is a call to a tool (as requested by the model) that should be executed.
ToolCallResponse is the response returned by a tool call.
ToolChatMessage is a chat message representing the result of a tool call.
ToolChoice is a specific tool to use.

# Interfaces

ChatMessage represents a message in a chat.
ContentPart is an interface all parts of content have to implement.
Model is an interface multi-modal models implement.
Named is an interface for objects that have a name.
PromptValue is the interface that all prompt values must implement.

# Type aliases

CallOption is a function that configures a CallOptions.
ChatMessageType is the type of chat message.
FunctionCallBehavior is the behavior to use when calling functions.