Documentation
¶
Overview ¶
Package common holds shared configuration and agent options for the agent_with_retriever examples.
Index ¶
- func AgentOptions(cfg *excfg.Config, llmClient interfaces.LLMClient, log logger.Logger, ...) []agent.Option
- func ModeHint(mode agent.RetrieverMode) string
- func OpenAIEmbedFunc(settings *Settings) (pgretriever.EmbedFunc, error)
- func ParseRetrieverMode(raw string) (agent.RetrieverMode, error)
- func ValidateEmbeddingConfig(settings *Settings) error
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentOptions ¶
func AgentOptions( cfg *excfg.Config, llmClient interfaces.LLMClient, log logger.Logger, settings *Settings, backendLabel string, ) []agent.Option
AgentOptions builds shared agent options: runtime, LLM, retriever mode, and system prompt. backendLabel is shown in the agent name/description (e.g. "weaviate" or "pgvector").
func ModeHint ¶
func ModeHint(mode agent.RetrieverMode) string
ModeHint returns a short phrase describing how the current mode uses retrievers.
func OpenAIEmbedFunc ¶
func OpenAIEmbedFunc(settings *Settings) (pgretriever.EmbedFunc, error)
OpenAIEmbedFunc returns an pgretriever.EmbedFunc that calls an OpenAI-compatible embeddings API.
func ParseRetrieverMode ¶
func ParseRetrieverMode(raw string) (agent.RetrieverMode, error)
ParseRetrieverMode maps env text to agent.RetrieverMode.
func ValidateEmbeddingConfig ¶
ValidateEmbeddingConfig ensures pgvector can call an OpenAI-compatible embeddings API. Requires EMBEDDING_OPENAI_APIKEY (separate from chat LLM_APIKEY).
Types ¶
type Settings ¶
type Settings struct {
// RetrieverMode is agentic, prefetch, or hybrid (see agent.WithRetrieverMode).
RetrieverMode agent.RetrieverMode
// Weaviate
WeaviateHost string
WeaviateScheme string
WeaviateClass string
WeaviateRetrieverName string
WeaviateContentField string
WeaviateSourceField string
WeaviateTopK int
WeaviateMinScore float64
// PostgreSQL / pgvector
PGDSN string
PGTable string
PGContentCol string
PGSourceCol string
PGEmbeddingCol string
PGRetrieverName string
PGTopK int
PGMinScore float64
EmbeddingModel string
EmbeddingBaseURL string
EmbeddingAPIKey string
}
Settings holds env-driven values shared by the weaviate and pgvector example entry points.
func LoadSettings ¶
LoadSettings reads retriever example env vars. LLM and Temporal vars come from examples/config.LoadFromEnv.