Skip to main content

A Python SDK to transform Claude response to OpenAI response format

Project description

Agent Response Transformer

A Python SDK to transform Claude response to OpenAI response format.

Installation

Install the package via pip:

pip install agent-response-transformer

Usage

from agent_response_transformer import ResponseTransformer

# Create an instance of the transformer
transformer = ResponseTransformer()

# Transform Claude response to OpenAI format
result = transformer.claude_json_to_openai_response(claude_response)

Features

  • Transform Claude response format to OpenAI response format
  • Support for text content and function calls
  • Proper handling of tool usage and results

Development

To install the package in development mode:

pip install -e .

Dependencies

The package has no direct dependencies. However, when using this package in your projects, you may need to install:

  • openai
  • agents (if it's a separate package)

For development, you can install all dependencies using:

pip install -r requirements.txt

Publishing to PyPI

To publish a new version to PyPI:

  1. Update the version in setup.py
  2. Build the package:
    python setup.py sdist bdist_wheel
    
  3. Upload to Test PyPI first:
    twine upload --repository testpypi dist/*
    
  4. Upload to PyPI:
    twine upload dist/*
    

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_response_transformer-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_response_transformer-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file agent_response_transformer-0.1.0.tar.gz.

File metadata

File hashes

Hashes for agent_response_transformer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 047c78f40b7ec537bea3d7772624cdea8aec2ea4abcd42b642419de763ecbf54
MD5 241c82e0e55343ac564db25699847b48
BLAKE2b-256 3d9968d13273c8cb097ed3925b934e0a74c9059560e58f1b8b38b574f975c26e

See more details on using hashes here.

File details

Details for the file agent_response_transformer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_response_transformer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac4746745ff6c58545a008f4599008ba03d299220cca38cde88fbf34f53bca94
MD5 ed468cdd7cd5f0832c71740eb7775bf5
BLAKE2b-256 d15f795845225be4923463df75009ac2a43dd2badee3d500ae67b442703810eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page