Skip to content

mharrisb1/openai-responses-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧪🤖 openai-responses

Pytest plugin for automatically mocking OpenAI requests. Powered by RESPX.

sdk support

Note

This project is in maintenance mode unless I see an appetite for more community contributions. I built this because we at Definite needed a way to easily and quickly test the integration between openai-python and our codebase but we have moved on to other frameworks/SDKs. With that, my need and desire to work on this library has dropped significantly.

I will be encouraging community contributions to fill in the gap for some of the new features released since the last major update to this library such as evals, graders, containers, and all of the new administration endpoints.

Absent community contributions, if the work required just for maintenance mode becomes too much (>2 hours a month) then this project will be fully deprecated and archived.

Supported Endpoints

View full support coverage here.

Tip

✨ Support for creating streaming responses added in v0.4

Usage

Just decorate any test function that makes a call to the OpenAI API (either using openai-python or with HTTPX).

import openai

import openai_responses


@openai_responses.mock()
def test_create_assistant():
    client = openai.Client(api_key="sk-fake123")

    assistant = client.beta.assistants.create(
        instructions="You are a personal math tutor.",
        name="Math Tutor",
        tools=[{"type": "code_interpreter"}],
        model="gpt-4-turbo",
    )

    assert assistant.name == "Math Tutor"

See examples or docs for more.

Installation

PyPI version PyPI - Python Version PyPI - Downloads

Available on PyPI

pip install openai-responses

Documentation

Docs

See the documentation site for more info.

License

PyPI - License

See LICENSE for more info.

Contributing

Open Issues Stargazers

See CONTRIBUTING.md for info on PRs, issues, and feature requests.

Changelog

See CHANGELOG.md for summarized notes on changes or view releases for more details information on changes.