Skip to content

Comments

feat(llm): add structured output with chat_typed<T> and Extractor#541

Merged
bug-ops merged 5 commits intomainfrom
feat/structured-llm-output
Feb 18, 2026
Merged

feat(llm): add structured output with chat_typed<T> and Extractor#541
bug-ops merged 5 commits intomainfrom
feat/structured-llm-output

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 18, 2026

Summary

Closes #456, closes #457, closes #458, closes #459
Part of Epic #474

Test plan

  • strip_json_fences unit tests (7 cases)
  • chat_typed default impl tests (5 cases: happy path, retry, both fail, error propagation, fence stripping)
  • Extractor tests (3 cases: basic, preamble, error propagation)
  • AnyProvider::chat_typed_erased dispatch test
  • supports_structured_output default and StructuredParse error display
  • cargo clippy --workspace -- -D warnings clean
  • cargo nextest run --workspace --lib --bins — 1645 passed, 9 skipped

@github-actions github-actions bot added documentation Improvements or additions to documentation llm LLM provider related rust dependencies enhancement New feature or request size/XL labels Feb 18, 2026
@bug-ops bug-ops force-pushed the feat/structured-llm-output branch from f8ff289 to b12a004 Compare February 18, 2026 17:17
Add LlmProvider::chat_typed<T>() with default JSON schema prompt
injection, native OpenAI response_format override, Claude forced
tool use override, AnyProvider::chat_typed_erased dispatch, and
Extractor<T> utility for typed extraction from LLM responses.

Resolves #456, #457, #458, #459
Add tests for strip_json_fences (7 cases), chat_typed default impl
(5 cases: happy path, retry success, both fail, error propagation,
fence stripping), Extractor (3 cases: with/without preamble, error),
supports_structured_output default, and StructuredParse error display.

Document strip_json_fences limitation with nested backticks (R2).
Add chat_typed_erased dispatch test via MockProvider, and
supports_structured_output delegation tests for OpenAI and Ollama
variants.
@bug-ops bug-ops force-pushed the feat/structured-llm-output branch from b12a004 to 6679d1e Compare February 18, 2026 17:29
@bug-ops bug-ops enabled auto-merge (squash) February 18, 2026 17:35
@bug-ops bug-ops merged commit 635254d into main Feb 18, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/structured-llm-output branch February 18, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies documentation Improvements or additions to documentation enhancement New feature or request llm LLM provider related rust size/XL

Projects

None yet

1 participant