Documentation
¶
Index ¶
- func DecodeResponse(resp *http.Response, target any) error
- type Agent
- type BaseClient
- func (c *BaseClient) Delete(ctx context.Context, path string, userID string) (*http.Response, error)
- func (c *BaseClient) Get(ctx context.Context, path string, userID string) (*http.Response, error)
- func (c *BaseClient) GetUserIDOrDefault(userID string) string
- func (c *BaseClient) Post(ctx context.Context, path string, body any, userID string) (*http.Response, error)
- func (c *BaseClient) Put(ctx context.Context, path string, body any, userID string) (*http.Response, error)
- type ClientError
- type ClientOption
- type ClientSet
- type Feedback
- type Health
- type Memory
- type Model
- type ModelConfigClient
- func (c *ModelConfigClient) CreateModelConfig(ctx context.Context, request *api.CreateModelConfigRequest) (*api.StandardResponse[*v1alpha2.ModelConfig], error)
- func (c *ModelConfigClient) DeleteModelConfig(ctx context.Context, namespace, configName string) error
- func (c *ModelConfigClient) GetModelConfig(ctx context.Context, namespace, name string) (*api.StandardResponse[*api.ModelConfigResponse], error)
- func (c *ModelConfigClient) ListModelConfigs(ctx context.Context) (*api.StandardResponse[[]api.ModelConfigResponse], error)
- func (c *ModelConfigClient) UpdateModelConfig(ctx context.Context, namespace, configName string, ...) (*api.StandardResponse[*api.ModelConfigResponse], error)
- type ModelConfigInterface
- type ModelInfo
- type Namespace
- type Provider
- type ProviderModels
- type Session
- type Tool
- type ToolServer
- type ToolServerClient
- func (c *ToolServerClient) CreateToolServer(ctx context.Context, toolServer *v1alpha1.ToolServer) (*v1alpha1.ToolServer, error)
- func (c *ToolServerClient) DeleteToolServer(ctx context.Context, namespace, toolServerName string) error
- func (c *ToolServerClient) ListToolServers(ctx context.Context) ([]api.ToolServerResponse, error)
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent interface {
ListAgents(ctx context.Context) (*api.StandardResponse[[]api.AgentResponse], error)
CreateAgent(ctx context.Context, request *v1alpha2.Agent) (*api.StandardResponse[*v1alpha2.Agent], error)
GetAgent(ctx context.Context, agentRef string) (*api.StandardResponse[*api.AgentResponse], error)
UpdateAgent(ctx context.Context, request *v1alpha2.Agent) (*api.StandardResponse[*v1alpha2.Agent], error)
DeleteAgent(ctx context.Context, agentRef string) error
}
Agent defines the agent operations
func NewAgentClient ¶
func NewAgentClient(client *BaseClient) Agent
NewAgentClient creates a new agent client
type BaseClient ¶
type BaseClient struct {
BaseURL string
HTTPClient *http.Client
UserID string // Default user ID for requests that require it
}
BaseClient contains the shared HTTP functionality used by all sub-clients
func NewBaseClient ¶
func NewBaseClient(baseURL string, options ...ClientOption) *BaseClient
NewBaseClient creates a new base client with the given configuration
func (*BaseClient) GetUserIDOrDefault ¶
func (c *BaseClient) GetUserIDOrDefault(userID string) string
GetUserIDOrDefault returns the provided userID or falls back to the client's default
type ClientError ¶
ClientError represents a client-side error
func (*ClientError) Error ¶
func (e *ClientError) Error() string
type ClientOption ¶
type ClientOption func(*BaseClient)
ClientOption represents a configuration option for the client
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client
func WithUserID ¶
func WithUserID(userID string) ClientOption
WithUserID sets a default user ID for requests
type ClientSet ¶
type ClientSet struct {
Health Health
Version Version
ModelConfig ModelConfigInterface
Session Session
Agent Agent
Tool Tool
ToolServer ToolServer
Memory Memory
Provider Provider
Model Model
Namespace Namespace
Feedback Feedback
// contains filtered or unexported fields
}
ClientSet contains all the sub-clients for different resource types
func New ¶
func New(baseURL string, options ...ClientOption) *ClientSet
New creates a new KAgent client set
type Feedback ¶
type Feedback interface {
CreateFeedback(ctx context.Context, feedback *api.Feedback, userID string) error
ListFeedback(ctx context.Context, userID string) (*api.StandardResponse[[]api.Feedback], error)
}
Feedback defines the feedback operations
func NewFeedbackClient ¶
func NewFeedbackClient(client *BaseClient) Feedback
NewFeedbackClient creates a new feedback client
type Health ¶
Health defines the health-related operations
func NewHealthClient ¶
func NewHealthClient(client *BaseClient) Health
NewHealthClient creates a new health client
type Memory ¶
type Memory interface {
ListMemories(ctx context.Context) (*api.StandardResponse[[]api.MemoryResponse], error)
CreateMemory(ctx context.Context, request *api.CreateMemoryRequest) (*api.StandardResponse[*v1alpha1.Memory], error)
GetMemory(ctx context.Context, namespace, memoryName string) (*api.StandardResponse[*api.MemoryResponse], error)
UpdateMemory(ctx context.Context, namespace, memoryName string, request *api.UpdateMemoryRequest) (*api.StandardResponse[*v1alpha1.Memory], error)
DeleteMemory(ctx context.Context, namespace, memoryName string) error
}
Memory defines the memory operations
func NewMemoryClient ¶
func NewMemoryClient(client *BaseClient) Memory
NewMemoryClient creates a new memory client
type Model ¶
type Model interface {
ListSupportedModels(ctx context.Context) (*api.StandardResponse[ProviderModels], error)
}
Model defines the model operations
func NewModelClient ¶
func NewModelClient(client *BaseClient) Model
NewModelClient creates a new model client
type ModelConfigClient ¶
type ModelConfigClient struct {
// contains filtered or unexported fields
}
ModelConfigClient handles model configuration requests
func (*ModelConfigClient) CreateModelConfig ¶
func (c *ModelConfigClient) CreateModelConfig(ctx context.Context, request *api.CreateModelConfigRequest) (*api.StandardResponse[*v1alpha2.ModelConfig], error)
CreateModelConfig creates a new model configuration
func (*ModelConfigClient) DeleteModelConfig ¶
func (c *ModelConfigClient) DeleteModelConfig(ctx context.Context, namespace, configName string) error
DeleteModelConfig deletes a model configuration
func (*ModelConfigClient) GetModelConfig ¶
func (c *ModelConfigClient) GetModelConfig(ctx context.Context, namespace, name string) (*api.StandardResponse[*api.ModelConfigResponse], error)
GetModelConfig retrieves a specific model configuration
func (*ModelConfigClient) ListModelConfigs ¶
func (c *ModelConfigClient) ListModelConfigs(ctx context.Context) (*api.StandardResponse[[]api.ModelConfigResponse], error)
ListModelConfigs lists all model configurations
func (*ModelConfigClient) UpdateModelConfig ¶
func (c *ModelConfigClient) UpdateModelConfig(ctx context.Context, namespace, configName string, request *api.UpdateModelConfigRequest) (*api.StandardResponse[*api.ModelConfigResponse], error)
UpdateModelConfig updates an existing model configuration
type ModelConfigInterface ¶
type ModelConfigInterface interface {
ListModelConfigs(ctx context.Context) (*api.StandardResponse[[]api.ModelConfigResponse], error)
GetModelConfig(ctx context.Context, namespace, name string) (*api.StandardResponse[*api.ModelConfigResponse], error)
CreateModelConfig(ctx context.Context, request *api.CreateModelConfigRequest) (*api.StandardResponse[*v1alpha2.ModelConfig], error)
UpdateModelConfig(ctx context.Context, namespace, name string, request *api.UpdateModelConfigRequest) (*api.StandardResponse[*api.ModelConfigResponse], error)
DeleteModelConfig(ctx context.Context, namespace, name string) error
}
ModelConfigInterface defines the model configuration operations
func NewModelConfigClient ¶
func NewModelConfigClient(client *BaseClient) ModelConfigInterface
NewModelConfigClient creates a new model config client
type Namespace ¶
type Namespace interface {
ListNamespaces(ctx context.Context) (*api.StandardResponse[[]api.NamespaceResponse], error)
}
Namespace defines the namespace operations
func NewNamespaceClient ¶
func NewNamespaceClient(client *BaseClient) Namespace
NewNamespaceClient creates a new namespace client
type Provider ¶
type Provider interface {
ListSupportedModelProviders(ctx context.Context) (*api.StandardResponse[[]api.ProviderInfo], error)
ListSupportedMemoryProviders(ctx context.Context) (*api.StandardResponse[[]api.ProviderInfo], error)
}
Provider defines the provider operations
func NewProviderClient ¶
func NewProviderClient(client *BaseClient) Provider
NewProviderClient creates a new provider client
type ProviderModels ¶
type ProviderModels map[v1alpha2.ModelProvider][]ModelInfo
ProviderModels represents a map of provider names to their supported models
type Session ¶
type Session interface {
ListSessions(ctx context.Context) (*api.StandardResponse[[]*api.Session], error)
CreateSession(ctx context.Context, request *api.SessionRequest) (*api.StandardResponse[*api.Session], error)
GetSession(ctx context.Context, sessionName string) (*api.StandardResponse[*api.Session], error)
UpdateSession(ctx context.Context, request *api.SessionRequest) (*api.StandardResponse[*api.Session], error)
DeleteSession(ctx context.Context, sessionName string) error
ListSessionRuns(ctx context.Context, sessionName string) (*api.StandardResponse[any], error)
}
Session defines the session operations
func NewSessionClient ¶
func NewSessionClient(client *BaseClient) Session
NewSessionClient creates a new session client
type Tool ¶
Tool defines the tool operations
func NewToolClient ¶
func NewToolClient(client *BaseClient) Tool
NewToolClient creates a new tool client
type ToolServer ¶
type ToolServer interface {
ListToolServers(ctx context.Context) ([]api.ToolServerResponse, error)
CreateToolServer(ctx context.Context, toolServer *v1alpha1.ToolServer) (*v1alpha1.ToolServer, error)
DeleteToolServer(ctx context.Context, namespace, toolServerName string) error
}
ToolServer defines the tool server operations
func NewToolServerClient ¶
func NewToolServerClient(client *BaseClient) ToolServer
NewToolServerClient creates a new tool server client
type ToolServerClient ¶
type ToolServerClient struct {
// contains filtered or unexported fields
}
ToolServerClient handles tool server-related requests
func (*ToolServerClient) CreateToolServer ¶
func (c *ToolServerClient) CreateToolServer(ctx context.Context, toolServer *v1alpha1.ToolServer) (*v1alpha1.ToolServer, error)
CreateToolServer creates a new tool server
func (*ToolServerClient) DeleteToolServer ¶
func (c *ToolServerClient) DeleteToolServer(ctx context.Context, namespace, toolServerName string) error
DeleteToolServer deletes a tool server
func (*ToolServerClient) ListToolServers ¶
func (c *ToolServerClient) ListToolServers(ctx context.Context) ([]api.ToolServerResponse, error)
ListToolServers lists all tool servers
type Version ¶
type Version interface {
GetVersion(ctx context.Context) (*api.VersionResponse, error)
}
Version defines the version-related operations
func NewVersionClient ¶
func NewVersionClient(client *BaseClient) Version
NewVersionClient creates a new version client