-
Notifications
You must be signed in to change notification settings - Fork 63
docs: update Google GenAI SDK examples to use new client API #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThe 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
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings
docs/usage/http-transport/integrations/genai-compatible.md (20)
🪛 LanguageTooldocs/usage/http-transport/integrations/genai-compatible.md[grammar] ~268-~268: Use correct spacing (QB_NEW_EN_OTHER_ERROR_IDS_5) [grammar] ~293-~293: Use correct spacing (QB_NEW_EN_OTHER_ERROR_IDS_5) [grammar] ~322-~322: Use correct spacing (QB_NEW_EN_OTHER_ERROR_IDS_5) [grammar] ~392-~392: Use correct spacing (QB_NEW_EN_OTHER_ERROR_IDS_5) [grammar] ~394-~394: Use articles correctly (QB_NEW_EN_OTHER_ERROR_IDS_11) [grammar] ~394-~394: Use correct spacing (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)
🔇 Additional comments (1)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 newClient
APIThis “Multi-provider Support” snippet still relies on the legacy
genai.configure()
+GenerativeModel
pattern, contradicting the earlier docs (and PR goal) that migrate to the explicitgenai.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 missingGenerateContentConfig
import in testing snippetThe 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
📒 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.
ca968a6
to
f36731b
Compare
20c29fd
to
cf8d144
Compare
There was a problem hiding this 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 newClient
APIThis block still shows the legacy
genai.configure()
/GenerativeModel
flow, contradicting the rest of the doc (and the PR objective of switching togenai.Client
). Recommend rewriting to remain consistent and avoid confusing users.
♻️ Duplicate comments (2)
docs/usage/http-transport/integrations/genai-compatible.md (2)
329-333
: Definegoogle_api_key
before use – prevents immediateNameError
This snippet still references
google_api_key
without declaring it. Anyone copy-pasting the example will crash before reaching the API call.
355-360
: AddGenerateContentConfig
to the import list
GenerateContentConfig
is used a few lines below (config=GenerateContentConfig(...)
) but is not imported, resulting inNameError
.-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
📒 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.
f36731b
to
7294f5c
Compare
cf8d144
to
55fae75
Compare
7294f5c
to
a23ecf9
Compare
55fae75
to
c965706
Compare
There was a problem hiding this 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 deprecatedgenai.configure()
The rest of the document promotes the new
genai.Client
pattern. Mixing the old globalgenai.configure()
/GenerativeModel
approach here is confusing. Consider rewriting this example withgenai.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 raiseNameError
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 unresolvedThis 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
: MissingGenerateContentConfig
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
📒 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
a23ecf9
to
dbad725
Compare
c965706
to
a1bdadd
Compare
dbad725
to
c4a5cf0
Compare
a1bdadd
to
b1c25e7
Compare
There was a problem hiding this 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 consistencyThe 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 examplesAll three snippets reference
google_api_key
without defining it first, causing aNameError
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
📒 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
b1c25e7
to
0809afd
Compare
c4a5cf0
to
5b9dccf
Compare
0809afd
to
fe9b7fc
Compare
b00cd2c
to
c2c9818
Compare
fe9b7fc
to
6929183
Compare
c2c9818
to
edc8feb
Compare
9bbbe6c
to
f0e87ea
Compare
edc8feb
to
b274c53
Compare
There was a problem hiding this 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 deprecatedGenerativeModel
The rest of the doc promotes the new
client.models.generate_content
pattern, but this fallback example reverts togenai.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 missingYou create a
GenerateContentConfig
object later in this snippet, but the import list omits it, leading to aNameError
.(Identical to a previous review—still unresolved.)
329-333
: Undefined variablegoogle_api_key
– examples raiseNameError
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
: Samegoogle_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
📒 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
b274c53
to
56a50ff
Compare
f0e87ea
to
8991e0d
Compare
Merge activity
|
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:
import google.generativeai as genai
withfrom google import genai
genai.configure()
togenai.Client()
genai.GenerativeModel()
withclient.models.generate_content()
HttpOptions
,GenerateContentConfig
, andSafetySetting
Tool
andFunctionDeclaration
classesThese changes ensure the documentation reflects the current Google GenAI SDK interface while maintaining compatibility with Bifrost.