Documentation
¶
Index ¶
- Constants
- Variables
- func GetArrayProp(key string, props map[string]any) ([]string, error)
- func GetBoolProp(key string, props map[string]any) (bool, error)
- func GetIntProp(key string, props map[string]any) (int, error)
- func GetStrProp(key string, props map[string]any) (string, error)
- func IsRequired(key string, props map[string]any) bool
- func LogLevelToString(level LogLevel) string
- func NewBadRequestError(msg string) error
- func NewInternalServerError(msg string) error
- func NewNotFoundError(msg string) error
- func NewUnauthorizedError(msg string) error
- func NewUnsupportedError(msg string) error
- func ToInt(data any) int
- func ToString(data any) string
- type ATMSupport
- type Action
- type ActionConfig
- type ActionRunner
- type Agent
- func (a *Agent) Clone() *Agent
- func (a *Agent) History() []*Message
- func (a *Agent) Prompt() string
- func (a *Agent) Query() string
- func (a *Agent) Result() string
- func (a *Agent) SetHistory(messages []*Message) *Agent
- func (a *Agent) SetPrompt(s string) *Agent
- func (a *Agent) SetQuery(s string) *Agent
- func (a *Agent) SetResult(v string) *Agent
- type AgentConfig
- type AgentsConfig
- type AppConfig
- func (cfg *AppConfig) HasInput() bool
- func (cfg *AppConfig) Interactive() bool
- func (cfg *AppConfig) IsClipin() bool
- func (cfg *AppConfig) IsInformative() bool
- func (cfg *AppConfig) IsNew() bool
- func (cfg *AppConfig) IsQuiet() bool
- func (cfg *AppConfig) IsSpecial() bool
- func (cfg *AppConfig) IsStdin() bool
- func (cfg *AppConfig) IsTracing() bool
- func (cfg *AppConfig) IsVerbose() bool
- func (ac *AppConfig) ToMap() map[string]any
- type ArgMap
- func (v ArgMap) Get(key string) any
- func (v ArgMap) GetBool(key string) bool
- func (v ArgMap) GetDuration(key string) time.Duration
- func (v ArgMap) GetFloat64(key string) float64
- func (v ArgMap) GetInt(key string) int
- func (v ArgMap) GetInt32(key string) int32
- func (v ArgMap) GetInt64(key string) int64
- func (v ArgMap) GetIntSlice(key string) []int
- func (v ArgMap) GetString(key string) string
- func (v ArgMap) GetStringMap(key string) map[string]any
- func (v ArgMap) GetStringMapString(key string) map[string]string
- func (v ArgMap) GetStringMapStringSlice(key string) map[string][]string
- func (v ArgMap) GetStringSlice(key string) []string
- func (v ArgMap) GetTime(key string) time.Time
- func (v ArgMap) GetUint(key string) uint
- func (v ArgMap) GetUint8(key string) uint8
- func (v ArgMap) GetUint16(key string) uint16
- func (v ArgMap) GetUint32(key string) uint32
- func (v ArgMap) GetUint64(key string) uint64
- func (a ArgMap) Kit() string
- func (a ArgMap) Kitname() Kitname
- func (a ArgMap) Type() string
- type Arguments
- func (r *Arguments) AddArgs(args map[string]any) *Arguments
- func (r *Arguments) Clone() *Arguments
- func (r *Arguments) Copy(dst map[string]any) *Arguments
- func (r *Arguments) Get(key string) (any, bool)
- func (r *Arguments) GetAllArgs() map[string]any
- func (r *Arguments) GetArgs(keys []string) map[string]any
- func (r *Arguments) GetInt(key string) int
- func (r *Arguments) GetString(key string) string
- func (r *Arguments) Message() string
- func (r *Arguments) Set(key string, val any) *Arguments
- func (r *Arguments) SetArgs(args map[string]any) *Arguments
- func (r *Arguments) SetMessage(s any) *Arguments
- type AssetFS
- type AssetManager
- type AssetStore
- type BadRequestError
- type Blob
- type BlobStore
- type ChainConfig
- type ClipboardProvider
- type ConnectorConfig
- type ContextKey
- type DHNTConfig
- type DirEntry
- type DirEntryInfo
- type EditorProvider
- type Environment
- func (g *Environment) AddEnvs(src map[string]any)
- func (g *Environment) Apply(fn func(map[string]any) error) error
- func (g *Environment) Clone() *Environment
- func (g *Environment) Copy(dst map[string]any)
- func (g *Environment) Get(key string) (any, bool)
- func (g *Environment) GetAllEnvs() map[string]any
- func (g *Environment) GetEnvs(keys []string) map[string]any
- func (g *Environment) GetInt(key string) int
- func (g *Environment) GetString(key string) string
- func (g *Environment) Set(key string, val any)
- func (g *Environment) SetEnvs(envs map[string]any)
- func (g *Environment) UnsetEnvs(keys []string)
- type FileInfo
- func (r *FileInfo) IsDir() bool
- func (fi FileInfo) MarshalJSON() ([]byte, error)
- func (r *FileInfo) ModTime() time.Time
- func (r *FileInfo) Mode() fs.FileMode
- func (r *FileInfo) Name() string
- func (r *FileInfo) Size() int64
- func (r *FileInfo) Sys() any
- func (fi *FileInfo) UnmarshalJSON(data []byte) error
- type Flow
- type FlowConfig
- type FlowType
- type FuncBody
- type Handler
- type HandlerFunc
- type IOFilter
- type InternalServerError
- type Kitname
- type Level
- type LogLevel
- type MemOption
- type MemStore
- type Message
- type Middleware
- type Model
- type ModelConfig
- type ModelsConfig
- type NotFoundError
- type Output
- type Packname
- type Record
- type Request
- type Resource
- type ResourceConfig
- type Response
- type Result
- type SecretStore
- type State
- type TemplateFuncMap
- type ToolCall
- type ToolCallEntry
- type ToolCondition
- type ToolConfig
- type ToolEnv
- type ToolFunc
- type ToolGuard
- type ToolKit
- type ToolSystem
- type ToolType
- type ToolsConfig
- type UnauthorizedError
- type UnsupportedError
- type User
- type UserInput
- type Vars
Constants ¶
const ( RoleSystem = "system" RoleAssistant = "assistant" RoleUser = "user" RoleTool = "tool" )
const ( VarsEnvContainer = "container" VarsEnvHost = "host" )
const (
ContentTypeImageB64 = "img/base64"
)
Variables ¶
Functions ¶
func GetArrayProp ¶ added in v0.1.1
func IsRequired ¶ added in v0.1.1
if required properties is not missing and is an array of strings check if the required properties are present
func LogLevelToString ¶ added in v0.1.1
func NewBadRequestError ¶ added in v0.1.1
func NewInternalServerError ¶ added in v0.1.1
func NewNotFoundError ¶ added in v0.1.1
func NewUnauthorizedError ¶ added in v0.1.1
func NewUnsupportedError ¶ added in v0.1.1
Types ¶
type ATMSupport ¶ added in v0.1.1
type ATMSupport interface {
AssetStore
RetrieveAgent(owner, pack string) (*Record, error)
ListAgents(owner string) ([]*Record, error)
SearchAgent(owner, pack string) (*Record, error)
RetrieveTool(owner, kit string) (*Record, error)
ListTools(owner string) ([]*Record, error)
RetrieveModel(owner, alias string) (*Record, error)
ListModels(owner string) ([]*Record, error)
}
agent/tool/model methods
type Action ¶ added in v0.1.1
type ActionConfig ¶ added in v0.11.1
type ActionConfig struct {
// kit specifies a namespace for the action
// examples:
// class name
// MCP server name
// file system
// container name
// virtual machine name
// tool/function (Gemini)
Kit string `yaml:"kit"`
// action type:
// func, system, agent...
Type string `yaml:"type"`
// action name and arguments
Name string `yaml:"name"`
Arguments map[string]any `yaml:"arguments"`
// user message
Message string `yaml:"message"`
// system prompt
Instruction string `yaml:"instruction"`
// set/level key - not the LLM model
Model string `yaml:"model"`
//
MaxTurns int `yaml:"max_turns"`
MaxTime int `yaml:"max_time"`
// output format: json | text
Format string `yaml:"format"`
// memory context
MaxHistory int `yaml:"max_history"`
MaxSpan int `yaml:"max_span"`
Context string `yaml:"context"`
// logging: quiet | informative | verbose
LogLevel string `yaml:"log_level"`
}
func (*ActionConfig) ToMap ¶ added in v0.11.1
func (ac *ActionConfig) ToMap() map[string]any
type ActionRunner ¶ added in v0.1.1
type Agent ¶
type Agent struct {
Parent *Agent
Owner string
// The name of the agent.
Name string
Display string
Description string
//
Instruction string
Context string
Message string
// The model to be used by the agent
Model *Model
// Functions that the agent can call
Tools []*ToolFunc
// // default values
Arguments *Arguments
// LLM adapter
Adapter string
//
Flow *Flow
Embed []*Agent
// global values
// Environment map[string]any
Environment *Environment
//
Runner ActionRunner
Template *template.Template
}
func (*Agent) SetHistory ¶ added in v0.11.1
type AgentConfig ¶
type AgentConfig struct {
Display string `yaml:"display"`
Description string `yaml:"description"`
// tools defined in tools config
// kit:name
Functions []string `yaml:"functions"`
Flow *FlowConfig `yaml:"flow"`
// chat|image|docker/aider oh gptr
Adapter string `yaml:"adapter"`
// name of custom creator agent for this agent configuration
Creator string `yaml:"creator"`
// middleware chain
Chain *ChainConfig `yaml:"chain"`
// default agents config
Name string `yaml:"name"`
Arguments map[string]any `yaml:"arguments"`
Instruction string `yaml:"instruction"`
Context string `yaml:"context"`
Message string `yaml:"message"`
Model string `yaml:"model"`
//
MaxTurns int `yaml:"max_turns"`
MaxTime int `yaml:"max_time"`
// output format: json | text
Format string `yaml:"format"`
// memory
// max history: 0 max span: 0
// New *bool `yaml:"new,omitempty"`
MaxHistory int `yaml:"max_history"`
MaxSpan int `yaml:"max_span"`
// logging: quiet | info[rmative] | verbose | trace
LogLevel string `yaml:"log_level"`
// agent as tool
Parameters map[string]any `yaml:"parameters"`
// agent global vars
Environment map[string]any `yaml:"environment"`
// security
Filters []*IOFilter `yaml:"filters"`
Guards []*ToolGuard `yaml:"guards"`
// inherit from embedded parent:
// + environment
// + instruction
// + functions
// local scope:
// - arguments
// - context
// - message
// - model
// - flow/actions
Embed []string `yaml:"embed"`
//
Store AssetStore `yaml:"-"`
// relative to root
BaseDir string `yaml:"-"`
}
func (*AgentConfig) ToMap ¶ added in v0.1.1
func (ac *AgentConfig) ToMap() map[string]any
type AgentsConfig ¶
type AgentsConfig AppConfig
pack config
func (*AgentsConfig) ToMap ¶ added in v0.11.1
func (ac *AgentsConfig) ToMap() map[string]any
type AppConfig ¶
type AppConfig struct {
// ActionConfig
//
// kit specifies a namespace for the action
// examples:
// class name
// MCP server name
// file system
// container name
// virtual machine name
// tool/function (Gemini)
Kit string `yaml:"kit"`
// action type:
// func, system, agent...
Type string `yaml:"type"`
// action name and arguments
Name string `yaml:"name"`
Arguments map[string]any `yaml:"arguments"`
// user message
Message string `yaml:"message"`
// system prompt
Instruction string `yaml:"instruction"`
// set/level key - not the LLM model
Model string `yaml:"model"`
//
MaxTurns int `yaml:"max_turns"`
MaxTime int `yaml:"max_time"`
// output format: json | text
Format string `yaml:"format"`
// memory context
MaxHistory int `yaml:"max_history"`
MaxSpan int `yaml:"max_span"`
Context string `yaml:"context"`
// logging: quiet | informative | verbose
LogLevel string `yaml:"log_level"`
// app level global vars
Environment map[string]any `yaml:"environment"`
//
// unique identifier
ID string `yaml:"-"`
// app root. default: $HOME/.ai/
Base string `yaml:"-"`
// auth email
User string `yaml:"-"`
// workspace root. default: <base>/workspace
Workspace string `yaml:"-"`
Session string `yaml:"-"`
// name of custom creator agent for this agent configuration
Creator string `yaml:"creator"`
// middleware chain
Chain *ChainConfig `yaml:"chain"`
//
Pack string `yaml:"pack"`
Agents []*AgentConfig `yaml:"agents"`
// tool / model provider
Provider string `yaml:"provider"`
BaseUrl string `yaml:"base_url"`
// api token lookup key
ApiKey string `yaml:"api_key"`
// action type:
// func, system, agent...
// Type string `yaml:"type"`
Tools []*ToolConfig `yaml:"tools"`
// modelset name
Set string `yaml:"set"`
Models map[string]*ModelConfig `yaml:"models"`
// TODO use arguments
Clipin bool
ClipWait bool
Clipout bool
ClipAppend bool
Stdin bool
}
func (*AppConfig) Interactive ¶
func (*AppConfig) IsInformative ¶ added in v0.1.1
type ArgMap ¶ added in v0.1.1
func (ArgMap) GetFloat64 ¶ added in v0.1.1
func (ArgMap) GetIntSlice ¶ added in v0.1.1
func (ArgMap) GetStringMap ¶ added in v0.1.1
func (ArgMap) GetStringMapString ¶ added in v0.1.1
func (ArgMap) GetStringMapStringSlice ¶ added in v0.1.1
func (ArgMap) GetStringSlice ¶ added in v0.1.1
type Arguments ¶ added in v0.1.1
type Arguments struct {
// contains filtered or unexported fields
}
func NewArguments ¶ added in v0.1.1
func NewArguments() *Arguments
func (*Arguments) GetAllArgs ¶ added in v0.11.1
func (*Arguments) SetArgs ¶ added in v0.1.1
clear all entries and copy args while maintaining the same old reference
func (*Arguments) SetMessage ¶ added in v0.11.1
type AssetManager ¶ added in v0.1.1
type AssetManager interface {
// GetStore(key string) (AssetStore, error)
AddStore(store AssetStore)
SearchAgent(owner, pack string) (*Record, error)
ListAgent(owner string) (map[string]*AgentsConfig, error)
FindAgent(owner, pack string) (*AgentsConfig, error)
ListToolkit(owner string) (map[string]*ToolsConfig, error)
FindToolkit(owner string, kit string) (*ToolsConfig, error)
ListModels(owner string) (map[string]*ModelsConfig, error)
FindModels(owner string, alias string) (*ModelsConfig, error)
}
type AssetStore ¶
type AssetStore any
type BadRequestError ¶ added in v0.1.1
type BadRequestError struct {
Message string
}
func (*BadRequestError) Error ¶ added in v0.1.1
func (e *BadRequestError) Error() string
type Blob ¶ added in v0.1.1
type Blob struct {
ID string `json:"id"`
MimeType string `json:"mime_type"`
Content []byte `json:"content"`
Meta map[string]any `json:"meta"`
}
https://en.wikipedia.org/wiki/Media_type https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types https://mimesniff.spec.whatwg.org/
type BlobStore ¶ added in v0.1.1
type BlobStore interface {
Put(ID string, blob *Blob) error
Get(ID string) (*Blob, error)
Presign(ID string) (string, error)
}
Object store
type ChainConfig ¶ added in v0.11.1
type ChainConfig struct {
// action list
Middleware []string `yaml:"middelware"`
}
type ClipboardProvider ¶
type ConnectorConfig ¶ added in v0.0.2
type ContextKey ¶ added in v0.1.1
type ContextKey string
const SwarmUserContextKey ContextKey = "swarm_user"
type DHNTConfig ¶ added in v0.1.1
type DHNTConfig struct {
Blob *ResourceConfig `json:"blob"`
Assets []*ResourceConfig `json:"assets"`
}
func LoadDHNTConfig ¶ added in v0.1.1
func LoadDHNTConfig(conf string) (*DHNTConfig, error)
type DirEntryInfo ¶
type DirEntryInfo struct {
// contains filtered or unexported fields
}
func FsDirEntryInfo ¶
func FsDirEntryInfo(de fs.DirEntry) *DirEntryInfo
func (*DirEntryInfo) IsDir ¶
func (r *DirEntryInfo) IsDir() bool
func (DirEntryInfo) MarshalJSON ¶
func (r DirEntryInfo) MarshalJSON() ([]byte, error)
func (*DirEntryInfo) Name ¶
func (r *DirEntryInfo) Name() string
func (*DirEntryInfo) Type ¶
func (r *DirEntryInfo) Type() fs.FileMode
func (*DirEntryInfo) UnmarshalJSON ¶
func (r *DirEntryInfo) UnmarshalJSON(data []byte) error
type EditorProvider ¶
type Environment ¶ added in v0.1.1
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶ added in v0.1.1
func NewEnvironment() *Environment
func (*Environment) AddEnvs ¶ added in v0.1.1
func (g *Environment) AddEnvs(src map[string]any)
copy all src values to the environment env
func (*Environment) Apply ¶ added in v0.1.1
func (g *Environment) Apply(fn func(map[string]any) error) error
thread safe access to the env
func (*Environment) Clone ¶ added in v0.11.1
func (g *Environment) Clone() *Environment
func (*Environment) Copy ¶ added in v0.1.1
func (g *Environment) Copy(dst map[string]any)
copy all environment env to dst
func (*Environment) GetAllEnvs ¶ added in v0.1.1
func (g *Environment) GetAllEnvs() map[string]any
func (*Environment) GetEnvs ¶ added in v0.1.1
func (g *Environment) GetEnvs(keys []string) map[string]any
Return envs specified by keys
func (*Environment) GetInt ¶ added in v0.1.1
func (g *Environment) GetInt(key string) int
func (*Environment) GetString ¶ added in v0.1.1
func (g *Environment) GetString(key string) string
func (*Environment) Set ¶ added in v0.1.1
func (g *Environment) Set(key string, val any)
func (*Environment) SetEnvs ¶ added in v0.1.1
func (g *Environment) SetEnvs(envs map[string]any)
Clear all entries from the map and copy the new values while maintaining the same old reference.
func (*Environment) UnsetEnvs ¶ added in v0.1.1
func (g *Environment) UnsetEnvs(keys []string)
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
func FsFileInfo ¶
func NewFileInfo ¶
func (FileInfo) MarshalJSON ¶
func (*FileInfo) UnmarshalJSON ¶
type FlowConfig ¶ added in v0.9.0
type FlowType ¶ added in v0.1.1
type FlowType string
const ( // FlowTypeSequence executes actions one after another, where each // subsequent action uses the previous action's response as input. FlowTypeSequence FlowType = "sequence" // FlowTypeParallel executes actions simultaneously, returning the combined results as a list. // This allows for concurrent processing of independent actions. FlowTypeParallel FlowType = "parallel" // FlowTypeMap applies specified action(s) to each element in the input array, creating a new // array populated with the results. FlowTypeMap FlowType = "map" // FlowTypeShell delegates control to a shell script using bash script syntax, enabling // complex flow control scenarios driven by external scripting logic. FlowTypeShell FlowType = "shell" )
type HandlerFunc ¶ added in v0.1.1
type InternalServerError ¶ added in v0.1.1
type InternalServerError struct {
Message string
}
func (*InternalServerError) Error ¶ added in v0.1.1
func (e *InternalServerError) Error() string
type Kitname ¶ added in v0.1.1
type Kitname string
Took Kit and Name
type Level ¶ added in v0.0.3
type Level = string
Level represents the "intelligence" level of the model. i.e. basic, regular, advanced for example, OpenAI: gpt-4.1-mini, gpt-4.1, o3
type Message ¶
type Message struct {
// message id
ID string `json:"id"`
// thread id
Session string `json:"session"`
Created time.Time `json:"created"`
// data
ContentType string `json:"content_type"`
Content string `json:"content"`
// system | assistant | user
Role string `json:"role"`
// user/agent
Sender string `json:"sender"`
}
type Middleware ¶ added in v0.1.1
type Model ¶
type ModelConfig ¶
type NotFoundError ¶ added in v0.1.1
type NotFoundError struct {
Message string
}
func (*NotFoundError) Error ¶ added in v0.1.1
func (e *NotFoundError) Error() string
type Packname ¶ added in v0.1.1
type Packname string
@pack[/sub] agent:pack[/sub] @*
type Request ¶
type Request struct {
// parent agent
Agent *Agent
// active action name
Name string
Arguments *Arguments
// LLM
Model *Model
Messages []*Message
Runner ActionRunner
Tools []*ToolFunc
// get api token for LLM model
Token func() string
// contains filtered or unexported fields
}
func NewRequest ¶ added in v0.1.1
func (*Request) Clone ¶
Clone returns a shallow copy of r while ensuring proper copying of slices and maps
func (*Request) Context ¶
Context returns the request's context. To change the context, use Request.WithContext.
The returned context is always non-nil; it defaults to the background context.
For outgoing client requests, the context controls cancellation.
For incoming server requests, the context is canceled when the client's connection closes, the request is canceled (with HTTP/2), or when the ServeHTTP method returns.
func (*Request) WithContext ¶
WithContext returns a shallow copy of r with its context changed to ctx. The provided ctx must be non-nil.
For outgoing client request, the context controls the entire lifetime of a request and its response: obtaining a connection, sending the request, and reading the response headers and body.
To create a new request with a context, use NewRequest. To make a deep copy of a request with a new context, use Request.Clone.
type Resource ¶
type Resource struct {
// web resource base url
// http://localhost:18080/resource
// https://ai.dhnt.io/resource
Base string `json:"base"`
// access token
Token string `json:"token"`
}
type ResourceConfig ¶ added in v0.1.1
type Result ¶
type Result struct {
// author of the reponse: assistant
Role string
// The result value as a string
Value string
// media content
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types
MimeType string
Content []byte
// transition
// The agent state
State State
// The agent name to transfer to for StateTransfer
NextAgent string
//
Actions []*ToolCall
}
Result encapsulates the possible return values for agent/function.
type SecretStore ¶ added in v0.1.1
type TemplateFuncMap ¶
type ToolCall ¶ added in v0.1.1
type ToolCall Action
openai: ChatCompletionMessageToolCallUnion genai: FunctionCall anthropic: ToolUseBlock
type ToolCallEntry ¶ added in v0.1.1
type ToolCallEntry struct {
ID string `json:"id"`
Kit string `json:"kit"`
Name string `json:"name"`
Arguments map[string]any `json:"arguments"`
Error error `json:"error"`
Result any `json:"result"`
Timestamp time.Time `json:"timestamp"`
}
func (*ToolCallEntry) ToJSON ¶ added in v0.1.1
func (r *ToolCallEntry) ToJSON() (string, error)
type ToolCondition ¶
type ToolCondition struct {
// required env list
Env []string `yaml:"env"`
// found on PATH
Lookup *string `yaml:"lookup"`
// shell required
Shell map[string]any `yaml:"shell"`
}
TODO condidtion needs to be met for tools to be enabled
type ToolConfig ¶
type ToolConfig struct {
Type string `yaml:"type"`
Name string `yaml:"name"`
Description string `yaml:"description"`
Parameters map[string]any `yaml:"parameters"`
Body *FuncBody `yaml:"body"`
Condition *ToolCondition `yaml:"condition"`
// agent name for agent tool type
// description/parameters defined here take precedence
Agent string `yaml:"agent"`
//
Provider string `yaml:"provider"`
BaseUrl string `yaml:"base_url"`
// name of api key
ApiKey string `yaml:"api_key"`
// filter by match key=values (comma, separated)
// include all tools that match
Filter map[string]string `yaml:"filter"`
}
type ToolFunc ¶
type ToolFunc struct {
Type string
Kit string
Name string
Description string
Parameters map[string]any
Body *FuncBody
// agent name if this tool references an agent
Agent string
//
State State
//
Provider string
BaseUrl string
// name of api key - used to resolve api key/token before tool call
ApiKey string
// extra features.
// e.g labels for mcp for filtering tools
Extra map[string]any
// default arguments
Arguments map[string]any
}
type ToolSystem ¶ added in v0.0.2
type UnauthorizedError ¶ added in v0.1.1
type UnauthorizedError struct {
}
func (*UnauthorizedError) Error ¶ added in v0.1.1
func (e *UnauthorizedError) Error() string
type UnsupportedError ¶ added in v0.1.1
type UnsupportedError struct {
Message string
}
func (*UnsupportedError) Error ¶ added in v0.1.1
func (e *UnsupportedError) Error() string
type User ¶
type UserInput ¶
type UserInput struct {
// cached media contents
Messages []*Message `json:"-"`
Arguments map[string]any `json:"arguments"`
}
func (*UserInput) Intent ¶
Intent returns a clipped version of the query. This is intended for "smart" agents to make decisions based on user inputs.
type Vars ¶
type Vars struct {
Global *Environment `json:"-"`
// contains filtered or unexported fields
}
global context
func (*Vars) AddToolCall ¶ added in v0.11.1
func (v *Vars) AddToolCall(item *ToolCallEntry)