Documentation ¶
Index ¶
- Constants
- Variables
- type AIOperationType
- type AIUsage
- type AnalyticsOverview
- type AppSettings
- type ContentPart
- type ContextKey
- type Conversation
- type DataSource
- type DatasourceConfig
- type DatasourceInfo
- type DatasourcePayload
- type DatasourceSettings
- type DatasourceState
- type DatasourceStatus
- type DatasourceType
- type DatasourcesOverview
- type DebuggingSettings
- type Document
- type DocumentFilter
- type DocumentFilterOption
- type DocumentStatus
- type Embedding
- type EmbeddingProviderConfig
- type EmbeddingProviderFilter
- type EmbeddingProviderFilterOption
- type EmbeddingProviderSettings
- type EmbeddingProviderType
- type EmbeddingProvidersOverview
- type ErrorResponse
- type GeneralSettings
- type GenerateResponseMsg
- type GitHubSettings
- type Interaction
- type InteractionRole
- type LLMProviderConfig
- type LLMProviderFilter
- type LLMProviderFilterOption
- type LLMProviderSettings
- type LLMProviderStatus
- type LLMProviderType
- type LLMProvidersOverview
- type LogFormat
- type LogLevel
- type LogOutput
- type Metadata
- type NoOpLLMProviderSettings
- type NoOpSettings
- type OAuthUserInfo
- type OpenAILLMSettings
- type OpenAISettings
- type PaginatedDatasources
- type PaginatedDocuments
- type PaginatedEmbeddingProviders
- type PaginatedInteractions
- type PaginatedLLMProviders
- type PaginatedUsers
- type ProviderInfo
- type SearchConfig
- type SearchResults
- type SearchResultsDocument
- type SearchSettings
- type Settings
- type SlackSettings
- type SlackState
- type Source
- type State
- type User
- type UserFilter
- type UserFilterOption
- type UserRole
- type UserStatus
- type ValidationError
Constants ¶
View Source
const ( APiAccessOpsDatasourceAdd = "datasource:add" APiAccessOpsDatasourceGet = "datasource:get" APiAccessOpsDatasourceUpdate = "datasource:update" APiAccessOpsDatasourceActivate = "datasource:activate" APiAccessOpsDatasourceDeactivate = "datasource:deactivate" APiAccessOpsDatasourceDelete = "datasource:delete" APiAccessOpsDocumentsGet = "documents:get" APiAccessOpsDocumentGet = "document:get" APIAccessOpsEmbeddingProvidersGet = "embedding_providers:get" APIAccessOpsEmbeddingProviderGet = "embedding_provider:get" APIAccessOpsEmbeddingProviderDelete = "embedding_provider:delete" APIAccessOpsEmbeddingProviderUpdate = "embedding_provider:update" APIAccessOpsEmbeddingProviderActivate = "embedding_provider:activate" APIAccessOpsEmbeddingProviderDeactivate = "embedding_provider:deactivate" APIAccessOpsLLMProvidersGet = "llm_providers:get" APIAccessOpsLLMProviderGet = "llm_provider:get" APIAccessOpsLLMProviderDelete = "llm_provider:delete" APIAccessOpsLLMProviderUpdate = "llm_provider:update" APIAccessOpsLLMProviderActivate = "llm_provider:activate" APIAccessOpsLLMProviderDeactivate = "llm_provider:deactivate" APIAccessOpsInteractionCreate = "interaction:create" APIAccessOpsInteractionsGet = "interactions:get" APIAccessOpsInteractionGet = "interaction:get" APIAccessOpsMessageSend = "message:send" APiAccessOpsSearchSearch = "search:search" APiAccessOpsSettingsGet = "settings:get" APiAccessOpsSettingsUpdate = "settings:update" )
View Source
const ( DatasourceTypeSlack DatasourceType = "slack" DatasourceValidationMsgNameIsRequired = "name is required" DatasourceValidationMsgSourceTypeIsRequired = "source_type is required" )
View Source
const ( LLMProviderTypeOpenAI LLMProviderType = "openai" LLMProviderTypeNoOps LLMProviderType = "noop" InteractionRoleUser InteractionRole = "user" LLMProviderStatusActive LLMProviderStatus = "active" LLMProviderStatusInactive LLMProviderStatus = "inactive" )
View Source
const ( UserStatusActive UserStatus = "active" UserStatusInactive UserStatus = "inactive" UserRoleAdmin UserRole = "admin" UserRoleUser UserRole = "user" UserRoleDeveloper UserRole = "developer" AuthenticatedUserCtxKey = "authenticated_user" UserDetailsCtxKey ContextKey = "user_details" AnonymousUserUUID = "00000000-0000-0000-0000-000000000000" )
View Source
const (
DatasourceDeletedSuccessfullyMsg = "Datasource has been deleted successfully"
)
View Source
const DatasourceNotFoundMsg = "Datasource not found"
View Source
const FailedToSetDatasourceActiveMsg = "Failed to set datasource active"
View Source
const InvalidUUIDMessage = "Invalid UUID"
Variables ¶
View Source
var ErrEmbeddingProviderNotFound = errors.New("embedding provider not found")
View Source
var ErrLLMProviderNotFound = errors.New("LLM provider not found")
View Source
var UserNotFoundError = errors.New("user not found")
Functions ¶
This section is empty.
Types ¶
type AIOperationType ¶
type AIOperationType string
type AIUsage ¶
type AIUsage struct { OpsProviderID uuid.UUID `db:"ops_provider_id"` DocumentID uuid.UUID `db:"document_id"` InputTokens int32 `db:"input_tokens"` OutputTokens int32 `db:"output_tokens"` Dimensions int32 `db:"dimensions"` OperationType string `db:"operation_type"` CostPerThousandsToken float64 `db:"cost_per_thousands_token"` CreatedAt time.Time `db:"created_at"` TotalLatency float64 `db:"total_latency"` }
type AnalyticsOverview ¶
type AnalyticsOverview struct { EmbeddingProviders EmbeddingProvidersOverview `json:"embedding_providers"` LLMProviders LLMProvidersOverview `json:"llm_providers"` Datasources DatasourcesOverview `json:"datasources"` }
type AppSettings ¶
type ContentPart ¶
type ContentPart struct { Content string `json:"content"` Embedding []float32 `json:"embedding"` EmbeddingProviderUUID uuid.UUID `json:"embedding_provider_uuid"` EmbeddingPromptTotalToken int32 `json:"embedding_prompt_token"` GeneratedAt time.Time `json:"generated_at"` }
func NewContentPart ¶
type ContextKey ¶
type ContextKey string
type Conversation ¶
type DataSource ¶
type DataSource interface { GetID() uuid.UUID GetData(ctx context.Context, currentState DatasourceState) ([]Document, DatasourceState, error) Validate() error }
type DatasourceConfig ¶
type DatasourceConfig struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Status DatasourceStatus `json:"status"` SourceType DatasourceType `json:"source_type"` Settings DatasourceSettings `json:"settings"` State DatasourceState `json:"state"` }
func (*DatasourceConfig) MarshalJSON ¶
func (dc *DatasourceConfig) MarshalJSON() ([]byte, error)
func (*DatasourceConfig) UnmarshalJSON ¶
func (dc *DatasourceConfig) UnmarshalJSON(data []byte) error
type DatasourceInfo ¶
type DatasourcePayload ¶
type DatasourcePayload struct { Name string `json:"name"` SourceType DatasourceType `json:"source_type"` Settings json.RawMessage `json:"settings"` }
type DatasourceSettings ¶
type DatasourceSettings interface {
Validate() error
}
type DatasourceState ¶
type DatasourceState interface {
Validate() error
}
func ParseDatasourceStateFromRawJSON ¶
func ParseDatasourceStateFromRawJSON(sourceType DatasourceType, data json.RawMessage) (DatasourceState, error)
type DatasourceStatus ¶
type DatasourceStatus string
const ( DatasourceStatusInactive DatasourceStatus = "inactive" DatasourceStatusActive DatasourceStatus = "active" )
type DatasourceType ¶
type DatasourceType string
type DatasourcesOverview ¶
type DatasourcesOverview struct { ConfiguredDatasources []DatasourceInfo `json:"configured_datasources"` TotalDatasources int `json:"total_datasources"` TotalDatasourcesByType map[string]int `json:"total_datasources_by_type"` TotalDatasourcesByStatus map[string]int `json:"total_datasources_by_status"` TotalDocumentsFetchedByDatasourceType map[string]int `json:"total_documents_fetched_by_datasource_type"` }
type DebuggingSettings ¶
type Document ¶
type Document struct { UUID uuid.UUID `json:"uuid"` URL *url.URL `json:"-"` Title string `json:"title"` Body string `json:"body"` Embedding Embedding `json:"embedding"` Metadata []Metadata `json:"metadata"` Status DocumentStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` FetchedAt time.Time `json:"fetched_at"` Source Source `json:"source"` }
func (*Document) MarshalJSON ¶
type DocumentFilter ¶
type DocumentFilter struct { UUID string Status DocumentStatus SourceUUID string }
type DocumentFilterOption ¶
type DocumentStatus ¶
type DocumentStatus string
const DocumentStatusErrorProcessing DocumentStatus = "error_processing"
const DocumentStatusPending DocumentStatus = "pending"
const DocumentStatusProcessing DocumentStatus = "processing"
const DocumentStatusReadyToSearch DocumentStatus = "ready_to_search"
type Embedding ¶
type Embedding struct {
Embedding []ContentPart `json:"embedding"`
}
type EmbeddingProviderConfig ¶
type EmbeddingProviderConfig struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Provider EmbeddingProviderType `json:"provider"` Configuration EmbeddingProviderSettings `json:"configuration"` Status string `json:"status"` }
func (*EmbeddingProviderConfig) MarshalJSON ¶
func (c *EmbeddingProviderConfig) MarshalJSON() ([]byte, error)
func (*EmbeddingProviderConfig) UnmarshalJSON ¶
func (c *EmbeddingProviderConfig) UnmarshalJSON(data []byte) error
type EmbeddingProviderFilter ¶
type EmbeddingProviderFilter struct {
Status string `json:"status"`
}
type EmbeddingProviderSettings ¶
type EmbeddingProviderSettings interface { Validate() error RawJSON() json.RawMessage ToMap() map[string]interface{} }
func ParseEmbeddingProviderSettings ¶
func ParseEmbeddingProviderSettings(providerType EmbeddingProviderType, settingsJSON json.RawMessage) (EmbeddingProviderSettings, error)
type EmbeddingProviderType ¶
type EmbeddingProviderType string
const ( EmbeddingProviderTypeOpenAI EmbeddingProviderType = "openai" EmbeddingProviderTypeNoOp EmbeddingProviderType = "noop" )
type EmbeddingProvidersOverview ¶
type EmbeddingProvidersOverview struct { TotalProviders int `json:"total_providers"` TotalActiveProviders int `json:"total_active_providers"` ActiveProvider ProviderInfo `json:"active_provider"` }
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
type GeneralSettings ¶
type GeneralSettings struct {
ApplicationName string `json:"application_name"`
}
type GenerateResponseMsg ¶
type GenerateResponseMsg struct {
Message string `json:"message"`
}
type GitHubSettings ¶
type GitHubSettings struct {
Org string `json:"org"`
}
func (GitHubSettings) Validate ¶
func (s GitHubSettings) Validate() error
type Interaction ¶
type InteractionRole ¶
type InteractionRole string
type LLMProviderConfig ¶
type LLMProviderConfig struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Provider LLMProviderType `json:"provider"` Configuration LLMProviderSettings `json:"configuration"` Status string `json:"status"` }
func (*LLMProviderConfig) MarshalJSON ¶
func (c *LLMProviderConfig) MarshalJSON() ([]byte, error)
func (*LLMProviderConfig) UnmarshalJSON ¶
func (c *LLMProviderConfig) UnmarshalJSON(data []byte) error
type LLMProviderFilter ¶
type LLMProviderFilter struct {
Status string `json:"status"`
}
type LLMProviderFilterOption ¶
type LLMProviderSettings ¶
type LLMProviderSettings interface { Validate() error RawJSON() json.RawMessage ToMap() map[string]interface{} }
func ParseLLMProviderSettings ¶
func ParseLLMProviderSettings(providerType LLMProviderType, settingsJSON json.RawMessage) (LLMProviderSettings, error)
type LLMProviderStatus ¶
type LLMProviderStatus string
type LLMProviderType ¶
type LLMProviderType string
type LLMProvidersOverview ¶
type LLMProvidersOverview struct { TotalProviders int `json:"total_providers"` TotalActiveProviders int `json:"total_active_providers"` ActiveProvider ProviderInfo `json:"active_provider"` }
type NoOpLLMProviderSettings ¶
type NoOpLLMProviderSettings struct { ResponseToReturn string `json:"response_to_return"` HealthCheckError *error `json:"health_check_error,omitempty"` }
func (*NoOpLLMProviderSettings) RawJSON ¶
func (s *NoOpLLMProviderSettings) RawJSON() json.RawMessage
func (*NoOpLLMProviderSettings) ToMap ¶
func (s *NoOpLLMProviderSettings) ToMap() map[string]interface{}
func (*NoOpLLMProviderSettings) Validate ¶
func (s *NoOpLLMProviderSettings) Validate() error
type NoOpSettings ¶
type NoOpSettings struct {
ContentParts []ContentPart
}
func (*NoOpSettings) RawJSON ¶
func (s *NoOpSettings) RawJSON() json.RawMessage
func (*NoOpSettings) ToMap ¶
func (s *NoOpSettings) ToMap() map[string]interface{}
func (*NoOpSettings) Validate ¶
func (s *NoOpSettings) Validate() error
type OAuthUserInfo ¶
type OAuthUserInfo struct { ID string `json:"id"` Email string `json:"email"` Name string `json:"name"` }
OAuthUserInfo represents the structure of user info from an OAuth provider
type OpenAILLMSettings ¶
func (*OpenAILLMSettings) RawJSON ¶
func (s *OpenAILLMSettings) RawJSON() json.RawMessage
func (*OpenAILLMSettings) ToMap ¶
func (s *OpenAILLMSettings) ToMap() map[string]interface{}
func (*OpenAILLMSettings) Validate ¶
func (s *OpenAILLMSettings) Validate() error
type OpenAISettings ¶
type OpenAISettings struct { APIKey string `json:"api_key"` ModelID string `json:"model_id"` APIEndpoint string `json:"api_endpoint,omitempty"` }
func (*OpenAISettings) RawJSON ¶
func (s *OpenAISettings) RawJSON() json.RawMessage
func (*OpenAISettings) ToMap ¶
func (s *OpenAISettings) ToMap() map[string]interface{}
func (*OpenAISettings) Validate ¶
func (s *OpenAISettings) Validate() error
type PaginatedDatasources ¶
type PaginatedDatasources struct { Datasources []DatasourceConfig `json:"datasources"` Total int `json:"total"` Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_pages"` }
func (*PaginatedDatasources) UnmarshalJSON ¶
func (pd *PaginatedDatasources) UnmarshalJSON(data []byte) error
type PaginatedDocuments ¶
type PaginatedEmbeddingProviders ¶
type PaginatedEmbeddingProviders struct { EmbeddingProviders []EmbeddingProviderConfig `json:"embedding_providers"` Total int `json:"total"` Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_pages"` }
type PaginatedInteractions ¶
type PaginatedInteractions struct { Interactions []Interaction `json:"interactions"` Total int `json:"total"` Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_pages"` }
type PaginatedLLMProviders ¶
type PaginatedLLMProviders struct { LLMProviders []LLMProviderConfig `json:"llm_providers"` Total int `json:"total"` Page int `json:"page"` PerPage int `json:"per_page"` TotalPages int `json:"total_pages"` }
type PaginatedUsers ¶
type ProviderInfo ¶
type SearchConfig ¶
type SearchResults ¶
type SearchResultsDocument ¶
type SearchSettings ¶
type SearchSettings struct {
PerPage int `json:"per_page"`
}
type Settings ¶
type Settings struct { General GeneralSettings `json:"general"` Debugging DebuggingSettings `json:"debugging"` Search SearchSettings `json:"search"` }
type SlackSettings ¶
type SlackSettings struct { Token string `json:"token"` ChannelID string `json:"channel_id"` Workspace string `json:"workspace"` }
func (*SlackSettings) Validate ¶
func (s *SlackSettings) Validate() error
type SlackState ¶
type SlackState struct { Type string `json:"type,omitempty"` NextCursor string `json:"next_cursor,omitempty"` LastThreadTimestamp string `json:"last_thread_timestamp,omitempty"` }
func (*SlackState) MarshalJSON ¶
func (s *SlackState) MarshalJSON() ([]byte, error)
func (*SlackState) UnmarshalJSON ¶
func (s *SlackState) UnmarshalJSON(data []byte) error
func (*SlackState) Validate ¶
func (s *SlackState) Validate() error
type Source ¶
type Source struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` SourceType DatasourceType `json:"type"` }
type State ¶
type State struct {
Data DatasourceState
}
func (*State) MarshalJSON ¶
func (*State) UnmarshalJSON ¶
type User ¶
type User struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Email string `json:"email"` Status UserStatus `json:"status"` Roles []UserRole `json:"roles"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func DefaultAnonymousUser ¶
func DefaultAnonymousUser() *User
DefaultAnonymousUser returns a pointer to a copy of the anonymous User
func GetAuthenticatedUser ¶
GetAuthenticatedUser safely retrieves the authenticated user from the context If the user is not found or is nil, it returns the anonymous user
type UserFilter ¶
type UserFilter struct { NameContains string `json:"name"` EmailContains string `json:"email"` Status UserStatus `json:"status"` Roles []UserRole `json:"roles"` }
type UserFilterOption ¶
type UserStatus ¶
type UserStatus string
type ValidationError ¶
type ValidationError struct {
Message string
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.