Documentation
¶
Index ¶
- Constants
- Variables
- func CurrentAgent(ctx context.Context) string
- func GetSessionAndAccountID(ctx context.Context) (string, string)
- func GetWorkspaceID(ctx context.Context) string
- func InternalLLMRequestType(ctx context.Context) string
- func IsChatSession(ctx context.Context) bool
- func IsModelTool(t mcp.Tool) bool
- func IsUISession(ctx context.Context) bool
- func IsUITool(t mcp.Tool) bool
- func MarshalMeta(obj any) ([]byte, error)
- func Meta(m map[string]any) map[string]any
- func ResourceContentUseBlob(mimeType string, content []byte) bool
- func UnmarshalMeta[T any](data []byte, out *T) error
- func WithConfig(ctx context.Context, config Config) context.Context
- func WithInternalLLMRequestType(ctx context.Context, requestType string) context.Context
- func WithNanobotContext(ctx context.Context, nc Context) context.Context
- func WithThreadTitleRequest(ctx context.Context) context.Context
- type Agent
- type AgentConfigHook
- type AgentConfigHookMCPServer
- type AgentDisplay
- type AgentList
- type AgentPermission
- type AgentPermissions
- func (a *AgentPermissions) Allowed(from iter.Seq[string]) []string
- func (a *AgentPermissions) IsAllowed(perm string) bool
- func (a AgentPermissions) MarshalJSON() ([]byte, error)
- func (a AgentPermissions) MarshalYAML() (any, error)
- func (a *AgentPermissions) UnmarshalJSON(data []byte) error
- func (a *AgentPermissions) UnmarshalYAML(value *yaml.Node) error
- type AgentReasoning
- type AgentRequestHook
- type AgentResponseHook
- type AsyncCallResult
- type Attachment
- type Auth
- type BuildToolMappingsOptions
- type CallResult
- type Chat
- type ChatList
- type Completer
- type CompletionItem
- type CompletionOptions
- type CompletionProgress
- type CompletionRequest
- type CompletionResponse
- type Config
- type ConfigFactory
- type Context
- type Dialect
- type DynamicInstructions
- type EnvDef
- type Execution
- type Field
- type HookAgent
- type InputSchema
- type LLMProvider
- type Message
- type OutputSchema
- type Prompt
- type PromptMappings
- type Publish
- type Reasoning
- type ResourceMappings
- type ResourceTemplateMappings
- type SampleCallRequest
- type SampleConfirmRequest
- type SessionInitHook
- type StringList
- type SummaryText
- type TargetMapping
- type TargetTool
- type TemplateMatch
- type ToolCall
- type ToolCallConfirm
- type ToolCallResult
- type ToolMappings
- type ToolOutput
- type ToolRef
- type ToolUseDefinition
- type UIAction
- type UIIntent
- type UIPrompt
- type UITool
- type Workspace
Constants ¶
const ( AgentTool = "chat-with-" AgentToolDescription = "Chat with the agent" AttachmentMetaKey = "ai.nanobot.meta/attachment" SkipTruncationMetaKey = "ai.nanobot.meta/skip-truncation" )
const ( ConfigSessionKey = "config" ConfigHashSessionKey = "configHash" CurrentAgentSessionKey = "currentAgent" SessionInitSessionKey = "sessionInit" DefaultAgentSessionKey = "defaultAgent" AccountIDSessionKey = "accountID" DescriptionSessionKey = "description" TaskURISessionKey = "taskURI" ResourceSubscriptionsSessionKey = "resourceSubscriptions" PublicURLSessionKey = "publicURL" )
const ( InternalLLMRequestTypeHeader = "X-Nanobot-Internal-Request-Type" ThreadTitleRequestType = "nanobot.summary.thread_title" )
const ( MessageMimeType = "application/vnd.nanobot.chat.message+json" HistoryMimeType = "application/vnd.nanobot.chat.history+json" ToolResultMimeType = "application/vnd.nanobot.tool.result+json" ErrorMimeType = "application/vnd.nanobot.error+json" AgentMimeType = "application/vnd.nanobot.agent+json" SessionMimeType = "application/vnd.nanobot.session+json" ElicitationMimeType = "application/vnd.nanobot.elicitation+json" MetaNanobot = "ai.nanobot" MessageURI = "chat://message/%s" HistoryURI = "chat://history" ProgressURI = "chat://progress" ElicitationURI = "chat://elicitation" )
const CompletionProgressMetaKey = "ai.nanobot.progress/completion"
const PreviousExecutionKey = "thread"
Variables ¶
var ( MetaPrefix = "ai.nanobot.meta/" ToolCallConfirmType = "toolcall/confirm" AsyncMetaKey = "ai.nanobot.async" )
var ( ImageMimeTypes = map[string]struct{}{ "image/png": {}, "image/jpeg": {}, "image/webp": {}, } TextMimeTypes = map[string]struct{}{ "text/plain": {}, "text/markdown": {}, "text/html": {}, "text/csv": {}, "application/json": {}, "application/xml": {}, "application/javascript": {}, "image/svg+xml": {}, } PDFMimeTypes = map[string]struct{}{ "application/pdf": {}, } )
var ChatInputSchema = []byte(`{
"type": "object",
"required": ["prompt"],
"properties": {
"prompt": {
"description": "The input prompt",
"type": "string"
},
"attachments": {
"type": "array",
"items": {
"description": "An attachment to the prompt (optional)",
"type": "object",
"required": ["url"],
"properties": {
"name": {
"description": "The name of the resource, often the filename",
"type": "string"
},
"url": {
"description": "The URL of the attachment or data URI",
"type": "string"
},
"mimeType": {
"description": "The mime type of the content reference by the URL",
"type": "string"
}
}
}
}
}
}`)
Functions ¶
func CurrentAgent ¶ added in v0.0.79
func GetSessionAndAccountID ¶ added in v0.0.79
func GetWorkspaceID ¶ added in v0.0.79
func InternalLLMRequestType ¶ added in v0.0.79
func IsChatSession ¶ added in v0.0.79
func IsModelTool ¶ added in v0.0.79
func IsUISession ¶ added in v0.0.79
func MarshalMeta ¶ added in v0.0.79
func ResourceContentUseBlob ¶ added in v0.0.79
ResourceContentUseBlob reports whether file bytes should be sent in MCP ResourceContent.blob (base64) rather than ResourceContent.text (UTF-8 string). Binary formats such as Office documents must use blob; interpreting them as Go strings corrupts the payload.
func UnmarshalMeta ¶ added in v0.0.79
func WithConfig ¶ added in v0.0.79
func WithInternalLLMRequestType ¶ added in v0.0.79
func WithNanobotContext ¶ added in v0.0.79
Types ¶
type Agent ¶
type Agent struct {
HookAgent `json:",inline" yaml:",inline"`
Output *OutputSchema `json:"output,omitempty"`
}
func (Agent) ToDisplay ¶ added in v0.0.79
func (a Agent) ToDisplay(id string) AgentDisplay
type AgentConfigHook ¶ added in v0.0.79
type AgentConfigHook struct {
Agent *HookAgent `json:"agent,omitempty"`
Meta map[string]any `json:"_meta,omitempty"`
SessionID string `json:"sessionId,omitempty"`
MCPServers map[string]AgentConfigHookMCPServer `json:"mcpServers,omitempty"`
}
AgentConfigHook is a hook that can be used to configure the agent. Hook Name = "config"
type AgentConfigHookMCPServer ¶ added in v0.0.79
type AgentConfigHookMCPServer struct {
URL string `json:"url"`
Headers map[string]string `json:"headers"`
}
func (AgentConfigHookMCPServer) ToMCPServer ¶ added in v0.0.79
func (a AgentConfigHookMCPServer) ToMCPServer() mcp.Server
type AgentDisplay ¶ added in v0.0.79
type AgentDisplay struct {
ID string `json:"id"`
Name string `json:"name"`
ShortName string `json:"shortName"`
Description string `json:"description"`
Icon string `json:"icon"`
IconDark string `json:"iconDark"`
StarterMessages []string `json:"starterMessages"`
Base bool `json:"base"`
Current bool `json:"current"`
}
type AgentList ¶ added in v0.0.79
type AgentList struct {
Agents []AgentDisplay `json:"agents"`
}
type AgentPermission ¶ added in v0.0.79
type AgentPermission string
const ( AgentPermissionUnset AgentPermission = "" AgentPermissionAllow AgentPermission = "allow" AgentPermissionDeny AgentPermission = "deny" )
type AgentPermissions ¶ added in v0.0.79
type AgentPermissions struct {
// contains filtered or unexported fields
}
func DenyAllPermissions ¶ added in v0.0.79
func DenyAllPermissions() *AgentPermissions
func (*AgentPermissions) Allowed ¶ added in v0.0.79
func (a *AgentPermissions) Allowed(from iter.Seq[string]) []string
Allowed returns a list of the allowed permissions from the input.
func (*AgentPermissions) IsAllowed ¶ added in v0.0.79
func (a *AgentPermissions) IsAllowed(perm string) bool
IsAllowed returns true if the permission is allowed.
func (AgentPermissions) MarshalJSON ¶ added in v0.0.79
func (a AgentPermissions) MarshalJSON() ([]byte, error)
func (AgentPermissions) MarshalYAML ¶ added in v0.0.79
func (a AgentPermissions) MarshalYAML() (any, error)
func (*AgentPermissions) UnmarshalJSON ¶ added in v0.0.79
func (a *AgentPermissions) UnmarshalJSON(data []byte) error
func (*AgentPermissions) UnmarshalYAML ¶ added in v0.0.79
func (a *AgentPermissions) UnmarshalYAML(value *yaml.Node) error
type AgentReasoning ¶ added in v0.0.79
type AgentRequestHook ¶ added in v0.0.79
type AgentRequestHook struct {
Request *CompletionRequest `json:"request,omitempty"`
Response *CompletionResponse `json:"response,omitempty"`
}
AgentRequestHook is a hook that can be used to modify the request before it is sent to the MCP server. Hook Name = "request"
type AgentResponseHook ¶ added in v0.0.79
type AgentResponseHook = AgentRequestHook
AgentResponseHook is a hook that can be used to modify the response before it is returned to the agent. Hook Name = "response"
type AsyncCallResult ¶ added in v0.0.79
type AsyncCallResult struct {
Meta map[string]any `json:"_meta,omitzero"`
IsError bool `json:"isError"`
Content []mcp.Content `json:"content,omitzero"`
InProgress bool `json:"inProgress,omitempty"`
ToolName string `json:"toolName,omitempty"`
ProgressToken any `json:"progressToken,omitempty"`
InputReplacement string `json:"inputReplacement,omitempty"`
}
type Attachment ¶
type Attachment struct {
Name string `json:"name,omitempty"`
URL string `json:"url"`
MimeType string `json:"mimeType,omitempty"`
}
func (*Attachment) UnmarshalJSON ¶ added in v0.0.79
func (a *Attachment) UnmarshalJSON(data []byte) error
type Auth ¶ added in v0.0.79
type Auth struct {
OAuthClientID string `json:"oauthClientId"`
OAuthClientSecret string `json:"oauthClientSecret"`
OAuthAuthorizeURL string `json:"oauthAuthorizeUrl"`
OAuthScopes StringList `json:"oauthScopes"`
OAuthAuthorizationServerMetadata map[string]any `json:"oauthAuthorizationServerMetadata"`
EncryptionKey string `json:"encryptionKey"`
APIKeyAuthURL string `json:"apiKeyAuthUrl"`
}
type BuildToolMappingsOptions ¶ added in v0.0.79
type BuildToolMappingsOptions struct {
DefaultAsToServer bool
}
func (BuildToolMappingsOptions) Merge ¶ added in v0.0.79
func (b BuildToolMappingsOptions) Merge(other BuildToolMappingsOptions) BuildToolMappingsOptions
type CallResult ¶ added in v0.0.79
type CallResult struct {
Meta map[string]any `json:"_meta,omitzero"`
Content []mcp.Content `json:"content,omitempty"`
IsError bool `json:"isError,omitempty"`
Agent string `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
StopReason string `json:"stopReason,omitempty"`
StructuredContent map[string]any `json:"structuredContent,omitempty"`
}
type Completer ¶
type Completer interface {
Complete(ctx context.Context, req CompletionRequest, opts ...CompletionOptions) (*CompletionResponse, error)
}
type CompletionItem ¶ added in v0.0.79
type CompletionItem struct {
ID string `json:"id,omitempty"`
Partial bool `json:"partial,omitempty"`
HasMore bool `json:"hasMore,omitempty"`
Content *mcp.Content `json:"content,omitempty"`
ToolCall *ToolCall `json:"toolCall,omitempty"`
ToolCallResult *ToolCallResult `json:"toolCallResult,omitempty"`
Reasoning *Reasoning `json:"reasoning,omitempty"`
}
func (CompletionItem) MarshalJSON ¶ added in v0.0.79
func (c CompletionItem) MarshalJSON() ([]byte, error)
func (*CompletionItem) UnmarshalJSON ¶ added in v0.0.79
func (c *CompletionItem) UnmarshalJSON(data []byte) error
type CompletionOptions ¶
type CompletionOptions struct {
ProgressToken any
Chat *bool
ToolChoice *mcp.ToolChoice
Tools []mcp.Tool
ToolIncludeContext string
ToolSource string
}
func (CompletionOptions) Merge ¶ added in v0.0.79
func (c CompletionOptions) Merge(other CompletionOptions) (result CompletionOptions)
type CompletionProgress ¶ added in v0.0.79
type CompletionProgress struct {
Model string `json:"model,omitempty"`
Agent string `json:"agent,omitempty"`
MessageID string `json:"messageID,omitempty"`
Role string `json:"role,omitempty"`
Item CompletionItem `json:"item,omitempty"`
}
type CompletionRequest ¶
type CompletionRequest struct {
Model string `json:"model,omitempty"`
Agent string `json:"agent,omitempty"`
ThreadName string `json:"threadName,omitempty"`
NewThread bool `json:"newThread,omitempty"`
Input []Message `json:"input,omitzero"`
ModelPreferences mcp.ModelPreferences `json:"modelPreferences,omitzero"`
SystemPrompt string `json:"systemPrompt,omitzero"`
MaxTokens int `json:"maxTokens,omitempty"`
ToolChoice string `json:"toolChoice,omitempty"`
OutputSchema *OutputSchema `json:"outputSchema,omitempty"`
Temperature *json.Number `json:"temperature,omitempty"`
Truncation string `json:"truncation,omitempty"`
TopP *json.Number `json:"topP,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Tools []ToolUseDefinition `json:"tools,omitzero"`
Reasoning *AgentReasoning `json:"reasoning,omitempty"`
}
func (CompletionRequest) GetAgent ¶ added in v0.0.79
func (r CompletionRequest) GetAgent() string
func (CompletionRequest) Reset ¶ added in v0.0.79
func (r CompletionRequest) Reset() CompletionRequest
type CompletionResponse ¶
type CompletionResponse struct {
Output Message `json:"output,omitempty"`
InternalMessages []Message `json:"internalMessages,omitempty"`
Agent string `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
HasMore bool `json:"hasMore,omitempty"`
Error string `json:"error,omitempty"`
ProgressToken any `json:"progressToken,omitempty"`
// InputReplacement, if set, indicates the last user message was replaced
// by the LLM proxy due to a policy violation. The value is the replacement text.
InputReplacement string `json:"inputReplacement,omitempty"`
// ToolCallPolicyViolation, if set, indicates that the LLM's tool calls were blocked
// by the proxy due to a policy violation. The value is the explanation to return as
// error tool_results instead of executing the tools.
ToolCallPolicyViolation string `json:"toolCallPolicyViolation,omitempty"`
}
func (*CompletionResponse) Deserialize ¶ added in v0.0.79
func (c *CompletionResponse) Deserialize(data any) (any, error)
func (*CompletionResponse) Serialize ¶ added in v0.0.79
func (c *CompletionResponse) Serialize() (any, error)
type Config ¶
type Config struct {
Auth *Auth `json:"auth,omitempty"`
Extends StringList `json:"extends,omitempty"`
Env map[string]EnvDef `json:"env,omitempty"`
Publish Publish `json:"publish,omitzero"`
LLMProviders map[string]LLMProvider `json:"llmProviders,omitempty"`
Agents map[string]Agent `json:"agents,omitempty"`
MCPServers map[string]mcp.Server `json:"mcpServers,omitempty"`
Profiles map[string]Config `json:"profiles,omitempty"`
Prompts map[string]Prompt `json:"prompts,omitempty"`
Hooks mcp.Hooks `json:"hooks,omitempty"`
WorkspaceID string `json:"workspaceId,omitempty"`
WorkspaceBaseURI string `json:"workspaceBaseUri,omitempty"`
}
func ConfigFromContext ¶ added in v0.0.79
type ConfigFactory ¶ added in v0.0.79
type Context ¶ added in v0.0.79
type Context struct {
User mcp.User
Config ConfigFactory
Profile []string
}
func NanobotContext ¶ added in v0.0.79
type Dialect ¶ added in v0.0.79
type Dialect string
const ( DialectAnthropicMessages Dialect = "AnthropicMessages" DialectOpenAIResponses Dialect = "OpenAIResponses" DialectOpenResponses Dialect = "OpenResponses" DialectOpenAIChatCompletions Dialect = "OpenAIChatCompletions" DialectDefault = DialectOpenAIResponses )
type DynamicInstructions ¶
type DynamicInstructions struct {
Instructions string `json:"-"`
MCPServer string `json:"mcpServer,omitempty"`
Prompt string `json:"prompt,omitempty"`
Args map[string]string `json:"args,omitempty"`
}
func (DynamicInstructions) IsPrompt ¶
func (a DynamicInstructions) IsPrompt() bool
func (DynamicInstructions) IsSet ¶
func (a DynamicInstructions) IsSet() bool
func (DynamicInstructions) MarshalJSON ¶
func (a DynamicInstructions) MarshalJSON() ([]byte, error)
func (*DynamicInstructions) UnmarshalJSON ¶
func (a *DynamicInstructions) UnmarshalJSON(data []byte) error
type EnvDef ¶ added in v0.0.79
type EnvDef struct {
Default string `json:"default,omitempty"`
Description string `json:"description,omitempty"`
Options StringList `json:"options,omitempty"`
Optional bool `json:"optional,omitempty"`
Sensitive *bool `json:"sensitive,omitempty"`
UseBearerToken bool `json:"useBearerToken,omitempty"`
}
func (*EnvDef) UnmarshalJSON ¶ added in v0.0.79
type Execution ¶ added in v0.0.79
type Execution struct {
Request CompletionRequest `json:"request,omitempty"`
Done bool `json:"done,omitempty"`
PopulatedRequest *CompletionRequest `json:"populatedRequest,omitempty"`
ToolToMCPServer ToolMappings `json:"toolToMCPServer,omitempty"`
Response *CompletionResponse `json:"response,omitempty"`
ToolOutputs map[string]ToolOutput `json:"toolOutputs,omitempty"`
CompactedMessages []Message `json:"compactedMessages,omitempty"`
}
func (*Execution) Deserialize ¶ added in v0.0.79
type Field ¶ added in v0.0.79
type Field struct {
Description string `json:"description,omitempty"`
Fields map[string]Field `json:"fields,omitempty"`
Required *bool `json:"required,omitempty"`
}
func (Field) MarshalJSON ¶ added in v0.0.79
func (*Field) UnmarshalJSON ¶ added in v0.0.79
type HookAgent ¶ added in v0.0.79
type HookAgent struct {
Name string `json:"name,omitempty"`
ShortName string `json:"shortName,omitempty"`
Description string `json:"description,omitempty"`
Icon string `json:"icon,omitempty"`
IconDark string `json:"iconDark,omitempty"`
StarterMessages StringList `json:"starterMessages,omitempty"`
Instructions DynamicInstructions `json:"instructions,omitzero"`
Model string `json:"model,omitempty"`
Permissions *AgentPermissions `json:"permissions,omitempty"`
MCPServers StringList `json:"mcpServers,omitempty"`
Tools StringList `json:"tools,omitempty"`
Agents StringList `json:"agents,omitempty"`
Prompts StringList `json:"prompts,omitzero"`
Resources StringList `json:"resources,omitzero"`
Reasoning *AgentReasoning `json:"reasoning,omitempty"`
ThreadName string `json:"threadName,omitempty"`
Chat *bool `json:"chat,omitempty"`
ToolExtensions map[string]map[string]any `json:"toolExtensions,omitempty"`
ToolChoice string `json:"toolChoice,omitempty"`
Temperature *json.Number `json:"temperature,omitempty"`
TopP *json.Number `json:"topP,omitempty"`
Truncation string `json:"truncation,omitempty"`
MaxTokens int `json:"maxTokens,omitempty"`
ContextWindow int `json:"contextWindow,omitempty"`
MimeTypes []string `json:"mimeTypes,omitempty"`
Hooks mcp.Hooks `json:"hooks,omitempty"`
Aliases []string `json:"aliases,omitempty"`
Cost float64 `json:"cost,omitempty"`
Speed float64 `json:"speed,omitempty"`
Intelligence float64 `json:"intelligence,omitempty"`
}
type InputSchema ¶ added in v0.0.79
type InputSchema struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Schema json.RawMessage `json:"schema,omitzero"`
Fields map[string]Field `json:"fields,omitempty"`
}
func (InputSchema) ToSchema ¶ added in v0.0.79
func (i InputSchema) ToSchema() json.RawMessage
type LLMProvider ¶ added in v0.0.79
type Message ¶ added in v0.0.79
type Message struct {
ID string `json:"id,omitempty"`
Created *time.Time `json:"created,omitempty"`
Role string `json:"role,omitempty"`
Items []CompletionItem `json:"items,omitempty"`
HasMore bool `json:"hasMore,omitempty"`
}
func ConsolidateTools ¶ added in v0.0.79
type OutputSchema ¶
type OutputSchema struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Schema json.RawMessage `json:"schema,omitzero"`
Strict bool `json:"strict,omitempty"`
Fields map[string]Field `json:"fields,omitempty"`
}
func (OutputSchema) ToSchema ¶ added in v0.0.79
func (o OutputSchema) ToSchema() json.RawMessage
type Prompt ¶ added in v0.0.79
type PromptMappings ¶
type PromptMappings map[string]TargetMapping[mcp.Prompt]
func (PromptMappings) Deserialize ¶ added in v0.0.79
func (p PromptMappings) Deserialize(data any) (any, error)
type Publish ¶
type Publish struct {
Name string `json:"name,omitempty"`
Introduction DynamicInstructions `json:"introduction,omitzero"`
Version string `json:"version,omitempty"`
Instructions string `json:"instructions,omitempty"`
Tools StringList `json:"tools,omitzero"`
Prompts StringList `json:"prompts,omitzero"`
Resources StringList `json:"resources,omitzero"`
ResourceTemplates StringList `json:"resourceTemplates,omitzero"`
MCPServers StringList `json:"mcpServers,omitzero"`
Entrypoint StringList `json:"entrypoint,omitempty"`
LazyInitialize *bool `json:"lazyInitialize,omitempty"`
}
func (Publish) IsLazyInitialize ¶ added in v0.0.92
func (Publish) IsSingleServerProxy ¶ added in v0.0.79
type Reasoning ¶ added in v0.0.79
type Reasoning struct {
EncryptedContent string `json:"encryptedContent,omitempty"`
Summary []SummaryText `json:"summary,omitempty"`
}
type ResourceMappings ¶
type ResourceMappings map[string]TargetMapping[mcp.Resource]
func (ResourceMappings) Deserialize ¶ added in v0.0.79
func (r ResourceMappings) Deserialize(data any) (any, error)
type ResourceTemplateMappings ¶
type ResourceTemplateMappings map[string]TargetMapping[TemplateMatch]
func (ResourceTemplateMappings) Deserialize ¶ added in v0.0.79
func (r ResourceTemplateMappings) Deserialize(data any) (any, error)
type SampleCallRequest ¶
type SampleCallRequest struct {
Prompt string `json:"prompt"`
Attachments []Attachment `json:"attachments,omitempty"`
}
type SampleConfirmRequest ¶
type SessionInitHook ¶ added in v0.0.79
type SessionInitHook struct {
URL string `json:"url"`
SessionID string `json:"sessionId"`
Meta map[string]any `json:"_meta,omitempty"`
}
func (*SessionInitHook) Deserialize ¶ added in v0.0.79
func (s *SessionInitHook) Deserialize(data any) (any, error)
func (*SessionInitHook) Serialize ¶ added in v0.0.79
func (s *SessionInitHook) Serialize() (any, error)
type StringList ¶
type StringList []string
func (*StringList) UnmarshalJSON ¶
func (s *StringList) UnmarshalJSON(data []byte) error
type SummaryText ¶ added in v0.0.79
type SummaryText struct {
Text string `json:"text,omitempty"`
}
type TargetMapping ¶
type TargetTool ¶ added in v0.0.79
type TemplateMatch ¶ added in v0.0.79
type TemplateMatch struct {
Regexp *regexp.Regexp
ResourceTemplate mcp.ResourceTemplate
}
func (TemplateMatch) MarshalJSON ¶ added in v0.0.79
func (t TemplateMatch) MarshalJSON() ([]byte, error)
func (*TemplateMatch) UnmarshalJSON ¶ added in v0.0.79
func (t *TemplateMatch) UnmarshalJSON(data []byte) error
type ToolCallConfirm ¶ added in v0.0.79
type ToolCallConfirm struct {
Type string `json:"type"`
MCPServer string `json:"mcpServer,omitempty"`
Tool mcp.Tool `json:"tool,omitempty"`
Invocation *ToolCall `json:"invocation,omitempty"`
}
func (ToolCallConfirm) MarshalJSON ¶ added in v0.0.79
func (t ToolCallConfirm) MarshalJSON() ([]byte, error)
func (ToolCallConfirm) Message ¶ added in v0.0.79
func (t ToolCallConfirm) Message() string
func (*ToolCallConfirm) UnmarshalJSON ¶ added in v0.0.79
func (t *ToolCallConfirm) UnmarshalJSON(data []byte) error
type ToolCallResult ¶
type ToolCallResult struct {
CallID string `json:"callID,omitempty"`
Output CallResult `json:"output,omitzero"`
}
type ToolMappings ¶
type ToolMappings map[string]TargetMapping[TargetTool]
func (*ToolMappings) Deserialize ¶ added in v0.0.79
func (t *ToolMappings) Deserialize(data any) (any, error)