Documentation
¶
Index ¶
- type AgentClient
- func (c *AgentClient) CreateAgent(ctx context.Context, agent *models.Agent) error
- func (c *AgentClient) DeleteAgent(ctx context.Context, id string) error
- func (c *AgentClient) GetAgentByID(ctx context.Context, id string, tenantID string) (*models.Agent, error)
- func (c *AgentClient) ListAgents(ctx context.Context, tenantID string) ([]*models.Agent, error)
- func (c *AgentClient) UpdateAgent(ctx context.Context, agent *models.Agent) error
- type ClientConfig
- type ContextClient
- func (c *ContextClient) CreateContext(ctx context.Context, contextObj *models.Context) (*models.Context, error)
- func (c *ContextClient) DeleteContext(ctx context.Context, contextID string) error
- func (c *ContextClient) GetContext(ctx context.Context, contextID string) (*models.Context, error)
- func (c *ContextClient) ListContexts(ctx context.Context, agentID, sessionID string, options map[string]interface{}) ([]*models.Context, error)
- func (c *ContextClient) SearchInContext(ctx context.Context, contextID, query string) ([]models.ContextItem, error)
- func (c *ContextClient) SummarizeContext(ctx context.Context, contextID string) (string, error)
- func (c *ContextClient) UpdateContext(ctx context.Context, contextID string, contextObj *models.Context, ...) (*models.Context, error)
- type Factory
- func (f *Factory) Agent() *AgentClient
- func (f *Factory) Client() *RESTClient
- func (f *Factory) Model() *ModelClient
- func (f *Factory) NewContextClient(logger observability.Logger) *ContextClient
- func (f *Factory) NewSearchClient(logger observability.Logger) *SearchClient
- func (f *Factory) Vector() *VectorClient
- type ModelClient
- func (c *ModelClient) CreateModel(ctx context.Context, model *models.Model) error
- func (c *ModelClient) DeleteModel(ctx context.Context, id string) error
- func (c *ModelClient) GetModelByID(ctx context.Context, id string) (*models.Model, error)
- func (c *ModelClient) ListModels(ctx context.Context) ([]*models.Model, error)
- func (c *ModelClient) UpdateModel(ctx context.Context, model *models.Model) error
- type RESTClient
- func (c *RESTClient) Delete(ctx context.Context, path string, result interface{}) error
- func (c *RESTClient) Get(ctx context.Context, path string, result interface{}) error
- func (c *RESTClient) Post(ctx context.Context, path string, body interface{}, result interface{}) error
- func (c *RESTClient) Put(ctx context.Context, path string, body interface{}, result interface{}) error
- type SearchClient
- func (c *SearchClient) GetSearchStats(ctx context.Context) (map[string]interface{}, error)
- func (c *SearchClient) GetSupportedModels(ctx context.Context) ([]string, error)
- func (c *SearchClient) SearchByContentID(ctx context.Context, contentID string, options *embedding.SearchOptions) (*embedding.SearchResults, error)
- func (c *SearchClient) SearchByText(ctx context.Context, query string, options *embedding.SearchOptions) (*embedding.SearchResults, error)
- func (c *SearchClient) SearchByVector(ctx context.Context, vector []float32, options *embedding.SearchOptions) (*embedding.SearchResults, error)
- type VectorClient
- func (c *VectorClient) DeleteContextEmbeddings(ctx context.Context, contextID string) error
- func (c *VectorClient) DeleteEmbedding(ctx context.Context, id string) error
- func (c *VectorClient) DeleteModelEmbeddings(ctx context.Context, contextID string, modelID string) error
- func (c *VectorClient) GetContextEmbeddings(ctx context.Context, contextID string) ([]*models.Vector, error)
- func (c *VectorClient) GetEmbedding(ctx context.Context, id string) (*models.Vector, error)
- func (c *VectorClient) GetEmbeddingsByModel(ctx context.Context, contextID string, modelID string) ([]*models.Vector, error)
- func (c *VectorClient) GetSupportedModels(ctx context.Context) ([]string, error)
- func (c *VectorClient) SearchEmbeddings(ctx context.Context, queryEmbedding []float32, contextID string, ...) ([]*models.Vector, error)
- func (c *VectorClient) SearchEmbeddings_Legacy(ctx context.Context, queryEmbedding []float32, contextID string, limit int) ([]*models.Vector, error)
- func (c *VectorClient) StoreEmbedding(ctx context.Context, vector *models.Vector) error
- type WebhookClient
- type WebhookConfig
- type WebhookRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentClient ¶
type AgentClient struct {
// contains filtered or unexported fields
}
AgentClient provides methods for interacting with the Agent API
func NewAgentClient ¶
func NewAgentClient(client *RESTClient) *AgentClient
NewAgentClient creates a new Agent API client
func (*AgentClient) CreateAgent ¶
CreateAgent creates a new agent
func (*AgentClient) DeleteAgent ¶
func (c *AgentClient) DeleteAgent(ctx context.Context, id string) error
DeleteAgent deletes an agent by ID
func (*AgentClient) GetAgentByID ¶
func (c *AgentClient) GetAgentByID(ctx context.Context, id string, tenantID string) (*models.Agent, error)
GetAgentByID retrieves an agent by ID
func (*AgentClient) ListAgents ¶
ListAgents retrieves all agents for a tenant
func (*AgentClient) UpdateAgent ¶
UpdateAgent updates an existing agent
type ClientConfig ¶
type ClientConfig struct { BaseURL string APIKey string Timeout time.Duration Logger observability.Logger }
ClientConfig holds configuration for the REST client
type ContextClient ¶
type ContextClient struct {
// contains filtered or unexported fields
}
ContextClient provides methods for interacting with the Context API
func NewContextClient ¶
func NewContextClient(client *RESTClient, logger observability.Logger) *ContextClient
NewContextClient creates a new ContextClient with the provided client
func (*ContextClient) CreateContext ¶
func (c *ContextClient) CreateContext(ctx context.Context, contextObj *models.Context) (*models.Context, error)
CreateContext creates a new context
func (*ContextClient) DeleteContext ¶
func (c *ContextClient) DeleteContext(ctx context.Context, contextID string) error
DeleteContext deletes a context by ID
func (*ContextClient) GetContext ¶
GetContext retrieves a context by ID
func (*ContextClient) ListContexts ¶
func (c *ContextClient) ListContexts(ctx context.Context, agentID, sessionID string, options map[string]interface{}) ([]*models.Context, error)
ListContexts lists contexts with optional filtering
func (*ContextClient) SearchInContext ¶
func (c *ContextClient) SearchInContext(ctx context.Context, contextID, query string) ([]models.ContextItem, error)
SearchInContext searches for text within a context
func (*ContextClient) SummarizeContext ¶
SummarizeContext generates a summary of a context
func (*ContextClient) UpdateContext ¶
func (c *ContextClient) UpdateContext(ctx context.Context, contextID string, contextObj *models.Context, options *models.ContextUpdateOptions) (*models.Context, error)
UpdateContext updates an existing context
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory provides access to all REST API clients
func NewFactory ¶
func NewFactory(baseURL, apiKey string, logger observability.Logger) *Factory
NewFactory creates a new REST client factory
func (*Factory) Agent ¶
func (f *Factory) Agent() *AgentClient
Agent returns a client for the Agent API
func (*Factory) Client ¶
func (f *Factory) Client() *RESTClient
Client returns the underlying REST client
func (*Factory) Model ¶
func (f *Factory) Model() *ModelClient
Model returns a client for the Model API
func (*Factory) NewContextClient ¶
func (f *Factory) NewContextClient(logger observability.Logger) *ContextClient
NewContextClient creates a new client for the Context API
func (*Factory) NewSearchClient ¶
func (f *Factory) NewSearchClient(logger observability.Logger) *SearchClient
NewSearchClient creates a new client for the Search API
func (*Factory) Vector ¶
func (f *Factory) Vector() *VectorClient
Vector returns a client for the Vector API
type ModelClient ¶
type ModelClient struct {
// contains filtered or unexported fields
}
ModelClient provides methods for interacting with the Model API
func NewModelClient ¶
func NewModelClient(client *RESTClient) *ModelClient
NewModelClient creates a new Model API client
func (*ModelClient) CreateModel ¶
CreateModel creates a new model
func (*ModelClient) DeleteModel ¶
func (c *ModelClient) DeleteModel(ctx context.Context, id string) error
DeleteModel deletes a model by ID
func (*ModelClient) GetModelByID ¶
GetModelByID retrieves a model by ID
func (*ModelClient) ListModels ¶
ListModels retrieves all models
func (*ModelClient) UpdateModel ¶
UpdateModel updates an existing model
type RESTClient ¶
type RESTClient struct {
// contains filtered or unexported fields
}
RESTClient is a client for the REST API
func NewRESTClient ¶
func NewRESTClient(config ClientConfig) *RESTClient
NewRESTClient creates a new REST API client
func (*RESTClient) Delete ¶
func (c *RESTClient) Delete(ctx context.Context, path string, result interface{}) error
Delete performs a DELETE request
func (*RESTClient) Get ¶
func (c *RESTClient) Get(ctx context.Context, path string, result interface{}) error
Get performs a GET request
type SearchClient ¶
type SearchClient struct {
// contains filtered or unexported fields
}
SearchClient provides methods for vector search operations
func NewSearchClient ¶
func NewSearchClient(client *RESTClient, logger observability.Logger) *SearchClient
NewSearchClient creates a new SearchClient with the provided client
func (*SearchClient) GetSearchStats ¶
func (c *SearchClient) GetSearchStats(ctx context.Context) (map[string]interface{}, error)
GetSearchStats retrieves statistics about the search index
func (*SearchClient) GetSupportedModels ¶
func (c *SearchClient) GetSupportedModels(ctx context.Context) ([]string, error)
GetSupportedModels retrieves a list of all models with embeddings
func (*SearchClient) SearchByContentID ¶
func (c *SearchClient) SearchByContentID(ctx context.Context, contentID string, options *embedding.SearchOptions) (*embedding.SearchResults, error)
SearchByContentID performs a "more like this" search using an existing content ID
func (*SearchClient) SearchByText ¶
func (c *SearchClient) SearchByText(ctx context.Context, query string, options *embedding.SearchOptions) (*embedding.SearchResults, error)
SearchByText performs a vector search using text query
func (*SearchClient) SearchByVector ¶
func (c *SearchClient) SearchByVector(ctx context.Context, vector []float32, options *embedding.SearchOptions) (*embedding.SearchResults, error)
SearchByVector performs a vector search using a pre-computed vector
type VectorClient ¶
type VectorClient struct {
// contains filtered or unexported fields
}
VectorClient provides methods for interacting with the Vector API
func NewVectorClient ¶
func NewVectorClient(client *RESTClient) *VectorClient
NewVectorClient creates a new Vector API client
func (*VectorClient) DeleteContextEmbeddings ¶
func (c *VectorClient) DeleteContextEmbeddings(ctx context.Context, contextID string) error
DeleteContextEmbeddings deletes all embeddings for a context
func (*VectorClient) DeleteEmbedding ¶
func (c *VectorClient) DeleteEmbedding(ctx context.Context, id string) error
DeleteEmbedding deletes a single embedding by ID
func (*VectorClient) DeleteModelEmbeddings ¶
func (c *VectorClient) DeleteModelEmbeddings(ctx context.Context, contextID string, modelID string) error
DeleteModelEmbeddings deletes all embeddings for a context and model
func (*VectorClient) GetContextEmbeddings ¶
func (c *VectorClient) GetContextEmbeddings(ctx context.Context, contextID string) ([]*models.Vector, error)
GetContextEmbeddings retrieves all embeddings for a context
func (*VectorClient) GetEmbedding ¶
GetEmbedding retrieves a single embedding by ID
func (*VectorClient) GetEmbeddingsByModel ¶
func (c *VectorClient) GetEmbeddingsByModel(ctx context.Context, contextID string, modelID string) ([]*models.Vector, error)
GetEmbeddingsByModel retrieves all embeddings for a context and model
func (*VectorClient) GetSupportedModels ¶
func (c *VectorClient) GetSupportedModels(ctx context.Context) ([]string, error)
GetSupportedModels retrieves all supported models
func (*VectorClient) SearchEmbeddings ¶
func (c *VectorClient) SearchEmbeddings(ctx context.Context, queryEmbedding []float32, contextID string, modelID string, limit int, threshold float64) ([]*models.Vector, error)
SearchEmbeddings searches for similar embeddings
func (*VectorClient) SearchEmbeddings_Legacy ¶
func (c *VectorClient) SearchEmbeddings_Legacy(ctx context.Context, queryEmbedding []float32, contextID string, limit int) ([]*models.Vector, error)
SearchEmbeddings_Legacy is a legacy method that searches for similar embeddings without model ID
func (*VectorClient) StoreEmbedding ¶
StoreEmbedding stores a vector embedding
type WebhookClient ¶
type WebhookClient struct {
// contains filtered or unexported fields
}
WebhookClient handles webhook processing through the REST API
func NewWebhookClient ¶
func NewWebhookClient(client *RESTClient, config WebhookConfig, logger observability.Logger) *WebhookClient
NewWebhookClient creates a new WebhookClient with the given configuration
func (*WebhookClient) ProcessWebhook ¶
func (c *WebhookClient) ProcessWebhook(ctx context.Context, provider string, headers http.Header, body []byte) error
ProcessWebhook handles an incoming webhook request
func (*WebhookClient) ValidateIP ¶
func (c *WebhookClient) ValidateIP(ctx context.Context, provider string, ipAddress string) (bool, error)
ValidateIP checks if the given IP is allowed to send webhooks