Documentation
¶
Index ¶
- func GetKeyAuthConfig(apiKeys []string) (*v2keyauth.Config, error)
- func Reverse[T any](original []T) (reversed []T)
- type AgentRole
- type App
- func (a *App) AddGitRepo(c *fiber.Ctx) error
- func (a *App) Chat(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (app *App) CollectionsRAGProvider() func(collectionName string) (agent.RAGDB, state.KBCompactionClient, bool)
- func (a *App) Create(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) CreateGroup(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) CreateSkill(c *fiber.Ctx) error
- func (a *App) CreateSkillResource(c *fiber.Ctx) error
- func (a *App) Delete(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) DeleteGitRepo(c *fiber.Ctx) error
- func (a *App) DeleteSkill(c *fiber.Ctx) error
- func (a *App) DeleteSkillResource(c *fiber.Ctx) error
- func (app *App) ExecuteAction(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) ExportAgent(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) ExportSkill(c *fiber.Ctx) error
- func (a *App) GenerateGroupProfiles(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) GetActionDefinition(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) GetAgentConfig(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) GetAgentConfigMeta(customDirectory string) func(c *fiber.Ctx) error
- func (a *App) GetSkill(c *fiber.Ctx) error
- func (a *App) GetSkillResource(c *fiber.Ctx) error
- func (a *App) GetSkillsConfig(c *fiber.Ctx) error
- func (a *App) ImportAgent(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) ImportSkill(c *fiber.Ctx) error
- func (a *App) ListActions() func(c *fiber.Ctx) error
- func (a *App) ListGitRepos(c *fiber.Ctx) error
- func (a *App) ListSkillResources(c *fiber.Ctx) error
- func (a *App) ListSkills(c *fiber.Ctx) error
- func (a *App) Notify(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) OldChat(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) Pause(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (app *App) RegisterCollectionRoutes(webapp *fiber.App, cfg *Config, backend CollectionsBackend)
- func (a *App) Responses(pool *state.AgentPool, tracker *conversations.ConversationTracker[string]) func(c *fiber.Ctx) error
- func (a *App) SearchSkills(c *fiber.Ctx) error
- func (a *App) Start(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) SyncGitRepo(c *fiber.Ctx) error
- func (a *App) ToggleGitRepo(c *fiber.Ctx) error
- func (a *App) UpdateAgentConfig(pool *state.AgentPool) func(c *fiber.Ctx) error
- func (a *App) UpdateGitRepo(c *fiber.Ctx) error
- func (a *App) UpdateSkill(c *fiber.Ctx) error
- func (a *App) UpdateSkillResource(c *fiber.Ctx) error
- type CollectionSearchResult
- type CollectionSourceInfo
- type CollectionsBackend
- type Config
- type Option
- func WithApiKeys(keys ...string) Option
- func WithChunkOverlap(overlap int) Option
- func WithCollectionDBPath(path string) Option
- func WithConversationStoreduration(duration string) Option
- func WithCustomActionsDir(dir string) Option
- func WithDatabaseURL(url string) Option
- func WithDefaultChunkSize(size int) Option
- func WithEmbeddingModel(model string) Option
- func WithFileAssets(path string) Option
- func WithLLMAPIKey(key string) Option
- func WithLLMAPIUrl(url string) Option
- func WithLLMModel(model string) Option
- func WithLocalRAGURL(url string) Option
- func WithMaxChunkingSize(size int) Option
- func WithPool(pool *state.AgentPool) Option
- func WithSkillsService(svc *skills.Service) Option
- func WithStateDir(dir string) Option
- func WithVectorEngine(engine string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
func (*App) Chat ¶
Chat provides a JSON-based API for chat functionality This is designed to work better with the React UI
func (*App) CollectionsRAGProvider ¶
func (app *App) CollectionsRAGProvider() func(collectionName string) (agent.RAGDB, state.KBCompactionClient, bool)
CollectionsRAGProvider returns a provider that the pool can use when no LocalRAG URL is set. It returns (RAGDB, KBCompactionClient, true) for a collection name, creating the collection on first use if needed.
func (*App) ExecuteAction ¶
func (*App) GenerateGroupProfiles ¶
func (*App) GetActionDefinition ¶
func (*App) GetAgentConfig ¶
NEW FUNCTION: Get agent configuration
func (*App) GetAgentConfigMeta ¶
GetAgentConfigMeta returns the metadata for agent configuration fields
func (*App) ListGitRepos ¶
Git repos: list, add, update, delete, sync, toggle (using ConfigManager in skills dir)
func (*App) RegisterCollectionRoutes ¶
func (app *App) RegisterCollectionRoutes(webapp *fiber.App, cfg *Config, backend CollectionsBackend)
RegisterCollectionRoutes mounts /api/collections* routes. backend is either from NewInProcessCollectionsBackend or NewCollectionsBackendHTTP.
func (*App) Responses ¶
func (a *App) Responses(pool *state.AgentPool, tracker *conversations.ConversationTracker[string]) func(c *fiber.Ctx) error
func (*App) UpdateAgentConfig ¶
UpdateAgentConfig handles updating an agent's configuration
type CollectionSearchResult ¶
type CollectionSearchResult struct {
Content string `json:"content"`
Metadata map[string]string `json:"metadata,omitempty"`
ID string `json:"id,omitempty"`
Similarity float32 `json:"similarity,omitempty"`
}
CollectionSearchResult is a single search result (content + metadata) for API responses.
type CollectionSourceInfo ¶
type CollectionSourceInfo struct {
URL string `json:"url"`
UpdateInterval int `json:"update_interval"` // minutes
LastUpdate time.Time `json:"last_update"`
}
CollectionSourceInfo is a single external source for a collection.
type CollectionsBackend ¶
type CollectionsBackend interface {
ListCollections() ([]string, error)
CreateCollection(name string) error
Upload(collection, filename string, fileBody io.Reader) error
ListEntries(collection string) ([]string, error)
GetEntryContent(collection, entry string) (content string, chunkCount int, err error)
Search(collection, query string, maxResults int) ([]CollectionSearchResult, error)
Reset(collection string) error
DeleteEntry(collection, entry string) (remainingEntries []string, err error)
AddSource(collection, url string, intervalMin int) error
RemoveSource(collection, url string) error
ListSources(collection string) ([]CollectionSourceInfo, error)
// EntryExists is used by upload handler to avoid duplicate entries.
EntryExists(collection, entry string) bool
}
CollectionsBackend is the interface used by REST handlers for collection operations. It is implemented by in-process state (embedded) or by an HTTP client (when LocalRAG URL is set).
func NewCollectionsBackendHTTP ¶
func NewCollectionsBackendHTTP(client *localrag.Client) CollectionsBackend
NewCollectionsBackendHTTP returns a CollectionsBackend that delegates to the given HTTP client.
func NewInProcessCollectionsBackend ¶
func NewInProcessCollectionsBackend(cfg *Config) (CollectionsBackend, *collectionsState)
NewInProcessCollectionsBackend creates in-process state (load from disk, start sourceManager) and returns a CollectionsBackend and the state. The caller should set app.collectionsState = state for RAG provider.
type Config ¶
type Config struct {
DefaultChunkSize int
Pool *state.AgentPool
SkillsService *skills.Service
ApiKeys []string
LLMAPIURL string
LLMAPIKey string
LLMModel string
StateDir string
CustomActionsDir string
ConversationStoreDuration time.Duration
// Collections / knowledge base (LocalRecall)
CollectionDBPath string
FileAssets string
VectorEngine string
EmbeddingModel string
MaxChunkingSize int
ChunkOverlap int
DatabaseURL string
// LocalRAGURL when set uses HTTP backend for collections API; when empty uses in-process backend.
LocalRAGURL string
}
type Option ¶
type Option func(*Config)