Skip to main content

🧪🤖 openai-responses

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

sdk support

Supported Endpoints

View full support coverage here.

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.

Metadata

Release files for openai-responses 0.13.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openai-responses 0.13.1
File Size Uploaded
openai_responses-0.13.1.tar.gz 25.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openai-responses 0.13.1
File Interpreter ABI Platform
openai_responses-0.13.1-py3-none-any.whl Python 3 none any Details

Total release size: 77.1 kB

Release files / openai_responses-0.13.1.tar.gz

Download URL openai_responses-0.13.1.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d0bc5f02e9fd355fed5d25794fa1aed548da23c5e8d7175bd8d37ab75482ee05
BLAKE2b-256 checksum
How to use checksums
62d419bf1411dbd8eaa84316b14197424018a051874c2a1271582bec67a6fd70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.11.2 Linux/6.1.0-37-amd64

Release files / openai_responses-0.13.1-py3-none-any.whl

Download URL openai_responses-0.13.1-py3-none-any.whl
Size 51.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5fc7fb15f546b551757864c1dfaeb01b8a4fc0c353961bd6d0d45ff26389721
BLAKE2b-256 checksum
How to use checksums
089850c755503a55550f170d0211297bc8791b8bf10bf04cb16b4b95ca71d1e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.11.2 Linux/6.1.0-37-amd64
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page