Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidMIME = errors.New("not a valid MIME")
var ErrInvalidRole = errors.New("not a valid Role")
Functions ¶
This section is empty.
Types ¶
type Content ¶
func ParseDataURL ¶
type DynamicToolbox ¶
type DynamicToolbox struct {
// contains filtered or unexported fields
}
func (*DynamicToolbox) Add ¶
func (st *DynamicToolbox) Add(tools ...Tool)
Add tools. Basic wrapper around Provider. Should not be called after start.
func (*DynamicToolbox) Provider ¶
func (st *DynamicToolbox) Provider(providerFunc ...ToolProviderFunc)
Provider registers provider which dynamically can Update internal set of tools. Should not be called after start.
func (*DynamicToolbox) Snapshot ¶ added in v0.0.3
func (st *DynamicToolbox) Snapshot() Snapshot
type MIME ¶
type MIME string
MIME for each message. ENUM( text = text/plain, json = application/json png = image/png jpeg = image/jpeg jpg = image/jpg webp = image/webp gif = image/gif )
const ( // MIMEText is a MIME of type text. MIMEText MIME = "text/plain" // MIMEJson is a MIME of type json. MIMEJson MIME = "application/json" // MIMEPng is a MIME of type png. MIMEPng MIME = "image/png" // MIMEJpeg is a MIME of type jpeg. MIMEJpeg MIME = "image/jpeg" // MIMEJpg is a MIME of type jpg. MIMEJpg MIME = "image/jpg" // MIMEWebp is a MIME of type webp. MIMEWebp MIME = "image/webp" // MIMEGif is a MIME of type gif. MIMEGif MIME = "image/gif" )
func MIMEValues ¶ added in v0.0.6
func MIMEValues() []MIME
MIMEValues returns a list of the values for MIME
func (MIME) ImageFormat ¶ added in v0.0.2
func (MIME) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
type ModelMessage ¶
type Provider ¶
type Provider interface {
Invoke(ctx context.Context, config Config, messages []Message, tools []ToolDefinition) (*Invoke, error)
}
Provider to LLM. Should NOT call tools by it self.
type Role ¶
type Role string
Role for each message. ENUM(user,assistant,toolCall,toolResult)
const ( // RoleUser is a Role of type user. RoleUser Role = "user" // RoleAssistant is a Role of type assistant. RoleAssistant Role = "assistant" // RoleToolCall is a Role of type toolCall. RoleToolCall Role = "toolCall" // RoleToolResult is a Role of type toolResult. RoleToolResult Role = "toolResult" )
func RoleValues ¶ added in v0.0.6
func RoleValues() []Role
RoleValues returns a list of the values for Role
func (Role) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
type Snapshot ¶ added in v0.0.3
func (Snapshot) Definitions ¶ added in v0.0.3
func (s Snapshot) Definitions() []ToolDefinition
type Tool ¶
type Tool interface {
Name() string
Description() string
Input() *jsonschema.Schema
Call(ctx context.Context, args json.RawMessage) (Content, error)
}
type ToolDefinition ¶ added in v0.0.3
type ToolDefinition interface {
Name() string
Description() string
Input() *jsonschema.Schema
}
type ToolProvider ¶
type ToolProvider struct {
// contains filtered or unexported fields
}