llm

简体中文

The root provides navigation. Import concrete subpackages directly.

Integration from other modules

Integration here means other Go packages in this repository. Go internal import rules restrict imports from outside the repository; HTTP clients use mounted gateway endpoints.

This directory organizes credentials, dialogue, and estimate without a root Go API. Select subpackages for credential hydration and dialogue codecs, then send through dataplane. Keep estimates separate from settlement.

Entry point or resource Usage and result
credentials.Hydrate Connection parameter snapshots
dialogue.ParseDialogue / EncodeDialogue Network-free protocol conversion
estimate.CountTokens / TokenCost Admission/utility estimates

Integration demo

Run the following commands from the repository root.

go test ./internal/llm/... -count=1

Verifies child-package contracts. See dialogue for a runnable conversion demo and credentials for hydration.

Errors, state, and side effects

Unified dialogue supports only explicitly representable capabilities; use native entry points for complete vendor fields. Do not import the internal/llm root directory.

Source and verification

Directory Responsibility
dialogue Unified dialogue codecs and strict validation
credentials Trusted credential hydration
estimate Token and cost estimation

Vendors depend on registry/measurement and contract. Deployment depends on registry, capability and llm/dialogue. Dataplane executes requests; gateway owns authentication, persistence and composition.

Official openai-go/v3, anthropic-sdk-go and Google genai response types are reused. SSE decoding lives in dataplane/dialogue. Native bypass uses standard HTTP to preserve unknown fields; SDKs do not own retries, routing or settlement.

Search full documentation: budgets, routing, Docker…