Skip to content

Conversation

@simonx1
Copy link
Contributor

@simonx1 simonx1 commented Mar 12, 2025

Add support for OpenAI Responses API

This PR adds support for OpenAI's Responses API, which is their most advanced interface for generating model responses. The API supports text and image inputs with text outputs, and allows for stateful interactions using previous response IDs.

Features added:

  • Basic client method for making requests to /responses endpoint
  • Support for follow-up messages (similar to the former threads functionality in the Assistant API)
  • Tool calling functionality
  • Streaming capability with both proc and callable object support
  • Comprehensive test coverage with VCR cassettes

Documentation:

  • Added Responses API section to the README with examples for:
    • Basic usage
    • Follow-up messages
    • Tool calls
    • Streaming

This implementation follows the same patterns used throughout the rest of the gem for consistency.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?

@simonx1 simonx1 changed the title Added new Responses API Add new Responses API endpoint Mar 12, 2025
@alexrudall
Copy link
Owner

Legend @simonx1. Will aim to get this released tomorrow

@MilanVilov
Copy link

Great job!

Copy link

@jeduardo824 jeduardo824 left a comment

Choose a reason for hiding this comment

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

❤️

@SerhiiBorozenets
Copy link

Cool, thanks!

@alexrudall alexrudall merged commit 9e236ff into alexrudall:main Mar 14, 2025
7 checks passed
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.

5 participants