Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DescribeRequest ¶
type DescribeRequest struct {
Kind string // "property" or "operation"
Schema string // owning schema name, e.g. "User"
Name string // property/field name, e.g. "createdAt"
Snippet string // the added fragment (YAML) for type context
}
DescribeRequest is everything a provider needs to write one description. It is provider-agnostic: no vendor types leak in here.
type Enricher ¶
type Enricher interface {
Describe(ctx context.Context, req DescribeRequest) (string, error)
Name() string // provider label, for logging/audit
}
Enricher writes a one-line, human-readable description for a new field or endpoint. One implementation per LLM provider (Anthropic, OpenAI, Gemini...). A returned error is non-fatal to the pipeline — the caller degrades.
type LLMEnricher ¶
LLMEnricher adapts any llm.Client into an Enricher. The DOMAIN knowledge — how to prompt for an OpenAPI description — lives here; the transport lives in the llm package. Swapping providers/fallback happens by passing a different llm.Client (e.g. llm.NewFallback(anthropic, openai)).
func NewLLMEnricher ¶
func NewLLMEnricher(c llm.Client) *LLMEnricher
func (*LLMEnricher) Describe ¶
func (l *LLMEnricher) Describe(ctx context.Context, req DescribeRequest) (string, error)
func (*LLMEnricher) Name ¶
func (l *LLMEnricher) Name() string
type Result ¶
type Result struct {
Enriched int
Skipped int // patches that don't take a description (remove/replace/required)
Failed int // provider errored on these; description left empty
}
Result reports what happened, so failures are visible, never silent.
type StubEnricher ¶
type StubEnricher struct{}
StubEnricher is a deterministic, offline provider for tests and demos.
func (StubEnricher) Describe ¶
func (StubEnricher) Describe(_ context.Context, req DescribeRequest) (string, error)
func (StubEnricher) Name ¶
func (StubEnricher) Name() string