Skip to main content

OpenAI Building Blocks for Meshagent

Project description

Meshagent

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.
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 OpenAIResponsesToolResponseAdapterconvert 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

Documentation: docs.meshagent.com


Project details


Release history Release notifications | RSS feed

This version

0.5.6

Download files

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

Source Distribution

meshagent_openai-0.5.6.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

meshagent_openai-0.5.6-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file meshagent_openai-0.5.6.tar.gz.

File metadata

  • Download URL: meshagent_openai-0.5.6.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for meshagent_openai-0.5.6.tar.gz
Algorithm Hash digest
SHA256 94e054e7e8cbd0b16a99d23fb16120d22b3bf9fd860a845c68b0d8bbf41bcb9a
MD5 ffa1d2284fa427f65896a2ba2f98a0cd
BLAKE2b-256 def0c55a071721582658a0583b4aa8fb832cc412f3eb6de8d3db5184a72ab78f

See more details on using hashes here.

File details

Details for the file meshagent_openai-0.5.6-py3-none-any.whl.

File metadata

File hashes

Hashes for meshagent_openai-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6817b2a2ea365da15bc8d96ae94d6754bbe42a92663574552636e8e084b426e5
MD5 2403cfd3b5bd7f11da6ea90e6d193bfa
BLAKE2b-256 5b8587efac791469371ff6741d5939f48ea0ade5c252e0a0769be35df11f06dd

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