Skip to main content

Halo host adapter for the OpenAI Agents SDK (Python): a call_model_input_filter that swaps large tool results for a shape map (out of context) plus a halo_fetch navigation tool. install_halo() wires it in one call.

Project description

halo-format-openai

Halo host adapter for the OpenAI Agents SDK (Python). install_halo() wires it in one call:

  • a call_model_input_filter — the interception seam on this host. The OpenAI Agents SDK has no tool-return output-replacement hook (on_tool_end is observational), so this filter, which rewrites the assembled model input before each model call, is the only generic point that catches every tool — including external/MCP/hosted tools your app does not own. Above a size threshold it replaces a large tool result with a halo shape map (root kind + one line per field: ref, kind, and a bounded preview), so the payload stays out of the model's context while it still sees what's there;
  • a single halo_fetch function tool the model uses to pull back only the leaves it needs, verified on read — a ref that lands on a branch returns that branch's sub-refs, so one batch API both pulls and expands (there is no separate halo_walk).
from agents import Agent, Runner, RunConfig
from halo_format_openai import install_halo

result = install_halo(tools=my_tools)
agent = Agent(name="assistant", tools=result.tools)
out = await Runner.run(
    agent, "…",
    run_config=RunConfig(call_model_input_filter=result.call_model_input_filter),
)
# result.session holds the shared store for audit/inspection

Because the filter fires before every model call over the whole input list (not once per tool return), the adapter correlates each function_call_output to its function_call by call_id — both to skip halo_fetch's own output (the mandatory no-re-encode rule) and to feed entity accumulation the real tool name/args — and caches each encoded result by call_id so repeated firings stay idempotent. The filter is deterministic plumbing (it always runs, for every tool); the Halo Skill (or prompt-mode guidance) is the navigation behavior. Pass store=FileStore(dir) for the heavy/persistent deployment. The core engine is halo-format; this package is only the shim.

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

halo_format_openai-0.4.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

halo_format_openai-0.4.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file halo_format_openai-0.4.0.tar.gz.

File metadata

  • Download URL: halo_format_openai-0.4.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for halo_format_openai-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4c4d3bd1e2ff3b7aff9c64119d8d043cd3d6c4edaa1ab9a9fda8ae72110e9949
MD5 82ded81cd6c2f6fc973c9110d56b85df
BLAKE2b-256 dd0e764f82783ea5addacca8f440284e7a426539a461c3d44314a65b626097dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for halo_format_openai-0.4.0.tar.gz:

Publisher: publish-python-openai.yml on halo-format/halo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file halo_format_openai-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for halo_format_openai-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 180655aed345d0be52c1a18ffd0a3db6dd1b72e737bfc71afc603b0f52cb2849
MD5 0e66b44f0b138edf271076c0c9fab636
BLAKE2b-256 9d8b076ad8d5bb8327946d1cb7acbfb80fec433e7f2e883864d7168e540f4597

See more details on using hashes here.

Provenance

The following attestation bundles were made for halo_format_openai-0.4.0-py3-none-any.whl:

Publisher: publish-python-openai.yml on halo-format/halo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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