package
0.0.0-20240509090842-11decd0816f6
Repository: https://github.com/iflytek/spark-ai-go.git
Documentation: pkg.go.dev
# Functions
BinaryPart creates a new BinaryContent from the given MIME type (e.g.
GetBufferString gets the buffer string of messages.
ImageURLPart creates a new ImageURLContent from the given URL.
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.
# 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.
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.
No description provided by the author
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.
FunctionChatMessage is a chat message representing the result of a function call.
FunctionDefinition is a definition of a function that can be called by the model.
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.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SystemChatMessage is a chat message representing information that should be instructions to the AI system.
TextContent is content with some text.
# Interfaces
ChatMessage represents a message in a chat.
ContentPart is an interface all parts of content have to implement.
Named is an interface for objects that have a name.
# Type aliases
ChatMessageType is the type of chat message.
FunctionCallBehavior is the behavior to use when calling functions.