Documentation
¶
Overview ¶
Package pocketbase provides integration between Cortex and PocketBase.
Index ¶
- type CortexPlugin
- func (p *CortexPlugin) AddTool(tool *types.Tool, ...) error
- func (p *CortexPlugin) GetBasePath() string
- func (p *CortexPlugin) GetHTTPHandler() http.Handler
- func (p *CortexPlugin) GetSSEHandler() http.Handler
- func (p *CortexPlugin) GetServerInfo() server.ServerInfo
- func (p *CortexPlugin) RegisterWithPocketBase(app interface{}) error
- type Option
- type ToolCallRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CortexPlugin ¶
type CortexPlugin struct {
// contains filtered or unexported fields
}
CortexPlugin is a PocketBase plugin that provides Cortex MCP server capabilities.
func NewCortexPlugin ¶
func NewCortexPlugin(opts ...Option) *CortexPlugin
NewCortexPlugin creates a new CortexPlugin with the given options.
func (*CortexPlugin) AddTool ¶
func (p *CortexPlugin) AddTool(tool *types.Tool, handler func(ctx context.Context, request ToolCallRequest) (interface{}, error)) error
AddTool adds a tool to the Cortex server.
func (*CortexPlugin) GetBasePath ¶
func (p *CortexPlugin) GetBasePath() string
GetBasePath returns the base path configured for the plugin.
func (*CortexPlugin) GetHTTPHandler ¶
func (p *CortexPlugin) GetHTTPHandler() http.Handler
GetHTTPHandler returns an HTTP handler for the Cortex server. This can be used to integrate with PocketBase or any other HTTP server.
func (*CortexPlugin) GetSSEHandler ¶
func (p *CortexPlugin) GetSSEHandler() http.Handler
GetSSEHandler returns a dedicated handler just for the SSE endpoint
func (*CortexPlugin) GetServerInfo ¶
func (p *CortexPlugin) GetServerInfo() server.ServerInfo
GetServerInfo returns basic information about the Cortex server.
func (*CortexPlugin) RegisterWithPocketBase ¶
func (p *CortexPlugin) RegisterWithPocketBase(app interface{}) error
RegisterWithPocketBase registers the Cortex plugin with a PocketBase app. This method would be implemented when we have access to the PocketBase API.
type Option ¶
type Option func(*CortexPlugin)
Option is a function that configures a CortexPlugin.
func WithBasePath ¶
WithBasePath sets the base path for the Cortex server routes.
func WithLogger ¶
WithLogger sets the logger for the Cortex server.
func WithVersion ¶
WithVersion sets the version of the Cortex server.
type ToolCallRequest ¶
type ToolCallRequest struct { Name string Parameters map[string]interface{} Session *types.ClientSession }
ToolCallRequest represents a request to execute a tool.