Documentation
¶
Index ¶
- Constants
- type Config
- type ConnectRPCServer
- func (s *ConnectRPCServer) ConfigureAgent(ctx context.Context, req *connect.Request[aigentv1.ConfigureAgentRequest]) (*connect.Response[aigentv1.ConfigureAgentResponse], error)
- func (s *ConnectRPCServer) Converse(ctx context.Context, ...) error
- func (s *ConnectRPCServer) GetAgentStatus(ctx context.Context, req *connect.Request[aigentv1.GetAgentStatusRequest]) (*connect.Response[aigentv1.GetAgentStatusResponse], error)
- func (s *ConnectRPCServer) GetConversation(ctx context.Context, req *connect.Request[aigentv1.GetConversationRequest]) (*connect.Response[aigentv1.GetConversationResponse], error)
- func (s *ConnectRPCServer) ListConversations(ctx context.Context, req *connect.Request[aigentv1.ListConversationsRequest]) (*connect.Response[aigentv1.ListConversationsResponse], error)
- func (s *ConnectRPCServer) RemoveConversation(ctx context.Context, req *connect.Request[aigentv1.RemoveConversationRequest]) (*connect.Response[aigentv1.RemoveConversationResponse], error)
- func (s *ConnectRPCServer) Serve(ctx context.Context) error
- type ConnectRPCServerConfig
- type ConnectServerOption
- func WithConnectChatManager(chatManager *chat.Manager) ConnectServerOption
- func WithConnectInitialLogLevel(level string) ConnectServerOption
- func WithConnectInitialPersonaID(personaID string) ConnectServerOption
- func WithConnectInitialToolApprovalPolicy(policy *ToolApprovalPolicyConfig) ConnectServerOption
- func WithConnectLLMClient(client *llm.Client) ConnectServerOption
- func WithConnectLLMConfig(provider, model, apiKey, endpoint string, temp float32, maxTokens int) ConnectServerOption
- func WithConnectListenAddress(address string) ConnectServerOption
- func WithConnectListener(listener net.Listener) ConnectServerOption
- func WithConnectLogger(logger *slog.Logger) ConnectServerOption
- func WithConnectMCPManager(manager mcp.Manager) ConnectServerOption
- func WithConnectPersonaRegistry(registry *persona.Registry) ConnectServerOption
- type ToolApprovalAction
- type ToolApprovalPolicyConfig
Constants ¶
const ( ServerTypeUnix = "unix" ServerTypeTCP = "tcp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ServerType defines how the JSONRPC API is exposed: "unix" or "tcp". ServerType string // SocketPath for the JSONRPC server (used if ServerType is "unix") SocketPath string // ListenAddr is the address to listen on for connections (e.g., "localhost:8080" or "localhost:0" for dynamic port). // Used if ServerType is "websocket". ListenAddr string // LLM configuration Provider string ModelID string APIKey string Endpoint string Temperature float32 MaxTokens int // Persona configuration PersonaID string // Logging configuration LogLevel string LogFilePath string // Tool configuration EnableTools bool ToolApprovalPolicy string ConfigPath string // Streaming configuration NoStream bool }
Config contains configuration options for the agent server
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for the agent server
type ConnectRPCServer ¶ added in v0.1.0
type ConnectRPCServer struct {
// contains filtered or unexported fields
}
ConnectRPCServer implements the ConnectRPC services for the agent.
func NewConnectRPCServer ¶ added in v0.1.0
func NewConnectRPCServer(opts ...ConnectServerOption) (*ConnectRPCServer, error)
NewConnectRPCServer creates a new ConnectRPC server.
func (*ConnectRPCServer) ConfigureAgent ¶ added in v0.1.0
func (s *ConnectRPCServer) ConfigureAgent(ctx context.Context, req *connect.Request[aigentv1.ConfigureAgentRequest]) (*connect.Response[aigentv1.ConfigureAgentResponse], error)
--- AgentServiceHandler Implementations ---
func (*ConnectRPCServer) Converse ¶ added in v0.1.0
func (s *ConnectRPCServer) Converse(ctx context.Context, stream *connect.BidiStream[aigentv1.ConverseRequest, aigentv1.ConverseResponse]) error
--- ChatServiceHandler Stubs ---
func (*ConnectRPCServer) GetAgentStatus ¶ added in v0.1.0
func (s *ConnectRPCServer) GetAgentStatus(ctx context.Context, req *connect.Request[aigentv1.GetAgentStatusRequest]) (*connect.Response[aigentv1.GetAgentStatusResponse], error)
func (*ConnectRPCServer) GetConversation ¶ added in v0.1.0
func (s *ConnectRPCServer) GetConversation(ctx context.Context, req *connect.Request[aigentv1.GetConversationRequest]) (*connect.Response[aigentv1.GetConversationResponse], error)
func (*ConnectRPCServer) ListConversations ¶ added in v0.1.0
func (s *ConnectRPCServer) ListConversations(ctx context.Context, req *connect.Request[aigentv1.ListConversationsRequest]) (*connect.Response[aigentv1.ListConversationsResponse], error)
--- ChatServiceHandler Implementations (non-Converse) ---
func (*ConnectRPCServer) RemoveConversation ¶ added in v0.1.0
func (s *ConnectRPCServer) RemoveConversation(ctx context.Context, req *connect.Request[aigentv1.RemoveConversationRequest]) (*connect.Response[aigentv1.RemoveConversationResponse], error)
type ConnectRPCServerConfig ¶ added in v0.1.0
type ConnectRPCServerConfig struct { ListenAddress string Listener net.Listener Logger *slog.Logger LLMClient *llm.Client PersonaRegistry *persona.Registry MCPManager mcp.Manager // Corrected: interface type ChatManager *chat.Manager InitialPersonaID string // LLM Configuration to be stored by ConnectRPCServer LLMProviderName string LLMModelID string LLMAPIKey string LLMEndpoint string LLMTemperature float32 LLMMaxTokens int InitialLogLevel string // Store the initial log level string InitialToolApprovalPolicy *ToolApprovalPolicyConfig // Added back }
ConnectRPCServerConfig holds configuration for the ConnectRPC server.
type ConnectServerOption ¶ added in v0.1.0
type ConnectServerOption func(*ConnectRPCServerConfig) error
ConnectServerOption defines a functional option for configuring the ConnectRPCServer.
func WithConnectChatManager ¶ added in v0.1.0
func WithConnectChatManager(chatManager *chat.Manager) ConnectServerOption
WithConnectChatManager sets the ChatManager.
func WithConnectInitialLogLevel ¶ added in v0.1.0
func WithConnectInitialLogLevel(level string) ConnectServerOption
WithConnectInitialLogLevel sets the initial log level string.
func WithConnectInitialPersonaID ¶ added in v0.1.0
func WithConnectInitialPersonaID(personaID string) ConnectServerOption
WithConnectInitialPersonaID sets the initial persona ID for the server.
func WithConnectInitialToolApprovalPolicy ¶ added in v0.1.0
func WithConnectInitialToolApprovalPolicy(policy *ToolApprovalPolicyConfig) ConnectServerOption
WithConnectInitialToolApprovalPolicy sets the initial tool approval policy.
func WithConnectLLMClient ¶ added in v0.1.0
func WithConnectLLMClient(client *llm.Client) ConnectServerOption
WithConnectLLMClient sets the LLM client.
func WithConnectLLMConfig ¶ added in v0.1.0
func WithConnectLLMConfig(provider, model, apiKey, endpoint string, temp float32, maxTokens int) ConnectServerOption
WithConnectLLMConfig sets the initial LLM configuration parameters.
func WithConnectListenAddress ¶ added in v0.1.0
func WithConnectListenAddress(address string) ConnectServerOption
WithConnectListenAddress sets the listen address for the server.
func WithConnectListener ¶ added in v0.1.0
func WithConnectListener(listener net.Listener) ConnectServerOption
WithConnectListener sets a pre-configured listener for the server.
func WithConnectLogger ¶ added in v0.1.0
func WithConnectLogger(logger *slog.Logger) ConnectServerOption
WithConnectLogger sets the logger for the server.
func WithConnectMCPManager ¶ added in v0.1.0
func WithConnectMCPManager(manager mcp.Manager) ConnectServerOption
WithConnectMCPManager sets the MCP Manager for the server.
func WithConnectPersonaRegistry ¶ added in v0.1.0
func WithConnectPersonaRegistry(registry *persona.Registry) ConnectServerOption
WithConnectPersonaRegistry sets the persona registry.
type ToolApprovalAction ¶ added in v0.1.0
type ToolApprovalAction int
ToolApprovalAction defines the possible actions for a tool call.
const ( ToolApprovalActionUnspecified ToolApprovalAction = iota ToolApprovalActionApprove ToolApprovalActionDeny ToolApprovalActionRequireClientApproval )
func (ToolApprovalAction) String ¶ added in v0.1.0
func (a ToolApprovalAction) String() string
type ToolApprovalPolicyConfig ¶ added in v0.1.0
type ToolApprovalPolicyConfig struct { DefaultAction ToolApprovalAction `json:"default_action"` ToolSpecificPolicies map[string]ToolApprovalAction `json:"tool_specific_policies"` }
ToolApprovalPolicyConfig holds the configuration for tool approval.
func DefaultToolApprovalPolicy ¶ added in v0.1.0
func DefaultToolApprovalPolicy() ToolApprovalPolicyConfig