run

package
v0.0.40 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDef string
View Source
var ExampleConfig string

Functions

func ApplyConfig added in v0.0.12

func ApplyConfig(config *FullConfig, token *string, maxRound *int, baseUrl *string, model *string, systemPrompt *string, tools *[]string, toolCustomFiles *[]string, toolCustomJSONs *[]string, toolDefaultCwd *string, recordFile *string, noCache *bool, showUsage *bool, ignoreDuplicateMsg *bool, logRequest *bool, logChatFlag **bool, verbose *bool, mcpServers *[]string) error

ApplyConfig applies configuration values to the provided variables, giving precedence to command line arguments

func Main

func Main(args []string, opts Options) error

Types

type ChatHandler

type ChatHandler struct {
	APIShape providers.APIShape
	// contains filtered or unexported fields
}

func (*ChatHandler) Handle

func (c *ChatHandler) Handle(model string, baseUrl string, token string, msg string, opts ChatOptions) error

type ChatOptions

type ChatOptions struct {
	// contains filtered or unexported fields
}

func (ChatOptions) MCPServers added in v0.0.17

func (c ChatOptions) MCPServers() []string

func (ChatOptions) MaxRound added in v0.0.17

func (c ChatOptions) MaxRound() int

func (ChatOptions) NoCache added in v0.0.17

func (c ChatOptions) NoCache() bool

func (ChatOptions) SystemPrompt added in v0.0.17

func (c ChatOptions) SystemPrompt() string

Getter methods for ChatOptions to allow external access

func (ChatOptions) ToolBuiltins added in v0.0.17

func (c ChatOptions) ToolBuiltins() []string

func (ChatOptions) ToolDefaultCwd added in v0.0.17

func (c ChatOptions) ToolDefaultCwd() string

func (ChatOptions) ToolFiles added in v0.0.17

func (c ChatOptions) ToolFiles() []string

func (ChatOptions) ToolJSONs added in v0.0.17

func (c ChatOptions) ToolJSONs() []string

type Config added in v0.0.12

type Config struct {
	types.Config                         // Embed the base config
	ToolCustomJSONs []*tools.UnifiedTool `json:"tool_custom_jsons,omitempty"` // Tool-specific field that needs UnifiedTool
}

Config represents the configuration structure that can be loaded from a file

type FullConfig added in v0.0.13

type FullConfig struct {
	Config
	RecordFile         string `json:"record_file,omitempty"`
	NoCache            bool   `json:"no_cache,omitempty"`
	ShowUsage          bool   `json:"show_usage,omitempty"`
	IgnoreDuplicateMsg bool   `json:"ignore_duplicate_msg,omitempty"`
	LogRequest         bool   `json:"log_request,omitempty"`
	LogChat            *bool  `json:"log_chat,omitempty"`
	Verbose            bool   `json:"verbose,omitempty"`
}

func LoadConfig added in v0.0.12

func LoadConfig(configFile string) (*FullConfig, error)

LoadConfig loads configuration from a JSON file

type Number

type Number string

type Options

type Options struct {
	BaseCmd        string
	DefaultBaseURL string
}

type ResolvedOptions added in v0.0.8

type ResolvedOptions struct {
	AbsDefaultToolCwd string
	Token             string
	BaseUrl           string
}

func ResolveEnvOptions added in v0.0.8

func ResolveEnvOptions(defaultToolCwd string, token string, tokenEnvKey string, baseUrl string, baseUrlEnvKey string, defaultBaseUrlEnvKey string, defaultBaseUrl string) (ResolvedOptions, error)

func ResolveProviderDefaultEnvOptions added in v0.0.8

func ResolveProviderDefaultEnvOptions(apiShape providers.APIShape, provider providers.Provider, defaultToolCwd string, token string, baseUrl string, defaultBaseUrl string) (ResolvedOptions, error)

type StringOrList added in v0.0.12

type StringOrList = types.StringOrList

Legacy type alias for compatibility

type ToolInfo added in v0.0.8

type ToolInfo struct {
	Name    string
	Builtin bool

	ToolDefinition *tools.UnifiedTool

	MCPServer string
	MCPClient *client.Client
}

func (*ToolInfo) String added in v0.0.8

func (c *ToolInfo) String() string

type ToolInfoMapping added in v0.0.8

type ToolInfoMapping map[string]*ToolInfo

func (ToolInfoMapping) AddTool added in v0.0.8

func (c ToolInfoMapping) AddTool(toolName string, toolInfo *ToolInfo) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL