Documentation
¶
Index ¶
- Constants
- func BuildDistillationPrompt(manifest RawManifest) string
- func CompactDescriptionForTest(description string) string
- type Cache
- type Compactor
- func (c *Compactor) Compact(ctx context.Context, manifest RawManifest) (*DistilledManifest, error)
- func (c *Compactor) CompactWithFallback(ctx context.Context, manifest RawManifest) (*DistilledManifest, error)
- func (c *Compactor) InvalidateCache(ctx context.Context, serverName string) error
- func (c *Compactor) IsEnabled() bool
- type CompactorConfig
- type Config
- type DistilledManifest
- type DistilledTool
- type FileCache
- type LLMClient
- type ManifestProcessor
- type NoOpCache
- type OpenAIClient
- type OpenAIClientConfig
- type RawManifest
- type RawTool
Constants ¶
View Source
const SystemPrompt = `` /* 275-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func BuildDistillationPrompt ¶
func BuildDistillationPrompt(manifest RawManifest) string
Types ¶
type Compactor ¶
type Compactor struct {
// contains filtered or unexported fields
}
func NewCompactor ¶
func (*Compactor) Compact ¶
func (c *Compactor) Compact(ctx context.Context, manifest RawManifest) (*DistilledManifest, error)
func (*Compactor) CompactWithFallback ¶
func (c *Compactor) CompactWithFallback(ctx context.Context, manifest RawManifest) (*DistilledManifest, error)
func (*Compactor) InvalidateCache ¶
type CompactorConfig ¶
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled"`
LLMProvider string `yaml:"llm_provider"`
LLMEndpoint string `yaml:"llm_endpoint"`
LLMAPIKey string `yaml:"llm_api_key"`
LLMModel string `yaml:"llm_model"`
CacheDir string `yaml:"cache_dir"`
}
func LoadConfig ¶
type DistilledManifest ¶
type DistilledManifest struct {
ServerName string `json:"server_name"`
Tools []DistilledTool `json:"tools"`
OriginalHash string `json:"original_hash"`
DistilledAt time.Time `json:"distilled_at"`
}
func (DistilledManifest) TokenReduction ¶
func (d DistilledManifest) TokenReduction(originalTokenCount int) float64
type DistilledTool ¶
type DistilledTool struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters json.RawMessage `json:"parameters"`
}
type FileCache ¶
type FileCache struct {
// contains filtered or unexported fields
}
func (*FileCache) Invalidate ¶
type LLMClient ¶
type LLMClient interface {
Distill(ctx context.Context, manifest RawManifest) (*DistilledManifest, error)
}
type ManifestProcessor ¶
type ManifestProcessor struct {
// contains filtered or unexported fields
}
func NewManifestProcessor ¶
func NewManifestProcessor(logger *slog.Logger) *ManifestProcessor
func (*ManifestProcessor) Process ¶
func (m *ManifestProcessor) Process(ctx context.Context, raw RawManifest) (*DistilledManifest, error)
type NoOpCache ¶
type NoOpCache struct{}
func NewNoOpCache ¶
func NewNoOpCache() *NoOpCache
func (*NoOpCache) Invalidate ¶
type OpenAIClient ¶
type OpenAIClient struct {
// contains filtered or unexported fields
}
func NewOpenAIClient ¶
func NewOpenAIClient(cfg OpenAIClientConfig, logger *slog.Logger) *OpenAIClient
func (*OpenAIClient) Distill ¶
func (c *OpenAIClient) Distill(ctx context.Context, manifest RawManifest) (*DistilledManifest, error)
type OpenAIClientConfig ¶
type RawManifest ¶
type RawManifest struct {
Name string `json:"name"`
Description string `json:"description"`
Tools []RawTool `json:"tools"`
OriginalHash string `json:"-"`
}
func (RawManifest) Hash ¶
func (r RawManifest) Hash() string
Click to show internal directories.
Click to hide internal directories.