Declarative agent prototype: Add OpenResponses streaming format support to AI SDK provider#335
Open
smurching wants to merge 3 commits intodatabricks:mainfrom
Open
Conversation
Add OpenResponsesLanguageModel to support agent apps that return OpenResponses SSE format (https://github.com/databricks/openresponses). This moves OpenResponses support from individual consumer apps into the shared AI SDK provider library, making it available to all TypeScript/ JavaScript consumers of the Databricks AI Bridge. Changes: - Add open-responses-language-model module with schema, conversion, and streaming - Export OpenResponses schemas and utilities for consumer use - Follow existing pattern (parallel to responses-agent-language-model) - Add comprehensive test coverage (10 tests, all passing) - Bump version to 0.5.0 Architecture: - Zod schemas for event validation - SSE stream transformer for format conversion - AI SDK v3 LanguageModel implementation - Full streaming and non-streaming support Usage: const provider = createDatabricksProvider({...}); const model = provider.openResponses('agent-endpoint'); const result = await streamText({ model, messages }); Testing: - All 248 tests passing (including 10 new OpenResponses tests) - Schema validation tests - Stream conversion tests Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add a root package.json that proxies to the ai-sdk-provider subdirectory, enabling direct installation from GitHub branches for prototyping. This allows consumers to test unreleased changes by installing directly from the PR branch: npm install git+https://github.com/smurching/databricks-ai-bridge.git#feature/add-openresponses-support The prepare script automatically builds the package after git install. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add OpenResponsesLanguageModel to the AI SDK provider to support agent apps that return OpenResponses SSE format.
This moves OpenResponses support from individual consumer apps (like e2e-chatbot-app-next) into the shared library, making it available to all TypeScript/JavaScript consumers.
Related Issue: Improves architecture for OpenResponses streaming support
Specification: https://github.com/databricks/openresponses
Changes
New Module:
open-responses-language-model/open-responses-schema.ts- Zod schemas for event validation (text delta, item done, error)open-responses-api-types.ts- TypeScript types for request/responseopen-responses-convert-to-input.ts- AI SDK → OpenResponses format conversionopen-responses-convert-to-message-parts.ts- OpenResponses → AI SDK stream partsopen-responses-stream-transformer.ts- SSE stream parser and transformeropen-responses-language-model.ts- Main LanguageModelV3 implementationUpdated Files
databricks-provider.ts- AddedopenResponses()methodindex.ts- Export schemas, types, and utilitiespackage.json- Bumped version to 0.5.0Tests
open-responses.test.ts- 10 comprehensive tests for schema validation and conversionArchitecture
Follows the same pattern as existing implementations (
responses-agent-language-model,fmapi-language-model):Benefits
Testing
Follow-up
After this PR merges, we can update consumer apps (like e2e-chatbot-app-next) to use
@databricks/ai-sdk-provider@^0.5.0and remove their embedded OpenResponses implementations.Companion PR: databricks/app-templates@main...smurching:app-templates:feature/openresponses-support
🤖 Generated with Claude Code