Documentation
¶
Index ¶
- Variables
- func ConvertRoleToCommon(role string) gollem.MessageRole
- func GenerateToolCallID(name string, index int) string
- func MergeSystemIntoFirstUser(messages []gollem.Message) []gollem.Message
- func ParseJSONArguments(jsonStr string) (map[string]interface{}, error)
- func StringifyJSONArguments(args map[string]interface{}) (string, error)
- type ConversionWarning
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedContentType is returned when a content type cannot be converted ErrUnsupportedContentType = errors.New("unsupported content type") // ErrInvalidMessageFormat is returned when a message has an invalid format ErrInvalidMessageFormat = errors.New("invalid message format") // ErrConversionFailed is returned when conversion between formats fails ErrConversionFailed = errors.New("conversion failed") )
Conversion errors
Functions ¶
func ConvertRoleToCommon ¶
func ConvertRoleToCommon(role string) gollem.MessageRole
ConvertRoleToCommon converts various provider roles to common MessageRole
func GenerateToolCallID ¶
GenerateToolCallID generates a unique ID for tool calls if not present
func MergeSystemIntoFirstUser ¶
MergeSystemIntoFirstUser merges a system message into the first user message This is used for providers that don't support system messages directly (Claude, Gemini)
func ParseJSONArguments ¶
ParseJSONArguments attempts to parse a JSON string into a map
func StringifyJSONArguments ¶
StringifyJSONArguments converts a map to a JSON string
Types ¶
type ConversionWarning ¶
ConversionWarning represents a warning during conversion
Click to show internal directories.
Click to hide internal directories.