Documentation
¶
Overview ¶
Package worker provides an asynchronous worker pool and utils for persisting conversation turns using the provided storage.Driver and generating embeddings using the provided embeddings.Embedder.
The pool decouples storage operations from the proxy's HTTP hot path so that the client-proxy-upstream interaction is fully transparent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Driver is the storage backend for persisting nodes.
Driver storage.Driver
// VectorDriver is the optional vector store driver for embeddings.
VectorDriver vector.Driver
// Embedder generates optional text embeddings.
// A configured Embedder is required if VectorDriver is set.
Embedder embeddings.Embedder
// NumWorkers is the number of background workers in the pool.
NumWorkers uint
// QueueSize is the capacity of the buffered job channel (defaults to 256).
QueueSize uint
// Project is the git repository or project name to tag on stored nodes.
Project string
// Logger is the provided logger
Logger *slog.Logger
}
Config is the configuration options for the worker pool.
type Job ¶
type Job struct {
Provider string
AgentName string
Req *llm.ChatRequest
Resp *llm.ChatResponse
}
Job is a unit of work for the worker pool to execute against.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool processes storage jobs asynchronously via a worker pool.
Click to show internal directories.
Click to hide internal directories.