Documentation
¶
Overview ¶
File: cmd/agent.go
File: cmd/capabilities.go
File: cmd/editor.go
File: cmd/model.go
File: cmd/plugin.go
File: cmd/root.go
File: cmd/search.go
File: cmd/skill.go
File: cmd/update.go Implements the `gllm update` subcommand and a background update-check goroutine.
File: cmd/root.go (add this function)
File: cmd/version.go
Index ¶
- Constants
- Variables
- func BatchAttachments(attachments []string) (files []*service.FileData)
- func CheckModelName(name string) error
- func EnsureActiveAgent() (*data.AgentConfig, error)
- func Execute()
- func GenerateSessionName() string
- func GetAllTools(agent *data.AgentConfig) string
- func GetContextSession(cmd *cobra.Command) string
- func GetEffectModel() (model *data.Model)
- func GetEffectSearchEngineName() string
- func IsDefaultSessionName(name string) bool
- func IsSearchEnabled() bool
- func ListAllTools(cmd *cobra.Command)
- func NewContextWithSession(sessionName string) context.Context
- func ProcessAttachment(path string) *service.FileData
- func RemoveFirst(s string, prefix string) string
- func RunAgent(prompt string, guideline string, files []*service.FileData, sessionName string, ...) error
- func RunInitWizard(cmd *cobra.Command) error
- func StartBackgroundUpdateCheck()
- func StartLoadMCPServer(agent *data.AgentConfig)
- func StartsWith(s string, prefix string) bool
- func UpdateVersion(latestVersion string)
- func UpdateWarn(warn string)
- func ValidateMaxRecursions(s string) error
- func ValidateSeed(s string) error
- func ValidateTemperature(s string) error
- func ValidateTopP(s string) error
- type ChatRequest
- type InteractRequest
- type Message
- type ReplInfo
- type TextBuilder
Constants ¶
const (
EmbeddingToolsDescription = `` /* 499-byte string literal not displayed */
)
const (
MaxRecursionsDescription = `` /* 356-byte string literal not displayed */
)
Variables ¶
var KnownPlugins = []struct { ID string Label string Desc string }{ { ID: service.PluginVSCodeCompanion, Label: service.PluginVSCodeCompanionTitle, Desc: service.PluginVSCodeCompanionDesc, }, }
KnownPlugins enumerates all available global plugins.
Functions ¶
func BatchAttachments ¶ added in v1.13.10
BatchAttachments processes multiple attachments concurrently and adds the resulting FileData objects to the provided files slice. It uses a WaitGroup to manage goroutines and a channel to collect results safely.
func CheckModelName ¶ added in v1.13.2
func EnsureActiveAgent ¶ added in v1.13.10
func EnsureActiveAgent() (*data.AgentConfig, error)
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func GenerateSessionName ¶ added in v1.14.24
func GenerateSessionName() string
func GetAllTools ¶ added in v1.15.6
func GetAllTools(agent *data.AgentConfig) string
func GetContextSession ¶ added in v1.16.16
GetContextSession returns the session name from the context
func GetEffectModel ¶ added in v1.13.2
func GetEffectSearchEngineName ¶ added in v1.9.8
func GetEffectSearchEngineName() string
func IsDefaultSessionName ¶ added in v1.16.16
IsDefaultSessionName returns true when the session name is the auto-generated timestamp form produced by GenerateSessionName() in repl.go: "session-YYYY-MM-DD_HH-MM-SS".
func IsSearchEnabled ¶ added in v1.9.8
func IsSearchEnabled() bool
func ListAllTools ¶ added in v1.9.12
func NewContextWithSession ¶ added in v1.16.16
NewContextWithSession returns a new context with the session name set
func ProcessAttachment ¶ added in v1.13.10
Processes a single attachment (file or stdin marker)
func RemoveFirst ¶
func RunAgent ¶ added in v1.13.10
func RunAgent(prompt string, guideline string, files []*service.FileData, sessionName string, outputFile string, inputState *data.SharedState) error
RunAgent executes the agent with the given parameters, handling all setup and compatibility checks.
func RunInitWizard ¶ added in v1.12.16
RunInitWizard runs the interactive setup Exported so it can be called from root.go
func StartBackgroundUpdateCheck ¶ added in v1.14.24
func StartBackgroundUpdateCheck()
StartBackgroundUpdateCheck launches a single goroutine that checks for updates if 24 hours have elapsed since the last check. The result is stored in pendingUpdateVersion for non-intrusive display.
func StartLoadMCPServer ¶ added in v1.15.4
func StartLoadMCPServer(agent *data.AgentConfig)
StartLoadMCPServer launches background MCP preloading (non-blocking).
func StartsWith ¶
func UpdateVersion ¶ added in v1.16.10
func UpdateVersion(latestVersion string)
updateVersion returns a non-intrusive update notification.
func UpdateWarn ¶ added in v1.16.10
func UpdateWarn(warn string)
UpdateWarnBanner sends a warning banner to the UI The chatinput must be there to receive the banner message Otherwise the banner will be lost Use for background goroutine warning
func ValidateMaxRecursions ¶ added in v1.13.2
func ValidateSeed ¶ added in v1.13.2
func ValidateTemperature ¶ added in v1.13.2
Temperature: Typically in the range [0, 2] (inclusive).
- 0 : Deterministic output (greedy decoding; always picks the highest- probability token).
- 1 : Balanced output (default).
- 2 : Highly random/diverse output.
func ValidateTopP ¶ added in v1.13.2
Top_p (nucleus sampling): In the range [0, 1] (inclusive).
- 0 : Effectively selects only the single highest-probability token (similar to greedy; very rare in practice, as cumulative prob mass never reaches exactly 0).
- 1 : No filtering—samples from the full probability distribution (equivalent to no top_p effect).
Types ¶
type ChatRequest ¶ added in v1.16.16
type ChatRequest struct {
Messages []Message `json:"messages"`
Model string `json:"model,omitempty"`
Stream bool `json:"stream,omitempty"`
Session string `json:"session,omitempty"` // custom parameter for GLLM specific sessions
}
Minimal OpenAI-like request struct
type InteractRequest ¶ added in v1.16.16
type InteractRequest struct {
ID string `json:"id"` // UUID matching the SSE interaction request event
Kind string `json:"kind"` // "tool_confirm" | "ask_user"
Approve string `json:"approve,omitempty"` // For tool_confirm ("once", "always", "cancel")
Answer string `json:"answer,omitempty"` // For ask_user
Cancelled bool `json:"cancelled,omitempty"` // For ask_user: user dismissed the dialog
}
InteractRequest is the body of POST /v1/interact used by the frontend to resolve a pending interaction (tool confirm, ask-user, etc.).
type TextBuilder ¶ added in v1.13.6
type TextBuilder struct {
// contains filtered or unexported fields
}
func (*TextBuilder) String ¶ added in v1.13.6
func (tb *TextBuilder) String() string