Skip to content

chore: updated docs for extra params passthrough - #3897

Merged
akshaydeo merged 5 commits into
devfrom
05-29-chore_updated_docs_for_extra_params_passthrough
Jun 2, 2026
Merged

chore: updated docs for extra params passthrough#3897
akshaydeo merged 5 commits into
devfrom
05-29-chore_updated_docs_for_extra_params_passthrough

Conversation

@sammaji

@sammaji sammaji commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Clarifies how passthrough_extra_params works across different entrypoints, and fixes an incorrect Go SDK usage example that was using the wrong context API.

Changes

  • Added an explanation distinguishing how extra parameters are collected on standard inference routes (/v1/chat/completions, /v1/responses, /v1/embeddings, /v1/images/generations) versus OpenAI integration routes (/openai), where unknown top-level fields are not collected and extra_params must be used explicitly.
  • Added a new cURL example tab for the OpenAI integration route showing correct extra_params usage.
  • Fixed the Go SDK example to use schemas.NewBifrostContext and ctx.SetValue instead of the incorrect context.WithValue pattern.
  • Removed trailing newline inconsistency at end of file.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Review the updated docs/providers/request-options.mdx page and verify:

  • The new explanation paragraph accurately reflects routing behavior.
  • The OpenAI integration cURL example renders correctly in the tabbed view.
  • The Go SDK example compiles correctly against the current SDK API.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

None.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

Summary by CodeRabbit

  • Documentation
    • Updated request options documentation to clarify how extra parameters are handled differently for standard inference routes versus OpenAI integration routes.
    • Enhanced Gateway and Go SDK examples to better illustrate the correct structure for passing extra parameters based on request type.

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation for Passthrough Extra Parameters is enhanced to clarify collection behavior based on request entrypoint: standard inference routes accept top-level JSON fields, while OpenAI integration routes require fields under extra_params. Gateway and Go SDK examples are updated to demonstrate current API patterns.

Changes

Passthrough Extra Parameters Documentation

Layer / File(s) Summary
Passthrough Extra Parameters clarification and examples
docs/providers/request-options.mdx
Passthrough section now explains entrypoint-specific parameter collection (standard routes vs. /openai routes), adds an "OpenAI Integration" Gateway example showing extra_params nesting, and updates Go SDK example to use schemas.NewBifrostContext(...) with ctx.SetValue(...) for passthrough configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • akshaydeo
  • danpiths

Poem

🐰 A doc hops through the params clear,
Explaining where each field goes here—
Extra fields in top-level arrays roam,
But OpenAI finds a nested home.
Go SDK now sets its flags with grace,
Bifrost context in its proper place! 📚

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: updated docs for extra params passthrough' is relevant to the changeset but is generic and lacks specificity about the core improvement (clarifying passthrough behavior across entrypoints and fixing the Go SDK example).
Description check ✅ Passed The description comprehensively covers the Summary, Changes, Type of change, Affected areas, and Testing approach with clear details about routing behavior, new examples, and SDK fixes. It addresses the template's core requirements despite some checklist items being unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-29-chore_updated_docs_for_extra_params_passthrough

Comment @coderabbitai help to get the list of available commands and usage tips.

@akshaydeo
akshaydeo force-pushed the dev branch 2 times, most recently from 8c3e42e to b95e8e7 Compare May 31, 2026 08:03
@sammaji
sammaji changed the base branch from dev to graphite-base/3897 June 1, 2026 10:33
@sammaji
sammaji force-pushed the 05-29-chore_updated_docs_for_extra_params_passthrough branch from c65201d to 0b942a1 Compare June 1, 2026 10:33
@sammaji
sammaji changed the base branch from graphite-base/3897 to 04-14-chore_updated_docs_for_otel_plugin June 1, 2026 10:33
@sammaji
sammaji force-pushed the 05-29-chore_updated_docs_for_extra_params_passthrough branch from 0b942a1 to c6bd504 Compare June 1, 2026 12:35
@sammaji
sammaji force-pushed the 04-14-chore_updated_docs_for_otel_plugin branch from 7b61914 to 0048573 Compare June 1, 2026 12:35
@sammaji
sammaji marked this pull request as ready for review June 1, 2026 12:36
@greptile-apps

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Documentation-only change with no runtime code touched; all three modifications are accurate against the current Go SDK API.

