docs: AI gateway documentation overhaul#328
Conversation
There was a problem hiding this comment.
Pull request overview
Overhauls the AI gateway documentation, generates filter-to-example references, and adds an integration-tested guardrails example.
Changes:
- Adds OpenAI Responses, token-counting, and crate-architecture guides.
- Expands generated filter documentation with related examples.
- Adds the guardrails example and reduces the example-test allowlist.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
xtask/src/lint_example_tests.rs |
Reduces skipped examples. |
xtask/src/filter_docs.rs |
Enhances generated filter docs. |
tests/integration/tests/suite/examples/mod.rs |
Registers guardrails tests. |
tests/integration/tests/suite/examples/ai_guardrails.rs |
Tests guardrails example passthrough. |
examples/README.md |
Documents routing and guardrails examples. |
examples/configs/ai-guardrails.yaml |
Adds guardrails configuration. |
docs/token-counting.md |
Adds token-counting guide. |
docs/README.md |
Reorganizes documentation hub. |
docs/quickstart.md |
Updates next-step links. |
docs/proposals.md |
Corrects discussion URL. |
docs/openai-responses.md |
Adds Responses API guide. |
docs/filters/tool_parse.md |
Adds related examples. |
docs/filters/token_usage_headers.md |
Updates generated reference. |
docs/filters/token_count.md |
Updates generated reference. |
docs/filters/responses_proxy.md |
Adds related examples. |
docs/filters/README.md |
Updates filter overview. |
docs/filters/prompt_enrich.md |
Adds related example. |
docs/filters/openai_stream_events.md |
Adds related examples. |
docs/filters/openai_responses_validate.md |
Adds related examples. |
docs/filters/openai_responses_rehydrate.md |
Adds related examples. |
docs/filters/openai_responses_model_rewrite.md |
Updates type formatting and examples. |
docs/filters/openai_responses_format.md |
Adds related examples. |
docs/filters/openai_response_store.md |
Updates generated reference. |
docs/filters/openai_conversations.md |
Updates generated reference. |
docs/filters/model_to_header.md |
Adds related example. |
docs/filters/mcp.md |
Adds related examples. |
docs/filters/extensions.md |
Updates dependency and generation guidance. |
docs/filters/anthropic_validate.md |
Adds related example. |
docs/filters/anthropic_to_openai.md |
Adds related example. |
docs/filters/anthropic_stream_events.md |
Adds related example. |
docs/filters/anthropic_messages_protocol.md |
Adds related example. |
docs/filters/anthropic_messages_format.md |
Adds related examples. |
docs/filters/ai_guardrails.md |
Adds related example. |
docs/filters/a2a.md |
Updates type formatting and examples. |
docs/features.md |
Refreshes feature descriptions. |
docs/developing/getting-started.md |
Corrects binary name. |
docs/architecture/response-store.md |
Corrects source paths. |
docs/architecture/crate-layout.md |
Adds crate architecture guide. |
docs/architecture/ai-inference.md |
Updates core ownership and paths. |
docs/architecture/agentic-protocols.md |
Updates agentic module paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let needle = format!("filter: {filter_name}"); | ||
| let mut matches = Vec::new(); | ||
| for path in yaml_files { | ||
| let Ok(content) = fs::read_to_string(&path) else { | ||
| continue; | ||
| }; | ||
| if content.contains(&needle) |
There was a problem hiding this comment.
Acknowledged — not fixing in this docs PR. Substring matching has no false positives in current examples; YAML-aware exact filter: matching is reasonable follow-up if the example set grows.
| // Uses core `json_body_field`; covered by praxis core examples/tests. | ||
| "ai-inference-body-based-routing.yaml", |
There was a problem hiding this comment.
Acknowledged — not fixing in this docs PR. model-to-header-routing.yaml is back on the SKIP list with an explicit justification; wiring model_to_header.rs to load_example_config is follow-up work.
| // All configs are skipped until tests/integration is re-enabled. | ||
| "a2a-classifier-routing.yaml", | ||
| "a2a-task-routing.yaml", | ||
| // Uses core `json_body_field`; covered by praxis core examples/tests. |
There was a problem hiding this comment.
Same as the earlier SKIP-thread comment: kept on SKIP intentionally; integration test still uses inline YAML in this PR.
Expand the docs hub with OpenAI Responses and token-counting guides, crate-layout architecture, and generated filter docs with navigable example links. Add ai-guardrails example and integration test, shrink the example-test SKIP list, and address review feedback (guardrails scaffold labeling, issue tracker links, filter_metadata docs, and config-note link normalization). Signed-off-by: Ricardo Pchevuzinske Katz <katz@redhat.com>
| let parsed: serde_json::Value = serde_json::from_str(&body).expect("backend should echo valid JSON"); | ||
| assert_eq!(parsed["model"], "gpt-4o", "body should pass through unchanged"); |
There was a problem hiding this comment.
Acknowledged — not expanding in this PR. The test verifies status 200 and backend echo; asserting the full JSON payload is a reasonable follow-up for stronger pass-through coverage.
Clarify filter_metadata token phase-ordering in extensions.md, drop stale praxis-proxy#48 references from guardrails docs, and keep model-to-header-routing.yaml on the SKIP list. Signed-off-by: Ricardo Pchevuzinske Katz <katz@redhat.com>
Update guardrails filter rustdoc and regenerate filter pages so they match the pass-through example. Fix awkward praxis-proxy#50 link wording in features.md. Signed-off-by: Ricardo Pchevuzinske Katz <katz@redhat.com>
Summary
ai-guardrailsexample with integration test; shrinklint-example-testsSKIP listTest plan
make lint/cargo xtask lint-example-testsai-guardrailsexample