Skip to content

Conversation

Pratham-Mishra04
Copy link
Collaborator

Update Google GenAI SDK examples to use the latest API

This PR updates all Python code examples in the GenAI-compatible documentation to use the latest Google GenAI SDK API. Key changes include:

  • Replace import google.generativeai as genai with from google import genai
  • Update client initialization from genai.configure() to genai.Client()
  • Replace genai.GenerativeModel() with client.models.generate_content()
  • Update parameter structures to use the new types like HttpOptions, GenerateContentConfig, and SafetySetting
  • Add a new "Multi-provider Support" section with examples of using different providers via the GenAI SDK
  • Enhance the function calling examples to use the new Tool and FunctionDeclaration classes
  • Update error handling examples to match the new client structure

These changes ensure the documentation reflects the current Google GenAI SDK interface while maintaining compatibility with Bifrost.

Copy link
Contributor

coderabbitai bot commented Jul 6, 2025

Summary by CodeRabbit

  • Documentation
    • Updated all usage examples for the Google GenAI SDK with Bifrost to use a new client instantiation and method call pattern.
    • Examples now demonstrate explicit client creation, advanced configuration options, and updated error handling.
    • Added new sections illustrating multi-provider support and revised function/tool integration examples for clarity and consistency.

Summary by CodeRabbit

  • Documentation
    • Updated all usage examples for integrating Google GenAI SDK with Bifrost to reflect the new client instantiation and method call patterns.
    • Revised examples to demonstrate explicit client creation, advanced configuration options, and multi-provider support.
    • Improved clarity and consistency in error handling, tool integration, and function calling examples.

Walkthrough

The documentation for integrating the Google GenAI SDK with Bifrost has been updated to use a new client instantiation pattern. Examples now demonstrate explicit client creation, use of typed configuration objects, and updated method calls for content generation, error handling, tool integration, and multi-provider support.

Changes

File(s) Change Summary
docs/usage/http-transport/integrations/genai-compatible.md Updated documentation to show new client instantiation, typed config usage, and revised examples

Suggested reviewers

  • akshaydeo

Poem

In docs anew, the patterns shift,
A client born with keys we lift.
Typed configs hop in, tools in tow,
Bifrost’s bridge now clear to show.
With every call, more clarity,
The code and docs in harmony—
A rabbit’s guide, so hop and see! 🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0e87ea and 8991e0d.

📒 Files selected for processing (1)
  • docs/usage/http-transport/integrations/genai-compatible.md (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#94
File: core/bifrost.go:823-845
Timestamp: 2025-06-18T15:15:51.323Z
Learning: In the Bifrost project, the team prioritizes maintaining consistent error handling patterns over exposing detailed error context. All errors should be wrapped in the standard `BifrostError` structure rather than creating specific error types or exposing richer error details like exit codes or stderr output.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:358-388
Timestamp: 2025-06-04T05:37:59.699Z
Learning: User Pratham-Mishra04 prefers not to extract small code duplications (around 2 lines) into helper functions, considering the overhead not worth it for such minor repetition.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#102
File: README.md:62-66
Timestamp: 2025-06-19T17:03:03.639Z
Learning: Pratham-Mishra04 prefers using the implicit 'latest' tag for the maximhq/bifrost Docker image rather than pinning to specific versions.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#143
File: core/mcp.go:155-196
Timestamp: 2025-07-08T15:33:47.698Z
Learning: Pratham-Mishra04 prefers not to add explanatory comments for obvious code patterns, such as the unlock/lock strategy around network I/O operations, considering them self-explanatory to experienced developers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#141
File: core/bifrost.go:198-272
Timestamp: 2025-07-08T18:30:08.258Z
Learning: Pratham-Mishra04 follows a pattern of implementing core functionality first and deferring non-critical improvements (like race condition fixes, optimizations) to later PRs. This is a reasonable development approach that prioritizes getting the main feature working before addressing edge cases.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#150
File: transports/bifrost-http/lib/store.go:370-466
Timestamp: 2025-07-09T04:58:08.229Z
Learning: Pratham-Mishra04 prefers not to add logging or error handling for unreachable code paths in the Bifrost project. When provider types or similar entities are predefined in the system, defensive programming like logging in default cases is considered unnecessary overhead.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: docs/usage/go-package/mcp.md:408-412
Timestamp: 2025-07-01T12:40:08.576Z
Learning: Pratham-Mishra04 is okay with keeping bullet list formatting that uses colons after dashes in markdown documentation, even if it triggers linter warnings, preferring functionality over strict formatting rules.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#148
File: transports/bifrost-http/lib/store.go:880-910
Timestamp: 2025-07-08T17:14:21.544Z
Learning: Pratham-Mishra04 prefers resilient system design where missing environment variables for MCP connections should not cause complete system failure. The system should continue processing other MCP connections even when some fail, maintaining partial functionality rather than implementing fail-fast behavior.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#148
File: transports/bifrost-http/lib/store.go:1081-1098
Timestamp: 2025-07-08T17:16:50.811Z
Learning: Pratham-Mishra04 prefers practical redaction approaches over theoretical security improvements when the threat model is low-risk, such as admin-only interfaces in the Bifrost project. Fixed-length redaction is acceptable when only trusted administrators will see the redacted values.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#144
File: transports/bifrost-http/plugins/logging/utils.go:286-292
Timestamp: 2025-07-08T16:40:59.098Z
Learning: Pratham-Mishra04 prefers to keep simpler error handling patterns when errors are unlikely to occur in practice, such as safety checks in BadgerDB iterations where item.Value() is called on valid items. The user considers the overhead of explicit error handling not worth it in such scenarios.
docs/usage/http-transport/integrations/genai-compatible.md (20)
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#103
File: .github/workflows/transport-dependency-update.yml:53-75
Timestamp: 2025-06-20T16:21:18.912Z
Learning: In the bifrost repository's transport dependency update workflow, when updating the core dependency to a new version using `go get`, the go.mod and go.sum files will always change in normal operation, making the safety check for changes more of a defensive programming practice rather than handling a common scenario.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#75
File: transports/bifrost-http/integrations/genai/types.go:109-117
Timestamp: 2025-06-14T08:54:58.137Z
Learning: In the Gemini/GenAI integration (transports/bifrost-http/integrations/genai/types.go), function calls don't have IDs, only names. Therefore, using the function name as ToolCallID is intentional and correct behavior, as Gemini's API doesn't provide call IDs.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#144
File: transports/bifrost-http/handlers/providers.go:45-49
Timestamp: 2025-07-08T16:50:27.699Z
Learning: In the Bifrost project, breaking API changes are acceptable when features are not yet public. This applies to scenarios like changing struct fields from pointer to non-pointer types in request/response structures for unreleased features.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#64
File: transports/bifrost-http/integrations/genai/types.go:273-313
Timestamp: 2025-06-09T16:35:26.914Z
Learning: In convertGenerationConfigToParams method in transports/bifrost-http/integrations/genai/types.go, pre-allocating the ExtraParams map is preferred over lazy allocation because the method has multiple potential ExtraParams assignments, making the computational overhead of conditional checks exceed the memory savings of an empty map.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#82
File: tests/transports-integrations/tests/integrations/test_litellm.py:97-115
Timestamp: 2025-06-16T09:16:15.634Z
Learning: In the Bifrost integration tests, the user prefers tests to fail hard when API keys are missing rather than using @skip_if_no_api_key decorators for graceful skipping. This applies to LiteLLM tests that depend on OpenAI API keys.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/tests/e2e_tool_test.go:29-30
Timestamp: 2025-06-04T04:58:12.239Z
Learning: In the Bifrost project, environment variables should be used only for secrets (like API keys), not for general configuration. Test parameters like provider and model can be hardcoded at the start of test files for predictability and consistency.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/config/account.go:55-101
Timestamp: 2025-06-16T04:25:00.816Z
Learning: In the Bifrost test account implementation, the user prefers to let Bifrost itself handle missing API key errors rather than adding early validation in the GetKeysForProvider method.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:483-494
Timestamp: 2025-06-04T09:36:27.956Z
Learning: In the Anthropic provider (core/providers/anthropic.go), the user has confirmed through practical experience that the tool_choice parameter should always use an object format with a "type" field (e.g., {"type": "auto"}, {"type": "tool", "name": "function_name"}), even though the official documentation examples sometimes show "auto" as a direct string. The current implementation correctly handles all tool choice types with the object format.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#83
File: core/providers/mistral.go:168-170
Timestamp: 2025-06-15T14:24:49.882Z
Learning: In the Bifrost codebase, performance is prioritized over defensive copying for HTTP service operations. Specifically, shallow slice assignments in provider response handling are acceptable due to object pool reset patterns and JSON unmarshaling behavior that minimize practical data corruption risks.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#141
File: core/bifrost.go:198-272
Timestamp: 2025-07-08T18:30:08.258Z
Learning: Pratham-Mishra04 follows a pattern of implementing core functionality first and deferring non-critical improvements (like race condition fixes, optimizations) to later PRs. This is a reasonable development approach that prioritizes getting the main feature working before addressing edge cases.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default), "any" (force use of at least one tool), and {"type": "tool", "name": "tool_name"} (force use of specific tool). Anthropic does NOT support "none" as a tool_choice value - there's no way to disable tool usage once tools are provided in the request.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default - Claude decides whether to use tools), "none" (disables tool usage entirely), "any" (forces Claude to use at least one tool), and {"type": "tool", "name": "tool_name"} (forces use of a specific tool). All of these values are officially supported by Anthropic's API.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:264-285
Timestamp: 2025-06-10T12:58:45.501Z
Learning: In the Bifrost OpenAI integration, tool calls should be allowed on any message role (not just assistant messages) and the downstream provider should handle validation. Users passing tool calls to non-assistant messages is considered deliberate behavior that should be preserved.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/scenarios/multiple_tool_calls.go:27-31
Timestamp: 2025-06-16T04:05:47.793Z
Learning: ParallelToolCalls parameter is not supported by many AI providers, so it should be avoided in cross-provider test suites to maintain compatibility across different providers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/cohere.go:250-253
Timestamp: 2025-06-04T04:29:56.660Z
Learning: Cohere's API only supports "REQUIRED" and "NONE" values for the tool_choice parameter, unlike other providers that may support function-specific tool choices.
🪛 LanguageTool
docs/usage/http-transport/integrations/genai-compatible.md

