Skip to content

Conversation

@akshaydeo
Copy link
Contributor

@akshaydeo akshaydeo commented Dec 16, 2025

Summary

Added Stainless SDK configuration and generated client libraries for multiple programming languages to enable API access to Bifrost.

Changes

  • Added Stainless configuration files (.stainless/stainless.yml and .stainless/workspace.json)
  • Configured SDK generation for TypeScript, Python, Go, Kotlin, and Ruby
  • Added generated SDK submodules in the sdks/ directory
  • Defined API resources and endpoints for chat completions, text completions, MCP tools, audio processing, and admin functionality
  • Set up authentication using bearer tokens

Type of change

  • Feature
  • Documentation

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Docs

How to test

To test the SDKs, clone the repository with submodules and use the appropriate SDK for your language:

# Clone with submodules
git clone --recurse-submodules https://github.com/maximhq/bifrost.git

# For TypeScript
cd sdks/typescript
npm install
npm test

# For Python
cd sdks/python
pip install -e .
pytest

# For Go
cd sdks/go
go test ./...

Breaking changes

  • No

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

  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Added multi-target SDK generation configuration covering TypeScript, Python, Go, Kotlin, and Ruby with per-language targets and repository mappings, environment and publish settings, comprehensive resource and management API definitions, client auth/base-URL settings and security scheme, Prism mock test and license settings, plus README request templates.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds Stainless SDK generation configs for a multi-target SDK: .stainless/stainless.yml defines targets, resources, client settings, and security; .stainless/workspace.json maps the "bifrost" project to OpenAPI and per-language SDK repository targets. (50 words)

Changes

Cohort / File(s) Summary
Stainless configuration
/.stainless/stainless.yml
New comprehensive multi-target SDK config: top-level keys (edition, organization, targets, environments, resources, settings, client_settings, security_schemes, security, readme). Adds target-specific language settings (TypeScript, Python, Go, Kotlin, Ruby), publish options, environments, detailed resources (chat, completions, embeddings, models, responses, audio, mcp, batches, files, api management, health, utilities) with nested subresources/models/methods, Prism mock settings, and README templates.
Workspace metadata
/.stainless/workspace.json
New workspace file for project "bifrost": references OpenAPI spec (../docs/openapi/openapi.json), Stainless config (stainless.yml), and maps output SDK repositories for go, kotlin, python, ruby, and typescript.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I found a YAML, crisp and neat,

Targets lined up, a multi-lang feat.
Repos and schemas all in a row,
SDK seeds planted — watch them grow! 🌱

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title '[Experiment] sdks using stainless' is vague and generic; it uses the non-descriptive term '[Experiment]' and doesn't clearly convey the main change despite referencing SDKs. Refine the title to be more specific and descriptive, such as 'Add Stainless SDK configuration for multi-language code generation' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is mostly complete with summary, changes, type of change, affected areas, testing instructions, and security considerations filled in appropriately.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 944ae1a and 2cfdfe7.

📒 Files selected for processing (2)
  • .stainless/stainless.yml
  • .stainless/workspace.json

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

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1108

@akshaydeo akshaydeo force-pushed the 12-16-sdks_using_stainless branch from 5b8a93b to 03f147f Compare January 2, 2026 19:42
@akshaydeo akshaydeo marked this pull request as ready for review January 2, 2026 19:42
@akshaydeo akshaydeo force-pushed the 12-16-sdks_using_stainless branch 2 times, most recently from 8b905ec to 8b2b5c4 Compare January 2, 2026 20:15
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

🧹 Nitpick comments (2)
.stainless/stainless.yml (2)

8-15: Consider adding a contact email.

The contact field 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 default and headline example 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

📥 Commits

Reviewing files that changed from the base of the PR and between c5c9e1c and 8b905ec.

📒 Files selected for processing (7)
  • .stainless/stainless.yml
  • .stainless/workspace.json
  • sdks/go
  • sdks/kotlin
  • sdks/python
  • sdks/ruby
  • sdks/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/typescript
  • sdks/go
  • sdks/kotlin
  • sdks/python
  • sdks/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/ruby does not contain a commit SHA reference, no .gitmodules file exists, and no git submodule configuration is present. The sdks/ruby directory is empty. The Ruby SDK is already configured in .stainless/stainless.yml with 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 edition go.2025-10-08 and production repository). However, to ensure traceability and reproducibility:

  1. Confirm that commit 9800790435bee68234f4f0d19d6d8c8e7dc3ea74 exists 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.
  2. 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 .gitmodules file.

Adding five SDK submodules (Go, Kotlin, Python, Ruby, TypeScript) without a .gitmodules file will cause issues during cloning and initialization. Create a .gitmodules file at the repository root that specifies the path and URL for each submodule, then run git add .gitmodules to 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 .gitmodules file exists). These SDK directories are configured in .stainless/workspace.json as 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 0d667bb2059f140adb5539189838582b7f6dc15f exists 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_key is configured as nullable: 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 to false if all endpoints require authentication.

.stainless/workspace.json (1)

1-22: OpenAPI specification path is valid and properly configured. The file exists at docs/openapi/openapi.json and contains a valid OpenAPI 3.1.0 specification for Bifrost API v1.0.0. No action needed.

@akshaydeo akshaydeo force-pushed the 12-16-sdks_using_stainless branch from 8b2b5c4 to 944ae1a Compare January 2, 2026 20:19
@akshaydeo akshaydeo changed the title sdks using stainless [Experiment] sdks using stainless Jan 2, 2026
@akshaydeo akshaydeo force-pushed the 12-16-sdks_using_stainless branch from 944ae1a to 2cfdfe7 Compare January 2, 2026 20:34
@akshaydeo akshaydeo merged commit 002885e into main Jan 2, 2026
7 checks passed
@akshaydeo akshaydeo deleted the 12-16-sdks_using_stainless branch January 2, 2026 20:34
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

♻️ 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 contact field 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 default and headline examples 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

📥 Commits

Reviewing files that changed from the base of the PR and between e3bc59b and 944ae1a.

📒 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 maximhq organization. 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_key is nullable (line 198), which allows unauthenticated SDK instantiation—verify this aligns with your API's authentication requirements for public vs. protected endpoints.

Comment on lines +1 to +22
{
"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"
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 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
fi

Repository: 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).

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