-
Notifications
You must be signed in to change notification settings - Fork 159
[Experiment] sdks using stainless #1108
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
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds Stainless SDK generation configs for a multi-target SDK: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Comment |
🧪 Test Suite AvailableThis PR can be tested by a repository admin. |
5b8a93b to
03f147f
Compare
8b905ec to
8b2b5c4
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
🧹 Nitpick comments (2)
.stainless/stainless.yml (2)
8-15: Consider adding a contact email.The
contactfield is currently empty. Providing a contact email can help users report bugs or request support for the SDK.
213-222: Consider adding example parameters for README code snippets.Both
defaultandheadlineexample requests have empty parameters (params: {}). Providing realistic example parameters would improve the SDK documentation and help developers understand how to use the API.💡 Example with sample parameters
readme: example_requests: default: type: request endpoint: post /v1/chat/completions - params: {} + params: + model: "gpt-4" + messages: + - role: "user" + content: "Hello, how are you?" headline: type: request endpoint: post /v1/chat/completions - params: {} + params: + model: "gpt-4" + messages: + - role: "user" + content: "Hello, how are you?"
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.stainless/stainless.yml.stainless/workspace.jsonsdks/gosdks/kotlinsdks/pythonsdks/rubysdks/typescript
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
always check the stack if there is one for the current PR. do not give localized reviews for the PR, always see all changes in the light of the whole stack of PRs (if there is a stack, if there is no stack you can continue to make localized suggestions/reviews)
Files:
sdks/typescriptsdks/gosdks/kotlinsdks/pythonsdks/ruby
🔇 Additional comments (8)
sdks/ruby (1)
1-1: Remove this review comment—it references a file and configuration that do not exist.The file
sdks/rubydoes not contain a commit SHA reference, no.gitmodulesfile exists, and no git submodule configuration is present. Thesdks/rubydirectory is empty. The Ruby SDK is already configured in.stainless/stainless.ymlwith the production repository reference; no additional submodule setup is needed or implemented.Likely an incorrect or invalid review comment.
sdks/go (1)
1-1: Verify go SDK commit is traceable and document the generation details.The go SDK submodule pointer update aligns with the Stainless configuration in
.stainless/stainless.yml(which explicitly defines the Go target with editiongo.2025-10-08and production repository). However, to ensure traceability and reproducibility:
- Confirm that commit
9800790435bee68234f4f0d19d6d8c8e7dc3ea74exists in the production repository (https://github.com/maximhqhq/bifrost-go-sdk) and is the direct output of running the Stainless generator with the current config.- Add details to the commit message or PR description explaining what changed in this SDK version (e.g., which API endpoints were added/modified, schema changes, or generation parameter updates), since the commit message "sdks using stainless" is minimal.
This is especially important given that all five SDKs (Go, Python, TypeScript, Kotlin, Ruby) are being updated together—documenting the changes provides clarity for SDK consumers.
sdks/kotlin (1)
1-1: Ensure all SDK submodules are properly configured with a.gitmodulesfile.Adding five SDK submodules (Go, Kotlin, Python, Ruby, TypeScript) without a
.gitmodulesfile will cause issues during cloning and initialization. Create a.gitmodulesfile at the repository root that specifies the path and URL for each submodule, then rungit add .gitmodulesto include it in the commit.Likely an incorrect or invalid review comment.
sdks/python (1)
1-1: sdks/python is a directory, not a git submodule file.This is an empty output directory for the Python SDK, not a git submodule metadata file. The repository does not use git submodules (no
.gitmodulesfile exists). These SDK directories are configured in.stainless/workspace.jsonas output targets for the Stainless code generation tool, which generates SDKs from the OpenAPI specification defined in the Stainless configuration.Likely an incorrect or invalid review comment.
sdks/typescript (1)
1-1: Verify the TypeScript SDK submodule commit hash is accessible.This file contains a git submodule pointer to a specific commit. Ensure that the commit
0d667bb2059f140adb5539189838582b7f6dc15fexists and is accessible in the TypeScript SDK repository, and that the submodule is properly initialized as documented.Also note: The actual Stainless configuration files (
.stainless/stainless.yml,.stainless/workspace.json) mentioned in the PR objectives are not included in the provided files for this review. A comprehensive review of the SDK generation setup, API resource definitions, and authentication configuration would benefit from reviewing those configuration files and the generated SDK code..stainless/stainless.yml (2)
64-180: Well-structured API resource organization.The resource configuration is comprehensive and well-organized with proper nesting of subresources. The structure includes all major API endpoints mentioned in the PR objectives (chat completions, text completions, MCP tools, audio processing, and admin functionality).
193-200: Verify nullable API key aligns with authentication requirements.The
api_keyis configured asnullable: true, which allows SDK clients to be instantiated without providing an API key. Confirm this is intentional if certain endpoints support unauthenticated access, or set tofalseif all endpoints require authentication..stainless/workspace.json (1)
1-22: OpenAPI specification path is valid and properly configured. The file exists atdocs/openapi/openapi.jsonand contains a valid OpenAPI 3.1.0 specification for Bifrost API v1.0.0. No action needed.
8b2b5c4 to
944ae1a
Compare
944ae1a to
2cfdfe7
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
♻️ Duplicate comments (1)
.stainless/stainless.yml (1)
56-57: Production environment still points to localhost.This issue was flagged in a previous review and remains unaddressed. The production environment is set to
http://localhost:8080, which will cause generated SDKs to default to localhost, breaking functionality for end users.
🧹 Nitpick comments (2)
.stainless/stainless.yml (2)
14-15: Consider adding a contact email.The
contactfield is empty. While optional, providing a contact email helps SDK users report issues or seek support.
217-226: Consider adding example params for README snippets.Both
defaultandheadlineexamples use empty params ({}). This will generate README code samples with empty request bodies, which may not be immediately runnable. Consider adding minimal example parameters (e.g.,model,messages) to demonstrate typical usage.🔎 Example improvement
readme: example_requests: default: type: request endpoint: post /v1/chat/completions - params: {} + params: + model: "gpt-4" + messages: + - role: "user" + content: "Hello!" headline: type: request endpoint: post /v1/chat/completions - params: {} + params: + model: "gpt-4" + messages: + - role: "user" + content: "Hello!"
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.stainless/stainless.yml.stainless/workspace.json
🔇 Additional comments (3)
.stainless/stainless.yml (3)
19-52: Target configurations look correct.The production repository URLs now correctly use the
maximhqorganization. Publishing is appropriately disabled for all package registries during initial setup.
182-189: Settings are reasonable for initial setup.Disabling mock tests initially is pragmatic given potential Prism server issues. Consider re-enabling tests (
disable_mock_tests: false) once the SDK stabilizes and OpenAPI spec is validated.
191-212: Client settings and security are properly configured.Bearer token authentication is correctly set up with environment variable support. Note that
api_keyis nullable (line 198), which allows unauthenticated SDK instantiation—verify this aligns with your API's authentication requirements for public vs. protected endpoints.
| { | ||
| "project": "bifrost", | ||
| "openapi_spec": "../docs/openapi/openapi.json", | ||
| "stainless_config": "stainless.yml", | ||
| "targets": { | ||
| "go": { | ||
| "output_path": "https://github.com/maximhq/bifrost-go-sdk" | ||
| }, | ||
| "kotlin": { | ||
| "output_path": "https://github.com/maximhq/bifrost-kotlin-sdk" | ||
| }, | ||
| "python": { | ||
| "output_path": "https://github.com/maximhq/bifrost-python-sdk" | ||
| }, | ||
| "ruby": { | ||
| "output_path": "https://github.com/maximhq/bifrost-ruby-sdk" | ||
| }, | ||
| "typescript": { | ||
| "output_path": "https://github.com/maximhq/bifrost-ts-sdk" | ||
| } | ||
| } | ||
| } |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the OpenAPI spec file exists at the path relative to .stainless directory
if [ -f "docs/openapi/openapi.json" ]; then
echo "✓ OpenAPI spec found at docs/openapi/openapi.json"
# Show first few lines to confirm it's valid JSON
head -20 docs/openapi/openapi.json | jq '.' 2>/dev/null && echo "✓ Valid JSON" || echo "✗ Invalid JSON"
else
echo "✗ OpenAPI spec NOT found at docs/openapi/openapi.json"
# Search for openapi files
echo "Searching for openapi files..."
fd -e json -e yaml -e yml openapi
fiRepository: maximhq/bifrost
Length of output: 123
OpenAPI spec file must be valid JSON.
The workspace configuration references an OpenAPI spec at docs/openapi/openapi.json, but the file is not valid JSON and cannot be parsed. Stainless will fail to process this configuration until the OpenAPI spec is corrected.
Verify the contents of docs/openapi/openapi.json and ensure it contains properly formatted JSON.
🤖 Prompt for AI Agents
.stainless/workspace.json lines 1-22: the workspace references
docs/openapi/openapi.json but that file is invalid JSON; open
docs/openapi/openapi.json, locate and fix the JSON syntax errors (missing
commas, trailing commas, unescaped characters, mismatched quotes/brackets, or
comments), validate the file with a JSON linter or `jq`/online validator until
it parses successfully, ensure it is a valid OpenAPI JSON document (required
fields and correct structure) and then commit the corrected file (or update the
workspace path if the spec location is different).

Summary
Added Stainless SDK configuration and generated client libraries for multiple programming languages to enable API access to Bifrost.
Changes
.stainless/stainless.ymland.stainless/workspace.json)sdks/directoryType of change
Affected areas
How to test
To test the SDKs, clone the repository with submodules and use the appropriate SDK for your language:
Breaking changes
Related issues
Implements API client libraries for programmatic access to Bifrost services.
Security considerations
The SDKs use bearer token authentication. API keys should be handled securely and not committed to source control.
Checklist