[grammar] ~268-~268: Use correct spacing
Context: ...ography." ) ) ### **Generation Configuration** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Tell me a story", config=GenerateContentConfig( candidate_count=1, max_output_tokens=1000, temperature=0.7, top_p=0.8, top_k=40, stop_sequences=["END"] ) ) ### **Safety Settings** python from googl...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~293-~293: Use correct spacing
Context: ...ences=["END"] ) ) ### **Safety Settings** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig, SafetySetting client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) safety_settings = [ SafetySetting( category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_MEDIUM_AND_ABOVE" ), SafetySetting( category="HARM_CATEGORY_HATE_SPEECH", threshold="BLOCK_MEDIUM_AND_ABOVE" ) ] response = client.models.generate_content( model="gemini-pro", contents="Your content here", config=GenerateContentConfig(safety_settings=safety_settings) ) ### **Error Handling** python from google...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~322-~322: Use correct spacing
Context: ...ngs=safety_settings) ) ### **Error Handling** python from google import genai from google.genai.types import HttpOptions from google.api_core import exceptions try: client = genai.Client( api_key=google_api_key, http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Hello!" ) except exceptions.InvalidArgument as e: print(f"Invalid argument: {e}") except exceptions.PermissionDenied as e: print(f"Permission denied: {e}") except Exception as e: print(f"Other error: {e}") ``` --- ## ⚡ Enhanced Features ### **Automatic MC...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~392-~392: Use correct spacing
Context: ..._call.name}") ``` ### Multi-provider Support Use multiple providers with Google GenA...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~394-~394: Use articles correctly
Context: ... Support** Use multiple providers with Google GenAI SDK format by prefixing model nam...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~394-~394: Use correct spacing
Context: ...gle GenAI SDK format by prefixing model names: python from google import genai from google.genai.types import HttpOptions client = genai.Client( api_key="dummy", # API keys configured in Bifrost http_options=HttpOptions(base_url="http://localhost:8080/genai") ) # Google models (default) response1 = client.models.generate_content( model="gemini-pro", contents="Hello!" ) # OpenAI models via GenAI SDK response2 = client.models.generate_content( model="openai/gpt-4o-mini", contents="Hello!" ) # Anthropic models via GenAI SDK response3 = client.models.generate_content( model="anthropic/claude-3-sonnet-20240229", contents="Hello!" ) ### Multi-provider Fallbacks Configure f...

(QB_NEW_EN_OTHER_ERROR_IDS_5)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

569-586: Legacy genai.configure() / GenerativeModel usage contradicts the “new client API” migration

These lines revert to the old global-configure + GenerativeModel pattern the PR intends to deprecate. This will confuse readers and undercuts the migration narrative. Recommend updating to explicit genai.Client(...).models.generate_content() (or clearly labelling this block as “legacy API” if intentional).

Likely an incorrect or invalid review comment.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 07-06-docs_genai_integration_docs_fixes

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

569-586: Update example to the new Client API

This “Multi-provider Support” snippet still relies on the legacy genai.configure() + GenerativeModel pattern, contradicting the earlier docs (and PR goal) that migrate to the explicit genai.Client workflow. Keeping both styles side-by-side is confusing and may mislead users.

Consider rewriting the block to match the rest of the document, e.g.:

-from google import genai
-
-genai.configure(
-    api_key="dummy",  # API keys configured in Bifrost
-    client_options={"api_endpoint": "http://localhost:8080/genai"}
-)
-
-# Google models (default)
-model1 = genai.GenerativeModel('gemini-pro')
-response1 = model1.generate_content("Hello!")
-
-# OpenAI models via GenAI SDK
-model2 = genai.GenerativeModel('openai/gpt-4o-mini')
-response2 = model2.generate_content("Hello!")
-
-# Anthropic models via GenAI SDK
-model3 = genai.GenerativeModel('anthropic/claude-3-sonnet-20240229')
-response3 = model3.generate_content("Hello!")
+from google import genai
+from google.genai.types import HttpOptions
+
+client = genai.Client(
+    api_key="dummy",  # API keys configured in Bifrost
+    http_options=HttpOptions(base_url="http://localhost:8080/genai"),
+)
+
+# Google model (default)
+response1 = client.models.generate_content(
+    model="gemini-pro",
+    contents="Hello!",
+)
+
+# OpenAI model via GenAI SDK
+response2 = client.models.generate_content(
+    model="openai/gpt-4o-mini",
+    contents="Hello!",
+)
+
+# Anthropic model via GenAI SDK
+response3 = client.models.generate_content(
+    model="anthropic/claude-3-sonnet-20240229",
+    contents="Hello!",
+)
♻️ Duplicate comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

523-528: Same missing GenerateContentConfig import in testing snippet

The function-calling test also references GenerateContentConfig but omits the import. Apply the same fix as above to avoid runtime errors.

Also applies to: 547-551

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca968a6 and 20c29fd.

📒 Files selected for processing (1)
  • docs/usage/http-transport/integrations/genai-compatible.md (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#94
File: core/bifrost.go:823-845
Timestamp: 2025-06-18T15:15:51.323Z
Learning: In the Bifrost project, the team prioritizes maintaining consistent error handling patterns over exposing detailed error context. All errors should be wrapped in the standard `BifrostError` structure rather than creating specific error types or exposing richer error details like exit codes or stderr output.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:358-388
Timestamp: 2025-06-04T05:37:59.699Z
Learning: User Pratham-Mishra04 prefers not to extract small code duplications (around 2 lines) into helper functions, considering the overhead not worth it for such minor repetition.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#102
File: README.md:62-66
Timestamp: 2025-06-19T17:03:03.639Z
Learning: Pratham-Mishra04 prefers using the implicit 'latest' tag for the maximhq/bifrost Docker image rather than pinning to specific versions.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: docs/usage/go-package/mcp.md:408-412
Timestamp: 2025-07-01T12:40:08.576Z
Learning: Pratham-Mishra04 is okay with keeping bullet list formatting that uses colons after dashes in markdown documentation, even if it triggers linter warnings, preferring functionality over strict formatting rules.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
docs/usage/http-transport/integrations/genai-compatible.md (14)
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#75
File: transports/bifrost-http/integrations/genai/types.go:109-117
Timestamp: 2025-06-14T08:54:58.137Z
Learning: In the Gemini/GenAI integration (transports/bifrost-http/integrations/genai/types.go), function calls don't have IDs, only names. Therefore, using the function name as ToolCallID is intentional and correct behavior, as Gemini's API doesn't provide call IDs.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#103
File: .github/workflows/transport-dependency-update.yml:53-75
Timestamp: 2025-06-20T16:21:18.912Z
Learning: In the bifrost repository's transport dependency update workflow, when updating the core dependency to a new version using `go get`, the go.mod and go.sum files will always change in normal operation, making the safety check for changes more of a defensive programming practice rather than handling a common scenario.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#64
File: transports/bifrost-http/integrations/genai/types.go:273-313
Timestamp: 2025-06-09T16:35:26.914Z
Learning: In convertGenerationConfigToParams method in transports/bifrost-http/integrations/genai/types.go, pre-allocating the ExtraParams map is preferred over lazy allocation because the method has multiple potential ExtraParams assignments, making the computational overhead of conditional checks exceed the memory savings of an empty map.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default), "any" (force use of at least one tool), and {"type": "tool", "name": "tool_name"} (force use of specific tool). Anthropic does NOT support "none" as a tool_choice value - there's no way to disable tool usage once tools are provided in the request.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default - Claude decides whether to use tools), "none" (disables tool usage entirely), "any" (forces Claude to use at least one tool), and {"type": "tool", "name": "tool_name"} (forces use of a specific tool). All of these values are officially supported by Anthropic's API.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:264-285
Timestamp: 2025-06-10T12:58:45.501Z
Learning: In the Bifrost OpenAI integration, tool calls should be allowed on any message role (not just assistant messages) and the downstream provider should handle validation. Users passing tool calls to non-assistant messages is considered deliberate behavior that should be preserved.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/scenarios/multiple_tool_calls.go:27-31
Timestamp: 2025-06-16T04:05:47.793Z
Learning: ParallelToolCalls parameter is not supported by many AI providers, so it should be avoided in cross-provider test suites to maintain compatibility across different providers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/cohere.go:250-253
Timestamp: 2025-06-04T04:29:56.660Z
Learning: Cohere's API only supports "REQUIRED" and "NONE" values for the tool_choice parameter, unlike other providers that may support function-specific tool choices.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#82
File: tests/transports-integrations/tests/integrations/test_litellm.py:97-115
Timestamp: 2025-06-16T09:16:15.634Z
Learning: In the Bifrost integration tests, the user prefers tests to fail hard when API keys are missing rather than using @skip_if_no_api_key decorators for graceful skipping. This applies to LiteLLM tests that depend on OpenAI API keys.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/tests/e2e_tool_test.go:29-30
Timestamp: 2025-06-04T04:58:12.239Z
Learning: In the Bifrost project, environment variables should be used only for secrets (like API keys), not for general configuration. Test parameters like provider and model can be hardcoded at the start of test files for predictability and consistency.

@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from ca968a6 to f36731b Compare July 7, 2025 13:33
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from 20c29fd to cf8d144 Compare July 7, 2025 13:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

569-586: Update “Multi-Provider Support” section to new Client API

This block still shows the legacy genai.configure() / GenerativeModel flow, contradicting the rest of the doc (and the PR objective of switching to genai.Client). Recommend rewriting to remain consistent and avoid confusing users.

♻️ Duplicate comments (2)
docs/usage/http-transport/integrations/genai-compatible.md (2)

329-333: Define google_api_key before use – prevents immediate NameError

This snippet still references google_api_key without declaring it. Anyone copy-pasting the example will crash before reaching the API call.


355-360: Add GenerateContentConfig to the import list

GenerateContentConfig is used a few lines below (config=GenerateContentConfig(...)) but is not imported, resulting in NameError.

-from google.genai.types import HttpOptions, Tool, FunctionDeclaration, Schema
+from google.genai.types import (
+    HttpOptions,
+    Tool,
+    FunctionDeclaration,
+    Schema,
+    GenerateContentConfig,
+)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20c29fd and cf8d144.

📒 Files selected for processing (1)
  • docs/usage/http-transport/integrations/genai-compatible.md (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#94
File: core/bifrost.go:823-845
Timestamp: 2025-06-18T15:15:51.323Z
Learning: In the Bifrost project, the team prioritizes maintaining consistent error handling patterns over exposing detailed error context. All errors should be wrapped in the standard `BifrostError` structure rather than creating specific error types or exposing richer error details like exit codes or stderr output.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:358-388
Timestamp: 2025-06-04T05:37:59.699Z
Learning: User Pratham-Mishra04 prefers not to extract small code duplications (around 2 lines) into helper functions, considering the overhead not worth it for such minor repetition.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#102
File: README.md:62-66
Timestamp: 2025-06-19T17:03:03.639Z
Learning: Pratham-Mishra04 prefers using the implicit 'latest' tag for the maximhq/bifrost Docker image rather than pinning to specific versions.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: docs/usage/go-package/mcp.md:408-412
Timestamp: 2025-07-01T12:40:08.576Z
Learning: Pratham-Mishra04 is okay with keeping bullet list formatting that uses colons after dashes in markdown documentation, even if it triggers linter warnings, preferring functionality over strict formatting rules.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
docs/usage/http-transport/integrations/genai-compatible.md (14)
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#103
File: .github/workflows/transport-dependency-update.yml:53-75
Timestamp: 2025-06-20T16:21:18.912Z
Learning: In the bifrost repository's transport dependency update workflow, when updating the core dependency to a new version using `go get`, the go.mod and go.sum files will always change in normal operation, making the safety check for changes more of a defensive programming practice rather than handling a common scenario.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#75
File: transports/bifrost-http/integrations/genai/types.go:109-117
Timestamp: 2025-06-14T08:54:58.137Z
Learning: In the Gemini/GenAI integration (transports/bifrost-http/integrations/genai/types.go), function calls don't have IDs, only names. Therefore, using the function name as ToolCallID is intentional and correct behavior, as Gemini's API doesn't provide call IDs.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#64
File: transports/bifrost-http/integrations/genai/types.go:273-313
Timestamp: 2025-06-09T16:35:26.914Z
Learning: In convertGenerationConfigToParams method in transports/bifrost-http/integrations/genai/types.go, pre-allocating the ExtraParams map is preferred over lazy allocation because the method has multiple potential ExtraParams assignments, making the computational overhead of conditional checks exceed the memory savings of an empty map.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#82
File: tests/transports-integrations/tests/integrations/test_litellm.py:97-115
Timestamp: 2025-06-16T09:16:15.634Z
Learning: In the Bifrost integration tests, the user prefers tests to fail hard when API keys are missing rather than using @skip_if_no_api_key decorators for graceful skipping. This applies to LiteLLM tests that depend on OpenAI API keys.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default), "any" (force use of at least one tool), and {"type": "tool", "name": "tool_name"} (force use of specific tool). Anthropic does NOT support "none" as a tool_choice value - there's no way to disable tool usage once tools are provided in the request.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default - Claude decides whether to use tools), "none" (disables tool usage entirely), "any" (forces Claude to use at least one tool), and {"type": "tool", "name": "tool_name"} (forces use of a specific tool). All of these values are officially supported by Anthropic's API.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:264-285
Timestamp: 2025-06-10T12:58:45.501Z
Learning: In the Bifrost OpenAI integration, tool calls should be allowed on any message role (not just assistant messages) and the downstream provider should handle validation. Users passing tool calls to non-assistant messages is considered deliberate behavior that should be preserved.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/scenarios/multiple_tool_calls.go:27-31
Timestamp: 2025-06-16T04:05:47.793Z
Learning: ParallelToolCalls parameter is not supported by many AI providers, so it should be avoided in cross-provider test suites to maintain compatibility across different providers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/cohere.go:250-253
Timestamp: 2025-06-04T04:29:56.660Z
Learning: Cohere's API only supports "REQUIRED" and "NONE" values for the tool_choice parameter, unlike other providers that may support function-specific tool choices.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/tests/e2e_tool_test.go:29-30
Timestamp: 2025-06-04T04:58:12.239Z
Learning: In the Bifrost project, environment variables should be used only for secrets (like API keys), not for general configuration. Test parameters like provider and model can be hardcoded at the start of test files for predictability and consistency.

@akshaydeo akshaydeo marked this pull request as ready for review July 7, 2025 18:36
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from f36731b to 7294f5c Compare July 8, 2025 08:12
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from cf8d144 to 55fae75 Compare July 8, 2025 08:12
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from 7294f5c to a23ecf9 Compare July 8, 2025 13:41
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from 55fae75 to c965706 Compare July 8, 2025 13:41
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

571-574: Inconsistent API style – falls back to deprecated genai.configure()

The rest of the document promotes the new genai.Client pattern. Mixing the old global genai.configure()/GenerativeModel approach here is confusing. Consider rewriting this example with genai.Client for consistency.

♻️ Duplicate comments (3)
docs/usage/http-transport/integrations/genai-compatible.md (3)

325-333: google_api_key is still undefined – example will raise NameError

The earlier review already flagged this but the snippet remains unchanged. Readers copy-pasting the code will hit a runtime error.

-    client = genai.Client(
-        api_key=google_api_key,
+    google_api_key = os.getenv("GOOGLE_API_KEY") or "your-google-api-key"
+    client = genai.Client(
+        api_key=google_api_key,

523-525: Same missing import here – still unresolved

This test snippet also uses GenerateContentConfig (line 550) without importing it.

-from google.genai.types import HttpOptions, Tool, FunctionDeclaration, Schema
+from google.genai.types import (
+    HttpOptions,
+    Tool,
+    FunctionDeclaration,
+    Schema,
+    GenerateContentConfig,
+)

355-357: Missing GenerateContentConfig import – snippet won’t run

GenerateContentConfig is referenced later (line 383) but not imported here.

-from google.genai.types import HttpOptions, Tool, FunctionDeclaration, Schema
+from google.genai.types import (
+    HttpOptions,
+    Tool,
+    FunctionDeclaration,
+    Schema,
+    GenerateContentConfig,
+)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 55fae75 and c965706.

📒 Files selected for processing (1)
  • docs/usage/http-transport/integrations/genai-compatible.md (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#94
File: core/bifrost.go:823-845
Timestamp: 2025-06-18T15:15:51.323Z
Learning: In the Bifrost project, the team prioritizes maintaining consistent error handling patterns over exposing detailed error context. All errors should be wrapped in the standard `BifrostError` structure rather than creating specific error types or exposing richer error details like exit codes or stderr output.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:358-388
Timestamp: 2025-06-04T05:37:59.699Z
Learning: User Pratham-Mishra04 prefers not to extract small code duplications (around 2 lines) into helper functions, considering the overhead not worth it for such minor repetition.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#102
File: README.md:62-66
Timestamp: 2025-06-19T17:03:03.639Z
Learning: Pratham-Mishra04 prefers using the implicit 'latest' tag for the maximhq/bifrost Docker image rather than pinning to specific versions.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: docs/usage/go-package/mcp.md:408-412
Timestamp: 2025-07-01T12:40:08.576Z
Learning: Pratham-Mishra04 is okay with keeping bullet list formatting that uses colons after dashes in markdown documentation, even if it triggers linter warnings, preferring functionality over strict formatting rules.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
docs/usage/http-transport/integrations/genai-compatible.md (14)
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#103
File: .github/workflows/transport-dependency-update.yml:53-75
Timestamp: 2025-06-20T16:21:18.912Z
Learning: In the bifrost repository's transport dependency update workflow, when updating the core dependency to a new version using `go get`, the go.mod and go.sum files will always change in normal operation, making the safety check for changes more of a defensive programming practice rather than handling a common scenario.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#75
File: transports/bifrost-http/integrations/genai/types.go:109-117
Timestamp: 2025-06-14T08:54:58.137Z
Learning: In the Gemini/GenAI integration (transports/bifrost-http/integrations/genai/types.go), function calls don't have IDs, only names. Therefore, using the function name as ToolCallID is intentional and correct behavior, as Gemini's API doesn't provide call IDs.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#64
File: transports/bifrost-http/integrations/genai/types.go:273-313
Timestamp: 2025-06-09T16:35:26.914Z
Learning: In convertGenerationConfigToParams method in transports/bifrost-http/integrations/genai/types.go, pre-allocating the ExtraParams map is preferred over lazy allocation because the method has multiple potential ExtraParams assignments, making the computational overhead of conditional checks exceed the memory savings of an empty map.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#82
File: tests/transports-integrations/tests/integrations/test_litellm.py:97-115
Timestamp: 2025-06-16T09:16:15.634Z
Learning: In the Bifrost integration tests, the user prefers tests to fail hard when API keys are missing rather than using @skip_if_no_api_key decorators for graceful skipping. This applies to LiteLLM tests that depend on OpenAI API keys.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default), "any" (force use of at least one tool), and {"type": "tool", "name": "tool_name"} (force use of specific tool). Anthropic does NOT support "none" as a tool_choice value - there's no way to disable tool usage once tools are provided in the request.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default - Claude decides whether to use tools), "none" (disables tool usage entirely), "any" (forces Claude to use at least one tool), and {"type": "tool", "name": "tool_name"} (forces use of a specific tool). All of these values are officially supported by Anthropic's API.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:264-285
Timestamp: 2025-06-10T12:58:45.501Z
Learning: In the Bifrost OpenAI integration, tool calls should be allowed on any message role (not just assistant messages) and the downstream provider should handle validation. Users passing tool calls to non-assistant messages is considered deliberate behavior that should be preserved.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/scenarios/multiple_tool_calls.go:27-31
Timestamp: 2025-06-16T04:05:47.793Z
Learning: ParallelToolCalls parameter is not supported by many AI providers, so it should be avoided in cross-provider test suites to maintain compatibility across different providers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/cohere.go:250-253
Timestamp: 2025-06-04T04:29:56.660Z
Learning: Cohere's API only supports "REQUIRED" and "NONE" values for the tool_choice parameter, unlike other providers that may support function-specific tool choices.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/tests/e2e_tool_test.go:29-30
Timestamp: 2025-06-04T04:58:12.239Z
Learning: In the Bifrost project, environment variables should be used only for secrets (like API keys), not for general configuration. Test parameters like provider and model can be hardcoded at the start of test files for predictability and consistency.
🪛 LanguageTool
docs/usage/http-transport/integrations/genai-compatible.md

[grammar] ~268-~268: Use proper spacing conventions.
Context: ... ) ) ### **Generation Configuration** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Tell me a story", config=GenerateContentConfig( candidate_count=1, max_output_tokens=1000, temperature=0.7, top_p=0.8, top_k=40, stop_sequences=["END"] ) ) ### **Safety Settings** python from google...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~293-~293: Use proper spacing conventions.
Context: ...END"] ) ) ### **Safety Settings** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig, SafetySetting client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) safety_settings = [ SafetySetting( category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_MEDIUM_AND_ABOVE" ), SafetySetting( category="HARM_CATEGORY_HATE_SPEECH", threshold="BLOCK_MEDIUM_AND_ABOVE" ) ] response = client.models.generate_content( model="gemini-pro", contents="Your content here", config=GenerateContentConfig(safety_settings=safety_settings) ) ### **Error Handling** python from google ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~322-~322: Use proper spacing conventions.
Context: ...ty_settings) ) ### **Error Handling** python from google import genai from google.genai.types import HttpOptions from google.api_core import exceptions try: client = genai.Client( api_key=google_api_key, http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Hello!" ) except exceptions.InvalidArgument as e: print(f"Invalid argument: {e}") except exceptions.PermissionDenied as e: print(f"Permission denied: {e}") except Exception as e: print(f"Other error: {e}") ``` --- ## ⚡ Enhanced Features ### **Automatic MCP...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~392-~392: Use proper spacing conventions.
Context: ...ame}") ``` ### Multi-provider Support Use multiple providers with Google GenAI...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~394-~394: Use articles correctly.
Context: ... Support** Use multiple providers with Google GenAI SDK format by prefixing model nam...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~394-~394: Use proper spacing conventions.
Context: ...nAI SDK format by prefixing model names: python from google import genai from google.genai.types import HttpOptions client = genai.Client( api_key="dummy", # API keys configured in Bifrost http_options=HttpOptions(base_url="http://localhost:8080/genai") ) # Google models (default) response1 = client.models.generate_content( model="gemini-pro", contents="Hello!" ) # OpenAI models via GenAI SDK response2 = client.models.generate_content( model="openai/gpt-4o-mini", contents="Hello!" ) # Anthropic models via GenAI SDK response3 = client.models.generate_content( model="anthropic/claude-3-sonnet-20240229", contents="Hello!" ) ### Multi-provider Fallbacks Configure fa...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check

@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from a23ecf9 to dbad725 Compare July 8, 2025 15:28
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from c965706 to a1bdadd Compare July 8, 2025 15:28
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from dbad725 to c4a5cf0 Compare July 8, 2025 15:44
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from a1bdadd to b1c25e7 Compare July 8, 2025 15:44
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

569-574: Use the Client-based API pattern for consistency

The snippet in docs/usage/http-transport/integrations/genai-compatible.md (lines 571–574) still uses the deprecated genai.configure() flow, whereas earlier examples all use client = genai.Client(...). To avoid confusing readers, please update that section to the modern Client pattern:

Diff:

-from google import genai
-
-genai.configure(
-    api_key="dummy",  # API keys configured in Bifrost
-    client_options={"api_endpoint": "http://localhost:8080/genai"}
-)
+from google import genai
+
+client = genai.Client(
+    api_key="dummy",  # API keys configured in Bifrost
+    client_options={"api_endpoint": "http://localhost:8080/genai"}
+)

• File: docs/usage/http-transport/integrations/genai-compatible.md
• Replace lines 571–574 with the snippet above.

♻️ Duplicate comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

330-333: google_api_key is undefined in multiple examples

All three snippets reference google_api_key without defining it first, causing a NameError for anyone copy-pasting the samples.

-from google import genai
+# Minimal fix – import os and pull the key from env (or hard-code a placeholder)
+import os
+from google import genai
@@
-    client = genai.Client(
-        api_key=google_api_key,
+    google_api_key = os.getenv("GOOGLE_API_KEY") or "your-google-api-key"
+    client = genai.Client(
+        api_key=google_api_key,

Apply the same preamble in the Compatibility Testing and Function Calling Testing blocks to keep the docs runnable.

Also applies to: 489-492, 528-529

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1bdadd and b1c25e7.

📒 Files selected for processing (1)
  • docs/usage/http-transport/integrations/genai-compatible.md (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#94
File: core/bifrost.go:823-845
Timestamp: 2025-06-18T15:15:51.323Z
Learning: In the Bifrost project, the team prioritizes maintaining consistent error handling patterns over exposing detailed error context. All errors should be wrapped in the standard `BifrostError` structure rather than creating specific error types or exposing richer error details like exit codes or stderr output.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:358-388
Timestamp: 2025-06-04T05:37:59.699Z
Learning: User Pratham-Mishra04 prefers not to extract small code duplications (around 2 lines) into helper functions, considering the overhead not worth it for such minor repetition.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#102
File: README.md:62-66
Timestamp: 2025-06-19T17:03:03.639Z
Learning: Pratham-Mishra04 prefers using the implicit 'latest' tag for the maximhq/bifrost Docker image rather than pinning to specific versions.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#143
File: core/mcp.go:155-196
Timestamp: 2025-07-08T15:33:47.645Z
Learning: Pratham-Mishra04 prefers not to add explanatory comments for obvious code patterns, such as the unlock/lock strategy around network I/O operations, considering them self-explanatory to experienced developers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: docs/usage/go-package/mcp.md:408-412
Timestamp: 2025-07-01T12:40:08.576Z
Learning: Pratham-Mishra04 is okay with keeping bullet list formatting that uses colons after dashes in markdown documentation, even if it triggers linter warnings, preferring functionality over strict formatting rules.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
docs/usage/http-transport/integrations/genai-compatible.md (15)
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#103
File: .github/workflows/transport-dependency-update.yml:53-75
Timestamp: 2025-06-20T16:21:18.912Z
Learning: In the bifrost repository's transport dependency update workflow, when updating the core dependency to a new version using `go get`, the go.mod and go.sum files will always change in normal operation, making the safety check for changes more of a defensive programming practice rather than handling a common scenario.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#75
File: transports/bifrost-http/integrations/genai/types.go:109-117
Timestamp: 2025-06-14T08:54:58.137Z
Learning: In the Gemini/GenAI integration (transports/bifrost-http/integrations/genai/types.go), function calls don't have IDs, only names. Therefore, using the function name as ToolCallID is intentional and correct behavior, as Gemini's API doesn't provide call IDs.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#64
File: transports/bifrost-http/integrations/genai/types.go:273-313
Timestamp: 2025-06-09T16:35:26.914Z
Learning: In convertGenerationConfigToParams method in transports/bifrost-http/integrations/genai/types.go, pre-allocating the ExtraParams map is preferred over lazy allocation because the method has multiple potential ExtraParams assignments, making the computational overhead of conditional checks exceed the memory savings of an empty map.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#82
File: tests/transports-integrations/tests/integrations/test_litellm.py:97-115
Timestamp: 2025-06-16T09:16:15.634Z
Learning: In the Bifrost integration tests, the user prefers tests to fail hard when API keys are missing rather than using @skip_if_no_api_key decorators for graceful skipping. This applies to LiteLLM tests that depend on OpenAI API keys.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/tests/e2e_tool_test.go:29-30
Timestamp: 2025-06-04T04:58:12.239Z
Learning: In the Bifrost project, environment variables should be used only for secrets (like API keys), not for general configuration. Test parameters like provider and model can be hardcoded at the start of test files for predictability and consistency.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/config/account.go:55-101
Timestamp: 2025-06-16T04:25:00.816Z
Learning: In the Bifrost test account implementation, the user prefers to let Bifrost itself handle missing API key errors rather than adding early validation in the GetKeysForProvider method.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default), "any" (force use of at least one tool), and {"type": "tool", "name": "tool_name"} (force use of specific tool). Anthropic does NOT support "none" as a tool_choice value - there's no way to disable tool usage once tools are provided in the request.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default - Claude decides whether to use tools), "none" (disables tool usage entirely), "any" (forces Claude to use at least one tool), and {"type": "tool", "name": "tool_name"} (forces use of a specific tool). All of these values are officially supported by Anthropic's API.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:264-285
Timestamp: 2025-06-10T12:58:45.501Z
Learning: In the Bifrost OpenAI integration, tool calls should be allowed on any message role (not just assistant messages) and the downstream provider should handle validation. Users passing tool calls to non-assistant messages is considered deliberate behavior that should be preserved.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/scenarios/multiple_tool_calls.go:27-31
Timestamp: 2025-06-16T04:05:47.793Z
Learning: ParallelToolCalls parameter is not supported by many AI providers, so it should be avoided in cross-provider test suites to maintain compatibility across different providers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/cohere.go:250-253
Timestamp: 2025-06-04T04:29:56.660Z
Learning: Cohere's API only supports "REQUIRED" and "NONE" values for the tool_choice parameter, unlike other providers that may support function-specific tool choices.
🪛 LanguageTool
docs/usage/http-transport/integrations/genai-compatible.md

[grammar] ~268-~268: Use proper spacing conventions.
Context: ... ) ) ### **Generation Configuration** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Tell me a story", config=GenerateContentConfig( candidate_count=1, max_output_tokens=1000, temperature=0.7, top_p=0.8, top_k=40, stop_sequences=["END"] ) ) ### **Safety Settings** python from google...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~293-~293: Use proper spacing conventions.
Context: ...END"] ) ) ### **Safety Settings** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig, SafetySetting client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) safety_settings = [ SafetySetting( category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_MEDIUM_AND_ABOVE" ), SafetySetting( category="HARM_CATEGORY_HATE_SPEECH", threshold="BLOCK_MEDIUM_AND_ABOVE" ) ] response = client.models.generate_content( model="gemini-pro", contents="Your content here", config=GenerateContentConfig(safety_settings=safety_settings) ) ### **Error Handling** python from google ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~322-~322: Use proper spacing conventions.
Context: ...ty_settings) ) ### **Error Handling** python from google import genai from google.genai.types import HttpOptions from google.api_core import exceptions try: client = genai.Client( api_key=google_api_key, http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Hello!" ) except exceptions.InvalidArgument as e: print(f"Invalid argument: {e}") except exceptions.PermissionDenied as e: print(f"Permission denied: {e}") except Exception as e: print(f"Other error: {e}") ``` --- ## ⚡ Enhanced Features ### **Automatic MCP...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~392-~392: Use proper spacing conventions.
Context: ...ame}") ``` ### Multi-provider Support Use multiple providers with Google GenAI...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~394-~394: Use articles correctly.
Context: ... Support** Use multiple providers with Google GenAI SDK format by prefixing model nam...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~394-~394: Use proper spacing conventions.
Context: ...nAI SDK format by prefixing model names: python from google import genai from google.genai.types import HttpOptions client = genai.Client( api_key="dummy", # API keys configured in Bifrost http_options=HttpOptions(base_url="http://localhost:8080/genai") ) # Google models (default) response1 = client.models.generate_content( model="gemini-pro", contents="Hello!" ) # OpenAI models via GenAI SDK response2 = client.models.generate_content( model="openai/gpt-4o-mini", contents="Hello!" ) # Anthropic models via GenAI SDK response3 = client.models.generate_content( model="anthropic/claude-3-sonnet-20240229", contents="Hello!" ) ### Multi-provider Fallbacks Configure fa...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Graphite / mergeability_check

@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from b1c25e7 to 0809afd Compare July 8, 2025 15:48
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from c4a5cf0 to 5b9dccf Compare July 8, 2025 15:48
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from 0809afd to fe9b7fc Compare July 8, 2025 16:54
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch 2 times, most recently from b00cd2c to c2c9818 Compare July 8, 2025 17:14
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch from fe9b7fc to 6929183 Compare July 8, 2025 17:14
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from c2c9818 to edc8feb Compare July 8, 2025 17:34
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-06-docs_genai_integration_docs_fixes branch 2 times, most recently from 9bbbe6c to f0e87ea Compare July 8, 2025 18:05
@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore branch from edc8feb to b274c53 Compare July 8, 2025 18:05
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
docs/usage/http-transport/integrations/genai-compatible.md (1)

454-456: Inconsistent API style – falls back to deprecated GenerativeModel

The rest of the doc promotes the new client.models.generate_content pattern, but this fallback example reverts to genai.GenerativeModel. Stick to one style to avoid confusion unless you explicitly explain the coexistence.

♻️ Duplicate comments (3)
docs/usage/http-transport/integrations/genai-compatible.md (3)

355-360: GenerateContentConfig import still missing

You create a GenerateContentConfig object later in this snippet, but the import list omits it, leading to a NameError.

(Identical to a previous review—still unresolved.)


329-333: Undefined variable google_api_key – examples raise NameError

The error-handling snippet references google_api_key, but the variable is never defined, so users copying the code will get a runtime failure.

-from google import genai
-from google.genai.types import HttpOptions
+import os
+from google import genai
+from google.genai.types import HttpOptions
@@
-    client = genai.Client(
-        api_key=google_api_key,
+    google_api_key = os.getenv("GOOGLE_API_KEY") or "your-google-api-key"
+    client = genai.Client(
+        api_key=google_api_key,

488-497: Same google_api_key problem in compatibility test

google_api_key is used without definition in both client constructions, breaking the test.

-from google import genai
-from google.genai.types import HttpOptions
+import os
+from google import genai
+from google.genai.types import HttpOptions
@@
-    bifrost_client = genai.Client(
-        api_key=google_api_key,
+    google_api_key = os.getenv("GOOGLE_API_KEY") or "your-google-api-key"
+    bifrost_client = genai.Client(
+        api_key=google_api_key,
@@
-    google_client = genai.Client(
-        api_key=google_api_key
+    google_client = genai.Client(
+        api_key=google_api_key
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bbbe6c and f0e87ea.

📒 Files selected for processing (1)
  • docs/usage/http-transport/integrations/genai-compatible.md (6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#94
File: core/bifrost.go:823-845
Timestamp: 2025-06-18T15:15:51.323Z
Learning: In the Bifrost project, the team prioritizes maintaining consistent error handling patterns over exposing detailed error context. All errors should be wrapped in the standard `BifrostError` structure rather than creating specific error types or exposing richer error details like exit codes or stderr output.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:358-388
Timestamp: 2025-06-04T05:37:59.699Z
Learning: User Pratham-Mishra04 prefers not to extract small code duplications (around 2 lines) into helper functions, considering the overhead not worth it for such minor repetition.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#102
File: README.md:62-66
Timestamp: 2025-06-19T17:03:03.639Z
Learning: Pratham-Mishra04 prefers using the implicit 'latest' tag for the maximhq/bifrost Docker image rather than pinning to specific versions.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#143
File: core/mcp.go:155-196
Timestamp: 2025-07-08T15:33:47.645Z
Learning: Pratham-Mishra04 prefers not to add explanatory comments for obvious code patterns, such as the unlock/lock strategy around network I/O operations, considering them self-explanatory to experienced developers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: docs/usage/go-package/mcp.md:408-412
Timestamp: 2025-07-01T12:40:08.576Z
Learning: Pratham-Mishra04 is okay with keeping bullet list formatting that uses colons after dashes in markdown documentation, even if it triggers linter warnings, preferring functionality over strict formatting rules.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#148
File: transports/bifrost-http/lib/store.go:880-910
Timestamp: 2025-07-08T17:14:21.532Z
Learning: Pratham-Mishra04 prefers resilient system design where missing environment variables for MCP connections should not cause complete system failure. The system should continue processing other MCP connections even when some fail, maintaining partial functionality rather than implementing fail-fast behavior.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#138
File: transports/README.md:26-28
Timestamp: 2025-07-01T12:45:06.906Z
Learning: Pratham-Mishra04 prefers keeping documentation examples simple and concise, trusting users to handle production-specific considerations like version pinning themselves rather than cluttering examples with additional notes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#148
File: transports/bifrost-http/lib/store.go:1081-1098
Timestamp: 2025-07-08T17:16:50.780Z
Learning: Pratham-Mishra04 prefers practical redaction approaches over theoretical security improvements when the threat model is low-risk, such as admin-only interfaces in the Bifrost project. Fixed-length redaction is acceptable when only trusted administrators will see the redacted values.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#144
File: transports/bifrost-http/plugins/logging/utils.go:286-292
Timestamp: 2025-07-08T16:40:59.079Z
Learning: Pratham-Mishra04 prefers to keep simpler error handling patterns when errors are unlikely to occur in practice, such as safety checks in BadgerDB iterations where item.Value() is called on valid items. The user considers the overhead of explicit error handling not worth it in such scenarios.
docs/usage/http-transport/integrations/genai-compatible.md (16)
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:22-56
Timestamp: 2025-06-16T14:50:46.859Z
Learning: In the Google GenAI integration at transports/bifrost-http/integrations/genai/types.go, the manual URL-safe base64 decoding implementation (converting - to +, _ to /, and adding padding) is required because base64.RawURLEncoding.DecodeString fails for the specific url encoded bytes format being handled.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#54
File: core/schemas/provider.go:148-148
Timestamp: 2025-06-04T03:57:50.981Z
Learning: Breaking changes in the Bifrost codebase are managed by first merging and tagging core schema changes, then updating dependent code references in subsequent steps after the core version is released.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#89
File: transports/bifrost-http/integrations/genai/types.go:151-155
Timestamp: 2025-06-16T14:45:48.563Z
Learning: In transports/bifrost-http/integrations/genai/types.go, when SystemInstruction has an empty role, the user prefers to let the downstream provider (Google GenAI) handle validation and return errors, rather than implementing validation in the bifrost layer. This represents a design preference for delegating validation to the appropriate service rather than duplicating validation logic in the proxy layer.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:89-119
Timestamp: 2025-06-10T11:00:02.875Z
Learning: In the Bifrost OpenAI integration (transports/bifrost-http/integrations/openai/types.go), the convertOpenAIContent function currently only handles the last image URL when multiple images are present in a content array. The user Pratham-Mishra04 has acknowledged this limitation and indicated it's part of a larger architectural issue that will be addressed comprehensively later, rather than with piecemeal fixes.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#75
File: transports/bifrost-http/integrations/genai/types.go:109-117
Timestamp: 2025-06-14T08:54:58.137Z
Learning: In the Gemini/GenAI integration (transports/bifrost-http/integrations/genai/types.go), function calls don't have IDs, only names. Therefore, using the function name as ToolCallID is intentional and correct behavior, as Gemini's API doesn't provide call IDs.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#103
File: .github/workflows/transport-dependency-update.yml:53-75
Timestamp: 2025-06-20T16:21:18.912Z
Learning: In the bifrost repository's transport dependency update workflow, when updating the core dependency to a new version using `go get`, the go.mod and go.sum files will always change in normal operation, making the safety check for changes more of a defensive programming practice rather than handling a common scenario.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#144
File: transports/bifrost-http/handlers/providers.go:45-49
Timestamp: 2025-07-08T16:50:27.653Z
Learning: In the Bifrost project, breaking API changes are acceptable when features are not yet public. This applies to scenarios like changing struct fields from pointer to non-pointer types in request/response structures for unreleased features.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#64
File: transports/bifrost-http/integrations/genai/types.go:273-313
Timestamp: 2025-06-09T16:35:26.914Z
Learning: In convertGenerationConfigToParams method in transports/bifrost-http/integrations/genai/types.go, pre-allocating the ExtraParams map is preferred over lazy allocation because the method has multiple potential ExtraParams assignments, making the computational overhead of conditional checks exceed the memory savings of an empty map.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#82
File: tests/transports-integrations/tests/integrations/test_litellm.py:97-115
Timestamp: 2025-06-16T09:16:15.634Z
Learning: In the Bifrost integration tests, the user prefers tests to fail hard when API keys are missing rather than using @skip_if_no_api_key decorators for graceful skipping. This applies to LiteLLM tests that depend on OpenAI API keys.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/tests/e2e_tool_test.go:29-30
Timestamp: 2025-06-04T04:58:12.239Z
Learning: In the Bifrost project, environment variables should be used only for secrets (like API keys), not for general configuration. Test parameters like provider and model can be hardcoded at the start of test files for predictability and consistency.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/config/account.go:55-101
Timestamp: 2025-06-16T04:25:00.816Z
Learning: In the Bifrost test account implementation, the user prefers to let Bifrost itself handle missing API key errors rather than adding early validation in the GetKeysForProvider method.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default), "any" (force use of at least one tool), and {"type": "tool", "name": "tool_name"} (force use of specific tool). Anthropic does NOT support "none" as a tool_choice value - there's no way to disable tool usage once tools are provided in the request.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/anthropic.go:485-498
Timestamp: 2025-06-04T05:13:41.923Z
Learning: Anthropic's Claude API supports the following tool_choice parameter values: "auto" (default - Claude decides whether to use tools), "none" (disables tool usage entirely), "any" (forces Claude to use at least one tool), and {"type": "tool", "name": "tool_name"} (forces use of a specific tool). All of these values are officially supported by Anthropic's API.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#63
File: transports/bifrost-http/integrations/openai/types.go:264-285
Timestamp: 2025-06-10T12:58:45.501Z
Learning: In the Bifrost OpenAI integration, tool calls should be allowed on any message role (not just assistant messages) and the downstream provider should handle validation. Users passing tool calls to non-assistant messages is considered deliberate behavior that should be preserved.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#81
File: tests/core-providers/scenarios/multiple_tool_calls.go:27-31
Timestamp: 2025-06-16T04:05:47.793Z
Learning: ParallelToolCalls parameter is not supported by many AI providers, so it should be avoided in cross-provider test suites to maintain compatibility across different providers.
Learnt from: Pratham-Mishra04
PR: maximhq/bifrost#55
File: core/providers/cohere.go:250-253
Timestamp: 2025-06-04T04:29:56.660Z
Learning: Cohere's API only supports "REQUIRED" and "NONE" values for the tool_choice parameter, unlike other providers that may support function-specific tool choices.
🪛 LanguageTool
docs/usage/http-transport/integrations/genai-compatible.md

[grammar] ~268-~268: Use proper spacing conventions.
Context: ... ) ) ### **Generation Configuration** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Tell me a story", config=GenerateContentConfig( candidate_count=1, max_output_tokens=1000, temperature=0.7, top_p=0.8, top_k=40, stop_sequences=["END"] ) ) ### **Safety Settings** python from google...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~293-~293: Use proper spacing conventions.
Context: ...END"] ) ) ### **Safety Settings** python from google import genai from google.genai.types import HttpOptions, GenerateContentConfig, SafetySetting client = genai.Client( api_key="your-google-api-key", http_options=HttpOptions(base_url="http://localhost:8080/genai") ) safety_settings = [ SafetySetting( category="HARM_CATEGORY_HARASSMENT", threshold="BLOCK_MEDIUM_AND_ABOVE" ), SafetySetting( category="HARM_CATEGORY_HATE_SPEECH", threshold="BLOCK_MEDIUM_AND_ABOVE" ) ] response = client.models.generate_content( model="gemini-pro", contents="Your content here", config=GenerateContentConfig(safety_settings=safety_settings) ) ### **Error Handling** python from google ...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~322-~322: Use proper spacing conventions.
Context: ...ty_settings) ) ### **Error Handling** python from google import genai from google.genai.types import HttpOptions from google.api_core import exceptions try: client = genai.Client( api_key=google_api_key, http_options=HttpOptions(base_url="http://localhost:8080/genai") ) response = client.models.generate_content( model="gemini-pro", contents="Hello!" ) except exceptions.InvalidArgument as e: print(f"Invalid argument: {e}") except exceptions.PermissionDenied as e: print(f"Permission denied: {e}") except Exception as e: print(f"Other error: {e}") ``` --- ## ⚡ Enhanced Features ### **Automatic MCP...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~392-~392: Use proper spacing conventions.
Context: ...ame}") ``` ### Multi-provider Support Use multiple providers with Google GenAI...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~394-~394: Use articles correctly.
Context: ... Support** Use multiple providers with Google GenAI SDK format by prefixing model nam...

(QB_NEW_EN_OTHER_ERROR_IDS_000004)


[grammar] ~394-~394: Use proper spacing conventions.
Context: ...nAI SDK format by prefixing model names: python from google import genai from google.genai.types import HttpOptions client = genai.Client( api_key="dummy", # API keys configured in Bifrost http_options=HttpOptions(base_url="http://localhost:8080/genai") ) # Google models (default) response1 = client.models.generate_content( model="gemini-pro", contents="Hello!" ) # OpenAI models via GenAI SDK response2 = client.models.generate_content( model="openai/gpt-4o-mini", contents="Hello!" ) # Anthropic models via GenAI SDK response3 = client.models.generate_content( model="anthropic/claude-3-sonnet-20240229", contents="Hello!" ) ### Multi-provider Fallbacks Configure fa...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Graphite / mergeability_check

Copy link
Contributor

akshaydeo commented Jul 10, 2025

Merge activity

  • Jul 10, 2:14 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 10, 2:21 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo changed the base branch from 07-04-enhancement_added_plugin_pipeline_pool_and_bifrost.go_code_refactore to graphite-base/147 July 10, 2025 14:20
@akshaydeo akshaydeo changed the base branch from graphite-base/147 to main July 10, 2025 14:20
@akshaydeo akshaydeo merged commit a45fd0d into main Jul 10, 2025
2 checks passed
@akshaydeo akshaydeo deleted the 07-06-docs_genai_integration_docs_fixes branch August 31, 2025 17:28
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