The Go SDK fix is verified against core/schemas/context.go — NewBifrostContext returns *BifrostContext, SetValue is the correct method, and BifrostContextKeyPassthroughExtraParams is not in the reserved-key list so the write is not silently dropped. The new cURL example correctly uses the extra_params wrapper for the /openai route. The router's ParseModelString handles the 'openai/gpt-4o-mini' format used in both examples.

No files require special attention.

Important Files Changed

Filename Overview
docs/providers/request-options.mdx Adds entrypoint-specific explanation and a new cURL tab for the OpenAI integration route; fixes the Go SDK example to use the correct NewBifrostContext + SetValue API instead of context.WithValue

Reviews (5): Last reviewed commit: "chore: updated docs for extra params pas..." | Re-trigger Greptile

@sammaji
sammaji force-pushed the 04-14-chore_updated_docs_for_otel_plugin branch from 0048573 to f413b61 Compare June 1, 2026 12:45
@sammaji
sammaji force-pushed the 05-29-chore_updated_docs_for_extra_params_passthrough branch 2 times, most recently from 879a747 to d6ce973 Compare June 1, 2026 12:48
@sammaji
sammaji force-pushed the 04-14-chore_updated_docs_for_otel_plugin branch from f413b61 to c9acc93 Compare June 1, 2026 12:48

@sammaji sammaji left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai review

