Documentation ¶
Index ¶
- Constants
- Variables
- func CloseDaemons()
- func SetPorts(start, end int64)
- func WithToolCategory(ctx context.Context, toolCategory ToolCategory) context.Context
- type Call
- type CallContext
- type CallResult
- type ChatHistory
- type ChatHistoryCall
- type Context
- func (c *Context) GetCallContext() *CallContext
- func (c *Context) MarshalJSON() ([]byte, error)
- func (c *Context) ParentID() string
- func (c *Context) SubCall(ctx context.Context, input, toolID, callID string, toolCategory ToolCategory) (Context, error)
- func (c *Context) UnmarshalJSON([]byte) error
- func (c *Context) WrappedContext() context.Context
- type Engine
- type InputContext
- type Model
- type OpenAPIInstructions
- type Parameter
- type Ports
- type Return
- type RuntimeManager
- type SecurityInfo
- type State
- type ToolCategory
Constants ¶
View Source
const DaemonURLSuffix = ".daemon.gptscript.local"
Variables ¶
View Source
var ( SupportedMIMETypes = []string{"application/json", "text/plain", "multipart/form-data"} SupportedSecurityTypes = []string{"apiKey", "http"} )
Functions ¶
func CloseDaemons ¶
func CloseDaemons()
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 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 (*Context) GetCallContext ¶ added in v0.6.0
func (c *Context) GetCallContext() *CallContext
func (*Context) MarshalJSON ¶
func (*Context) UnmarshalJSON ¶
func (*Context) WrappedContext ¶ added in v0.4.2
type Engine ¶
type Engine struct { Model Model RuntimeManager RuntimeManager Env []string Progress chan<- types.CompletionStatus }
type InputContext ¶ added in v0.5.0
type Model ¶ added in v0.1.4
type Model interface {
Call(ctx context.Context, messageRequest types.CompletionRequest, status chan<- types.CompletionStatus) (*types.CompletionMessage, error)
}
type OpenAPIInstructions ¶ added in v0.4.0
type OpenAPIInstructions struct { Server string `json:"server"` Path string `json:"path"` Method string `json:"method"` BodyContentMIME string `json:"bodyContentMIME"` SecurityInfos [][]SecurityInfo `json:"apiKeyInfos"` QueryParameters []Parameter `json:"queryParameters"` PathParameters []Parameter `json:"pathParameters"` HeaderParameters []Parameter `json:"headerParameters"` CookieParameters []Parameter `json:"cookieParameters"` }
type RuntimeManager ¶ added in v0.2.0
type SecurityInfo ¶ added in v0.4.0
type SecurityInfo struct { Name string `json:"name"` // name as defined in the security schemes Type string `json:"type"` // http or apiKey Scheme string `json:"scheme"` // bearer or basic, for type==http APIKeyName string `json:"apiKeyName"` // name of the API key, for type==apiKey In string `json:"in"` // header, query, or cookie, for type==apiKey }
A SecurityInfo represents a security scheme in OpenAPI.
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" NoCategory ToolCategory = "" )
Click to show internal directories.
Click to hide internal directories.