Documentation
¶
Index ¶
- Constants
- func CloseDaemons()
- func IsChatFinishMessage(msg string) error
- func IsDaemonRunning(url string) bool
- func SetPorts(start, end int64)
- func StopDaemon(url string)
- func WithToolCategory(ctx context.Context, toolCategory ToolCategory) context.Context
- type Call
- type CallContext
- type CallResult
- type ChatHistory
- type ChatHistoryCall
- type Context
- func (c *Context) CurrentAgent() types.ToolReference
- func (c *Context) GetCallContext() *CallContext
- func (c *Context) MarshalJSON() ([]byte, error)
- func (c *Context) OnUserCancel(ctx context.Context, cancel func())
- func (c *Context) ParentID() string
- func (c *Context) SubCallContext(ctx context.Context, input, toolID, callID string, toolCategory ToolCategory) (Context, error)
- func (c *Context) UnmarshalJSON([]byte) error
- func (c *Context) WrappedContext(e *Engine) context.Context
- type Engine
- type ErrChatFinish
- type InputContext
- type MCPRunner
- type Model
- type Ports
- type Return
- type RuntimeManager
- type State
- type ToolCategory
Constants ¶
View Source
const AbortedSuffix = "\n\nABORTED BY USER"
View Source
const DaemonURLSuffix = ".daemon.gptscript.local"
Variables ¶
This section is empty.
Functions ¶
func CloseDaemons ¶
func CloseDaemons()
func IsChatFinishMessage ¶ added in v0.8.4
func IsDaemonRunning ¶ added in v0.9.5
func StopDaemon ¶ added in v0.9.6
func StopDaemon(url string)
func WithToolCategory ¶ added in v0.7.0
func WithToolCategory(ctx context.Context, toolCategory ToolCategory) context.Context
Types ¶
type CallContext ¶ added in v0.6.0
type CallResult ¶
type ChatHistory ¶ added in v0.7.0
type ChatHistory struct {
History []ChatHistoryCall `json:"history,omitempty"`
}
type ChatHistoryCall ¶ added in v0.7.0
type ChatHistoryCall struct {
ID string `json:"id,omitempty"`
Tool types.Tool `json:"tool,omitempty"`
Completion types.CompletionRequest `json:"completion,omitempty"`
}
type Context ¶
type Context struct {
Ctx context.Context
Parent *Context
LastReturn *Return
CurrentReturn *Return
Engine *Engine
Program *types.Program
// Input is saved only so that we can render display text, don't use otherwise
Input string
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) CurrentAgent ¶ added in v0.9.0
func (c *Context) CurrentAgent() types.ToolReference
func (*Context) GetCallContext ¶ added in v0.6.0
func (c *Context) GetCallContext() *CallContext
func (*Context) MarshalJSON ¶
func (*Context) OnUserCancel ¶ added in v0.9.6
func (*Context) SubCallContext ¶ added in v0.8.4
func (*Context) UnmarshalJSON ¶
type Engine ¶
type Engine struct {
Model Model
RuntimeManager RuntimeManager
Env []string
Progress chan<- types.CompletionStatus
MCPRunner MCPRunner
}
type ErrChatFinish ¶ added in v0.8.4
type ErrChatFinish struct {
Message string
}
func (*ErrChatFinish) Error ¶ added in v0.8.4
func (e *ErrChatFinish) Error() string
type InputContext ¶ added in v0.5.0
type Model ¶ added in v0.1.4
type Model interface {
Call(ctx context.Context, messageRequest types.CompletionRequest, env []string, status chan<- types.CompletionStatus) (*types.CompletionMessage, error)
ProxyInfo([]string) (string, string, error)
}
type RuntimeManager ¶ added in v0.2.0
type State ¶
type State struct {
Input string `json:"input,omitempty"`
Completion types.CompletionRequest `json:"completion,omitempty"`
Pending map[string]types.CompletionToolCall `json:"pending,omitempty"`
Results map[string]CallResult `json:"results,omitempty"`
}
type ToolCategory ¶ added in v0.6.0
type ToolCategory string
const ( ProviderToolCategory ToolCategory = "provider" CredentialToolCategory ToolCategory = "credential" ContextToolCategory ToolCategory = "context" InputToolCategory ToolCategory = "input" OutputToolCategory ToolCategory = "output" NoCategory ToolCategory = "" )
func ToolCategoryFromContext ¶ added in v0.8.5
func ToolCategoryFromContext(ctx context.Context) ToolCategory
Click to show internal directories.
Click to hide internal directories.