@sammaji
sammaji force-pushed the 04-14-chore_updated_docs_for_otel_plugin branch from c9acc93 to 0fb06e5 Compare June 1, 2026 13:36
@sammaji
sammaji force-pushed the 05-29-chore_updated_docs_for_extra_params_passthrough branch from d6ce973 to 82403ee Compare June 1, 2026 13:36
@sammaji sammaji mentioned this pull request Jun 1, 2026
18 tasks
@sammaji
sammaji force-pushed the 04-14-chore_updated_docs_for_otel_plugin branch from 0fb06e5 to b2ab05b Compare June 2, 2026 05:26
@sammaji
sammaji force-pushed the 05-29-chore_updated_docs_for_extra_params_passthrough branch from 82403ee to a6b4820 Compare June 2, 2026 05:26
@sammaji
sammaji force-pushed the 04-14-chore_updated_docs_for_otel_plugin branch from b2ab05b to 8137423 Compare June 2, 2026 09:11
@sammaji
sammaji force-pushed the 05-29-chore_updated_docs_for_extra_params_passthrough branch from a6b4820 to 48158ed Compare June 2, 2026 09:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/providers/request-options.mdx`:
- Line 549: Update the cURL example endpoint which currently uses
'http://localhost:8080/openai/chat/completions' to the correct route
'/openai/v1/chat/completions' so the example calls
'http://localhost:8080/openai/v1/chat/completions'; locate the cURL snippet in
the docs where the broken URL appears and replace the path portion to match the
integration route '/openai/v1/chat/completions'.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d1ddf18a-bd70-476d-9c9b-b52a3fe66029

📥 Commits

Reviewing files that changed from the base of the PR and between 8137423 and 48158ed.

📒 Files selected for processing (1)
  • docs/providers/request-options.mdx

Comment thread docs/providers/request-options.mdx

akshaydeo commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 2, 4:44 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 2, 4:48 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from 04-14-chore_updated_docs_for_otel_plugin to graphite-base/3897 June 2, 2026 16:47
@akshaydeo
akshaydeo changed the base branch from graphite-base/3897 to dev June 2, 2026 16:47
@akshaydeo
akshaydeo requested a review from a team as a code owner June 2, 2026 16:47
@akshaydeo
akshaydeo merged commit 9d17c8b into dev Jun 2, 2026
12 checks passed
@akshaydeo
akshaydeo deleted the 05-29-chore_updated_docs_for_extra_params_passthrough branch June 2, 2026 16:48
akshaydeo pushed a commit that referenced this pull request Jun 2, 2026
## Summary

Clarifies how `passthrough_extra_params` works across different entrypoints, and fixes an incorrect Go SDK usage example that was using the wrong context API.

## Changes

- Added an explanation distinguishing how extra parameters are collected on standard inference routes (`/v1/chat/completions`, `/v1/responses`, `/v1/embeddings`, `/v1/images/generations`) versus OpenAI integration routes (`/openai`), where unknown top-level fields are not collected and `extra_params` must be used explicitly.
- Added a new cURL example tab for the OpenAI integration route showing correct `extra_params` usage.
- Fixed the Go SDK example to use `schemas.NewBifrostContext` and `ctx.SetValue` instead of the incorrect `context.WithValue` pattern.
- Removed trailing newline inconsistency at end of file.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

Review the updated `docs/providers/request-options.mdx` page and verify:
- The new explanation paragraph accurately reflects routing behavior.
- The OpenAI integration cURL example renders correctly in the tabbed view.
- The Go SDK example compiles correctly against the current SDK API.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Documentation**
  * Updated request options documentation to clarify how extra parameters are handled differently for standard inference routes versus OpenAI integration routes.
  * Enhanced Gateway and Go SDK examples to better illustrate the correct structure for passing extra parameters based on request type.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
akshaydeo pushed a commit that referenced this pull request Jun 4, 2026
## Summary

Clarifies how `passthrough_extra_params` works across different entrypoints, and fixes an incorrect Go SDK usage example that was using the wrong context API.

## Changes

- Added an explanation distinguishing how extra parameters are collected on standard inference routes (`/v1/chat/completions`, `/v1/responses`, `/v1/embeddings`, `/v1/images/generations`) versus OpenAI integration routes (`/openai`), where unknown top-level fields are not collected and `extra_params` must be used explicitly.
- Added a new cURL example tab for the OpenAI integration route showing correct `extra_params` usage.
- Fixed the Go SDK example to use `schemas.NewBifrostContext` and `ctx.SetValue` instead of the incorrect `context.WithValue` pattern.
- Removed trailing newline inconsistency at end of file.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

Review the updated `docs/providers/request-options.mdx` page and verify:
- The new explanation paragraph accurately reflects routing behavior.
- The OpenAI integration cURL example renders correctly in the tabbed view.
- The Go SDK example compiles correctly against the current SDK API.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Documentation**
  * Updated request options documentation to clarify how extra parameters are handled differently for standard inference routes versus OpenAI integration routes.
  * Enhanced Gateway and Go SDK examples to better illustrate the correct structure for passing extra parameters based on request type.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
akshaydeo pushed a commit that referenced this pull request Jun 7, 2026
## Summary

Clarifies how `passthrough_extra_params` works across different entrypoints, and fixes an incorrect Go SDK usage example that was using the wrong context API.

## Changes

- Added an explanation distinguishing how extra parameters are collected on standard inference routes (`/v1/chat/completions`, `/v1/responses`, `/v1/embeddings`, `/v1/images/generations`) versus OpenAI integration routes (`/openai`), where unknown top-level fields are not collected and `extra_params` must be used explicitly.
- Added a new cURL example tab for the OpenAI integration route showing correct `extra_params` usage.
- Fixed the Go SDK example to use `schemas.NewBifrostContext` and `ctx.SetValue` instead of the incorrect `context.WithValue` pattern.
- Removed trailing newline inconsistency at end of file.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs

## How to test

Review the updated `docs/providers/request-options.mdx` page and verify:
- The new explanation paragraph accurately reflects routing behavior.
- The OpenAI integration cURL example renders correctly in the tabbed view.
- The Go SDK example compiles correctly against the current SDK API.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **Documentation**
  * Updated request options documentation to clarify how extra parameters are handled differently for standard inference routes versus OpenAI integration routes.
  * Enhanced Gateway and Go SDK examples to better illustrate the correct structure for passing extra parameters based on request type.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants