Documentation
¶
Index ¶
- type Builder
- func (b *Builder) BuildLLMContextUserRequest(bot *bots.Bot, requestingUser *model.User, channel *model.Channel, ...) *llm.Context
- func (b *Builder) WithLLMContextBot(bot *bots.Bot) llm.ContextOption
- func (b *Builder) WithLLMContextChannel(channel *model.Channel) llm.ContextOption
- func (b *Builder) WithLLMContextDefaultTools(bot *bots.Bot) llm.ContextOption
- func (b *Builder) WithLLMContextNoTools() llm.ContextOption
- func (b *Builder) WithLLMContextParameters(params map[string]interface{}) llm.ContextOption
- func (b *Builder) WithLLMContextRequestingUser(user *model.User) llm.ContextOption
- func (b *Builder) WithLLMContextServerInfo() llm.ContextOption
- func (b *Builder) WithLLMContextTools(bot *bots.Bot) llm.ContextOption
- type ConfigProvider
- type MCPToolProvider
- type ToolProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds contexts for LLM requests
func NewLLMContextBuilder ¶
func NewLLMContextBuilder( pluginAPI *pluginapi.Client, toolProvider ToolProvider, mcpToolProvider MCPToolProvider, configProvider ConfigProvider, ) *Builder
NewLLMContextBuilder creates a new LLM context builder
func (*Builder) BuildLLMContextUserRequest ¶
func (b *Builder) BuildLLMContextUserRequest(bot *bots.Bot, requestingUser *model.User, channel *model.Channel, opts ...llm.ContextOption) *llm.Context
BuildLLMContextUserRequest is a helper function to collect the required context for a user request.
func (*Builder) WithLLMContextBot ¶
func (b *Builder) WithLLMContextBot(bot *bots.Bot) llm.ContextOption
func (*Builder) WithLLMContextChannel ¶
func (b *Builder) WithLLMContextChannel(channel *model.Channel) llm.ContextOption
func (*Builder) WithLLMContextDefaultTools ¶
func (b *Builder) WithLLMContextDefaultTools(bot *bots.Bot) llm.ContextOption
WithLLMContextDefaultTools adds default tools to the LLM context for the requesting user
func (*Builder) WithLLMContextNoTools ¶ added in v1.4.0
func (b *Builder) WithLLMContextNoTools() llm.ContextOption
WithLLMContextNoTools explicitly disables tools for this context session only, overriding the bot's DisableTools configuration. This allows inter-plugin requests to work with tool-enabled bots by bypassing tools for non-streaming calls.
func (*Builder) WithLLMContextParameters ¶
func (b *Builder) WithLLMContextParameters(params map[string]interface{}) llm.ContextOption
func (*Builder) WithLLMContextRequestingUser ¶
func (b *Builder) WithLLMContextRequestingUser(user *model.User) llm.ContextOption
func (*Builder) WithLLMContextServerInfo ¶
func (b *Builder) WithLLMContextServerInfo() llm.ContextOption
func (*Builder) WithLLMContextTools ¶ added in v1.5.0
func (b *Builder) WithLLMContextTools(bot *bots.Bot) llm.ContextOption
WithLLMContextTools adds tools to the LLM context the requester can access. Tools are always added for LLM awareness; execution is controlled via WithToolsDisabled() based on the context (e.g., DM vs channel).
type ConfigProvider ¶
type ConfigProvider interface {
GetEnableLLMTrace() bool
GetServiceByID(id string) (llm.ServiceConfig, bool)
}
ConfigProvider provides configuration access
type MCPToolProvider ¶
MCPToolProvider provides MCP tools for a user