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 (for full conversation)
result = transformer.claude_json_to_openai_response(claude_response)
# Transform a single Claude response to OpenAI format (for individual messages)
single_result = transformer.single_claude_json_to_openai_response(single_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:
- Update the version in
setup.py - Build the package:
python setup.py sdist bdist_wheel
- Upload to Test PyPI first:
twine upload --repository testpypi dist/*
- Upload to PyPI:
twine upload dist/*
TODO
[] mapping claude code internal mcp to openai agent tools []
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_response_transformer-0.1.2.tar.gz.
File metadata
- Download URL: agent_response_transformer-0.1.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b014f9d1218313eb784486dd275c671058da1f04cc657f88dbca78fd8ecd559e
|
|
| MD5 |
a57932d07aa1ec5a55c3880f5ed1001a
|
|
| BLAKE2b-256 |
f0209f313ea4a8076c6f728287d82d9446e3660ce0f92c32e1fedfc0f76dfba7
|
File details
Details for the file agent_response_transformer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: agent_response_transformer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63b56fe6eb2093cf8e76da664e62b23fe4453a6291f3cd2fb801479c71b88a54
|
|
| MD5 |
bfc7a7822c202689afd6b061634a57bc
|
|
| BLAKE2b-256 |
c99adb02c13dcbcbe58ad077b8a0af49e601c0720f6d3996d81f9b5d31ade2d1
|