Skip to content

Conversation

@Pratham-Mishra04
Copy link
Collaborator

@Pratham-Mishra04 Pratham-Mishra04 commented Oct 6, 2025

Summary

Add support for OpenAI's Responses API and improve model handling in text completions.

Changes

  • Added open_ai_use_responses_api column to the keys table via a new database migration
  • Set Object field to "response" when converting to responses-only format
  • Updated text completion request to properly parse model strings with provider information
  • Enhanced logging plugin to handle responses from the Responses API
  • Set default APP_DIR to "temp-something-new" in Makefile

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Test the OpenAI Responses API integration:

# Run with the new APP_DIR setting
make run

# Test text completion with model parsing
curl -X POST http://localhost:8080/v1/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/gpt-3.5-turbo", "prompt": "Hello, world!"}'

# Verify responses API format
curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/gpt-4", "messages": [{"role": "user", "content": "Hello"}]}'

Breaking changes

  • Yes
  • No

Related issues

Implements support for OpenAI's Responses API format

Security considerations

No significant security implications.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@Pratham-Mishra04 Pratham-Mishra04 marked this pull request as ready for review October 6, 2025 05:10
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added new chat request options: reasoning effort, response format, and safety identifier.
    • Enhanced telemetry with richer request/response attributes, detailed token usage, and improved cost tracking.
    • Logging now captures final output message and tool calls from generic response payloads.
    • New configuration flag to enable OpenAI Responses API per key.
  • Bug Fixes

    • More reliable streaming cleanup and synchronization across chat, audio, and transcription.
    • Finish reason is now propagated on final chat chunks.
    • Consistent handling of stop sequences across providers.
  • Refactor

    • Improved model parsing and request mapping.
    • Simplified span emission logic.
  • Chores

    • Dependency updates and module housekeeping.
    • Plugin reload/remove keeps in-memory and tracked states in sync.
    • Minor UI accessibility improvement (tab buttons).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 10-06-fix_openai_use_responses_column_migration_added_and_minor_fixes

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6110981 and dac84bd.

⛔ Files ignored due to path filters (2)
  • plugins/logging/go.sum is excluded by !**/*.sum
  • plugins/otel/go.sum is excluded by !**/*.sum
📒 Files selected for processing (27)
  • core/schemas/chatcompletions.go (6 hunks)
  • core/schemas/mux.go (1 hunks)
  • core/schemas/providers/anthropic/chat.go (1 hunks)
  • core/schemas/providers/anthropic/responses.go (2 hunks)
  • core/schemas/providers/bedrock/responses.go (1 hunks)
  • core/schemas/providers/cohere/responses.go (1 hunks)
  • core/schemas/providers/openai/text.go (1 hunks)
  • core/schemas/utils.go (0 hunks)
  • framework/configstore/migrations.go (2 hunks)
  • framework/streaming/accumulator.go (1 hunks)
  • framework/streaming/audio.go (2 hunks)
  • framework/streaming/chat.go (2 hunks)
  • framework/streaming/transcription.go (1 hunks)
  • plugins/logging/go.mod (3 hunks)
  • plugins/logging/main.go (1 hunks)
  • plugins/otel/converter.go (2 hunks)
  • plugins/otel/go.mod (1 hunks)
  • plugins/otel/grpc.go (1 hunks)
  • plugins/otel/main.go (2 hunks)
  • tests/core-providers/scenarios/multiple_images.go (1 hunks)
  • tests/core-providers/scenarios/reasoning.go (2 hunks)
  • tests/core-providers/scenarios/response_validation.go (3 hunks)
  • tests/core-providers/scenarios/utils.go (7 hunks)
  • transports/bifrost-http/handlers/server.go (2 hunks)
  • transports/bifrost-http/integrations/anthropic/types.go (0 hunks)
  • transports/bifrost-http/integrations/openai/types.go (0 hunks)
  • ui/app/teams-customers/page.tsx (2 hunks)

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

Copy link
Collaborator Author

Pratham-Mishra04 commented Oct 6, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@Pratham-Mishra04 Pratham-Mishra04 force-pushed the 10-06-fix_openai_use_responses_column_migration_added_and_minor_fixes branch from 86a0cd7 to dac84bd Compare October 6, 2025 05:11
@akshaydeo akshaydeo force-pushed the 09-15-seggreate_http_server_into_a_separate_struct branch from feddb47 to 6110981 Compare October 6, 2025 05:28
@akshaydeo akshaydeo closed this Oct 6, 2025
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.

3 participants