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_endis 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_fetchfunction 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 separatehalo_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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c4d3bd1e2ff3b7aff9c64119d8d043cd3d6c4edaa1ab9a9fda8ae72110e9949
|
|
| MD5 |
82ded81cd6c2f6fc973c9110d56b85df
|
|
| BLAKE2b-256 |
dd0e764f82783ea5addacca8f440284e7a426539a461c3d44314a65b626097dd
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
halo_format_openai-0.4.0.tar.gz -
Subject digest:
4c4d3bd1e2ff3b7aff9c64119d8d043cd3d6c4edaa1ab9a9fda8ae72110e9949 - Sigstore transparency entry: 1744536824
- Sigstore integration time:
-
Permalink:
halo-format/halo@3075c574afa2a75ce167d20d9141096aac99c3e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/halo-format
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-openai.yml@3075c574afa2a75ce167d20d9141096aac99c3e8 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file halo_format_openai-0.4.0-py3-none-any.whl.
File metadata
- Download URL: halo_format_openai-0.4.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
180655aed345d0be52c1a18ffd0a3db6dd1b72e737bfc71afc603b0f52cb2849
|
|
| MD5 |
0e66b44f0b138edf271076c0c9fab636
|
|
| BLAKE2b-256 |
9d8b076ad8d5bb8327946d1cb7acbfb80fec433e7f2e883864d7168e540f4597
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
halo_format_openai-0.4.0-py3-none-any.whl -
Subject digest:
180655aed345d0be52c1a18ffd0a3db6dd1b72e737bfc71afc603b0f52cb2849 - Sigstore transparency entry: 1744536899
- Sigstore integration time:
-
Permalink:
halo-format/halo@3075c574afa2a75ce167d20d9141096aac99c3e8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/halo-format
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-openai.yml@3075c574afa2a75ce167d20d9141096aac99c3e8 -
Trigger Event:
workflow_run
-
Statement type: