Metadata-Version: 2.4
Name: meshagent-openai
Version: 0.8.2
Summary: OpenAI Building Blocks for Meshagent
License-Expression: Apache-2.0
Project-URL: Documentation, https://docs.meshagent.com
Project-URL: Website, https://www.meshagent.com
Project-URL: Source, https://www.meshagent.com
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyjwt~=2.10
Requires-Dist: pytest~=8.4
Requires-Dist: pytest-asyncio~=0.26
Requires-Dist: openai~=2.6.0
Requires-Dist: meshagent-api~=0.8.2
Requires-Dist: meshagent-agents~=0.8.2
Requires-Dist: meshagent-tools~=0.8.2
Dynamic: license-file

# [Meshagent](https://www.meshagent.com)

## MeshAgent OpenAI
The ``meshagent.openai`` package provides adapters to integrate OpenAI models with MeshAgent tools and agents. 

### Completions Adapter and Responses Adapter
MeshAgent supports both the OpenAI Chat Completions API and Responses API. It is recommended to use the Responses adapter given the newer OpenAI models and functionality use the Responses adapter.

- ``OpenAICompletionsAdapter``: wraps the OpenAI Chat Completions API. It turns Toolkit objects into OpenAI-style tool definitions and processes tool calls appropriately.
- ``OpenAIResponsesAdapter``: wraps the newer OpenAI Responses API. It collects tools, handles streaming events, and provides callbacks for advanced features like image generation or web search. 

```Python Python
from meshagent.openai import OpenAIResponsesAdapter
from openai import AsyncOpenAI

# Use an OpenAI client inside a MeshAgent LLMAdapter
adapter = OpenAIResponsesAdapter(client=AsyncOpenAI(api_key="sk-..."))
```

### Tool Response Adapter
The ``OpenAICompletionsToolResponseAdapter`` and ``OpenAIResponsesToolResponseAdapter``convert a tool's structured response into plain text or JSOn that can beinserted into an OpenAI chat context. 

---
### Learn more about MeshAgent on our website or check out the docs for additional examples!

**Website**: [www.meshagent.com](https://www.meshagent.com/)

**Documentation**: [docs.meshagent.com](https://docs.meshagent.com/)

---
