Skip to main content

OpenAI adapter for eager tool calling — wraps chat.completions streaming to emit SealEvents.

Project description

eager-tools-openai

OpenAI adapter for eager tool calling — wraps chat.completions.create(stream=True) and dispatches each tool the instant its block seals, overlapping tool execution with ongoing LLM generation.

For the mechanism and runtime contract, see the top-level METHOD.md.

Status

Alpha / scaffold. Public API shape is locked; implementation bodies arrive in Move 3 (CloudThinker port). See NEXT.md.

Install (once published)

pip install eager-tools-openai

Usage

from openai import AsyncOpenAI
from eager_tools_openai import OpenAIEagerStream

client = AsyncOpenAI()

source = await client.chat.completions.create(
    model="gpt-4.1",
    tools=[...],
    messages=[...],
    stream=True,
)
runner = OpenAIEagerStream(source, tools=my_tools)

async for event in runner.events():
    print(event.kind, event.tool_call)

async for call, result in runner.results():
    print(call.name, "→", result)

Supported SDK surfaces

  • chat.completions.create(stream=True) with tools=[...]v0.1 target.
  • Responses API (responses.stream(...)) — deferred; contributions welcome.

Supported SDK versions

  • openai>=1.50.

License

MIT. See top-level LICENSE.

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

eager_tools_openai-0.3.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

eager_tools_openai-0.3.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file eager_tools_openai-0.3.0.tar.gz.

File metadata

  • Download URL: eager_tools_openai-0.3.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.17

File hashes

Hashes for eager_tools_openai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a373bb8990a73033b1bf7e85f7a672e044825cbf66cb0bdcf57f86432462ef13
MD5 5f653825bae53ce9c16dd9372e673d0e
BLAKE2b-256 05979b71f85bdecfab11da89c490679fbbf3ce2e6539e60ec833102336ca7599

See more details on using hashes here.

File details

Details for the file eager_tools_openai-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eager_tools_openai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97e978211ebfd1b66f4f24ea7305b546d6f526af64b43489e525a934be810b58
MD5 4eef4100a2f6e5ec9e6fcaea29ee3f7b
BLAKE2b-256 326f1dac2b85d57cb8860a5cba8584a673f6ee573a81e46bc07898c19f74cc5d

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