29 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 29d076a7d8 A leading think block is not the answer
Reasoning models served over OpenAI-compatible APIs can open a reply
with <think>...</think>. It stayed in final_output, in the history sent
back on the next turn, and in front of structured output, where it
failed JSON parsing. process_model_response, where every model's output
becomes run items, now drops a leading block from the message text.
Text that only mentions the tag, or an unclosed block, is unchanged;
tool call arguments and result.raw_responses keep what the model sent.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 13:59:49 -07:00
zeekayandHanzo Dev 79273cfa53 A 200 carrying an error object raises APIError
An OpenAI-compatible server can answer HTTP 200 with {"error": {...}}.
The openai client parses that as a result with no choices or output, and
the run died in a TypeError. Both model classes now raise
openai.APIError with the server's message and body, as the client does
for an error object inside a stream.

The test drives both routes through a local server. conftest imports
the Responses resource before swapping two of its classes for
factories; imported after, it subclasses a function and fails.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 13:55:06 -07:00
zeekayandHanzo Dev 9e1118f21d Traces go nowhere unless a processor sends them
Importing agents registered an exporter that posted every trace and
span to api.openai.com with the default client's key, so a run against
any other server sent its traces there and logged a 401. Nothing is
registered now. BackendSpanExporter takes the endpoint it posts to, with
no default and no OPENAI_* fallback. set_tracing_export_api_key and
use_for_tracing only fed that upload, so they are gone.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 13:48:35 -07:00
zeekayandHanzo Dev 56add66c20 The README runs, and make tests collects only tests/
The old README showed Web3Agent, a marketplace and a cli extension that
do not import from hanzo-agent 0.1.1, a HANZO_ROUTER_URL nothing reads,
and examples on gpt-4. It now shows a first agent and a function tool
that ran on Python 3.9 and 3.12 against a local OpenAI-compatible
server, how to point the client at api.hanzo.ai, and the extras whose
names import.

It also says what the defaults do: the Responses route unless
chat_completions is set, traces posted to api.openai.com with the
client's key unless tracing is off, the openai client's retry rules,
and a <think> block kept in final_output.

pytest picked up the stray scripts at the repo root, and
test_simple_anthropic.py exits on import, so make tests stopped at
collection. testpaths keeps it to tests/: 369 passed.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 11:01:26 -07:00
zeekayandHanzo Dev 5c25684d98 fix(pypi): stop publishing this repo's dist as hanzoai
hanzoai on PyPI is the API client from hanzoai/python-sdk (3.1.1; all 12
releases carry that provenance). This repo declared the same dist name and
had a release-triggered PyPI publisher, so a release here would land a
different package under the name consumers expect to be the API client.

- remove .github/workflows/publish.yml; python-sdk is the one Python
  publisher and it already ships this SDK as hanzo-agent
- name the dist hanzo-agent, matching the PyPI project whose homepage is
  this repo, and carry the rename through the self-referential full extra
  so hatchling stops resolving it against hanzoai
- README/docs: install hanzo-agent, import agents, the top-level module
  the wheel ships
- docker-publish: build on hanzo-build-linux-amd64, not ubuntu-latest

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-26 19:28:29 -07:00
zeekay 7cab8e2d11 chore(notice): pin OpenAI Agents SDK provenance and deviations; sweep product branding 2026-07-13 16:08:42 -07:00
zeekay 51bc6cc276 docs(brand): add hero banner 2026-06-28 20:14:48 -07:00
c741f84573 docs(README): fix broken imports and API in Multi-Agent Network + Orchestrated Workflow examples (#8)
The two README examples following "Hosted via Hanzo Network" reference
symbols that don't exist on the import paths shown. Verified against
`src/agents/__init__.py` and `src/agents/orchestration/__init__.py` at
HEAD.

**Multi-Agent Network**
- `from agents import create_network` → `create_network` lives at
  `agents.network.create_network` and isn't re-exported from the top
  level. Import fails today.
- `from agents.routers import SemanticRouter` → there is no
  `agents.routers` module. `SemanticRouter` is defined in
  `agents/network/router.py` and re-exported from `agents.network`.

Both fixed by `from agents.network import create_network, SemanticRouter`.
Verified: `agents/network/__init__.py` exports both in `__all__`.

**Orchestrated Workflow**
The example was a richer mockup than the real API supports today:

- `from agents import create_workflow, Step` → `create_workflow`
  doesn't exist anywhere in the codebase; `Step` is at
  `agents.orchestration.Step`, not the top level.
- `create_workflow(name=..., steps=[...])` → `Workflow.__init__`
  takes `(name, description, version)` only; steps are added via
  `Workflow.add_*_step()` methods or via
  `Orchestrator.create_workflow_from_agents()`.
- `Step.conditional(condition=..., true_step=..., false_step=...)` →
  actual signature is `Step.conditional(condition, if_true, if_false)`
  (workflow.py:443).
- `Step.transform(...)` → no such static method. Transform steps are
  added via `Workflow.add_transform_step()`.
- `workflow.run({...})` → `Workflow` has no `run` method. Execution
  is via `Orchestrator.execute_workflow(workflow_id, input)`
  (orchestrator.py:108).

Rewritten to mirror the working pattern from
`examples/network_example.py::orchestrated_workflow_example()` —
`Orchestrator(config=OrchestrationConfig(...))`, `register_agent`,
`create_workflow_from_agents`, `register_workflow`, `execute_workflow`.
The lower-level `Workflow` + `Step.{agent,parallel,conditional,loop}`
helpers are mentioned as a pointer for readers who want direct
control.

Also tightened trailing-comma formatting in the Multi-Agent example
(black-style trailing commas on multi-line args) — pure cosmetic, no
behavior change.

No source code changes. README-only.

Co-authored-by: Abhishek Krishna <[email protected]>
2026-06-16 22:02:41 -07:00
zeekay 5fa874326c feat: Add Web3, TEE, and Marketplace extensions
Adds optional extension modules for advanced agent capabilities:

Extensions Added:
- Web3: Wallet management, transactions, on-chain identity
  - AgentWallet for ETH/token management
  - Transaction signing and broadcasting
  - Web3Agent and Web3Network classes

- TEE: Trusted Execution Environment support
  - Intel SGX, AMD SEV, NVIDIA H100 providers
  - Attestation report generation and verification
  - ConfidentialAgent for secure execution
  - ComputeMarketplace for TEE compute services

- Marketplace: Decentralized agent service discovery
  - ServiceOffer and ServiceRequest system
  - Agent service matching and economics
  - Reputation management

- CLI: Command-line interface integration
  - CLIAgent for interactive CLI operations

Configuration Changes:
- Updated pyproject.toml with optional dependencies:
  - [web3]: web3, eth-account, eth-utils
  - [tee]: cryptography
  - [marketplace]: aiohttp, redis
  - [cli]: click, rich
  - [full]: all extensions

- Updated README.md:
  - Added extensions documentation
  - Added installation instructions for each extension
  - Added usage examples for Web3, TEE, and Marketplace

Migration Notes:
- Extensions are imported from agents.extensions.*
- All extensions are optional and can be installed separately
- Maintains full backward compatibility with base SDK

Related: Consolidation of hanzo-agents functionality into main SDK
2025-10-28 20:05:00 -07:00
zeekayandGitHub 59e653facb Update README to remove AgentKit reference
Removed reference to AgentKit from the README.
2025-10-28 19:49:26 -07:00
zeekay b78822cbc6 Add AgentKit-inspired multi-agent orchestration features
Major enhancements to Hanzo Agent SDK inspired by Inngest AgentKit:

Networks and Routing:
- Multi-agent networks with intelligent routing
- Semantic, rule-based, and load-balanced routers
- Composite routing strategies
- Network-aware agent handoffs

State Management:
- Shared state accessible by all agents
- Multiple backends (memory, Redis, file)
- Namespaced state isolation
- Atomic operations

Memory System:
- Long-term memory with vector search
- Multiple memory types (conversation, facts, procedures)
- Auto-compression and reflection
- ChromaDB integration for semantic search

Orchestration:
- Complex workflow definitions
- Parallel, conditional, and loop steps
- UI streaming for real-time updates
- Workflow visualization

Enhanced Tools:
- MCP (Model Context Protocol) support
- Tool registry and composition
- Tool chains for sequential execution
- Performance monitoring

Examples:
- Network example showing multi-agent collaboration
- Autonomous bug solver demonstrating complex workflows
- Backend integration with Hanzo Router

All features maintain backward compatibility while enabling
powerful multi-agent systems similar to AgentKit's capabilities.
2025-07-05 19:41:18 -04:00
zeekay 4ee653f44f Update README 2025-03-14 16:04:45 -05:00
zeekay 795c639e6a Update package name 2025-03-14 16:03:46 -05:00
Dmitry PimenovandGitHub 357cbc3853 Add Scorecard as supported external trace processors (#80)
Incredibly excited to add Scorecard as an external trace processor for
the Agents SDK!
2025-03-12 21:25:42 -07:00
DareandGitHub 0b4ff9b7e5 Merge branch 'main' into main 2025-03-12 17:24:39 -07:00
Dmitry Pimenov fd2003161c added a Jupyter example to clarify how to use the SDK with an existing event loop 2025-03-12 17:24:35 -07:00
Dmitry Pimenov 4f842cfec2 adding Keywords AI as a trace processor 2025-03-12 13:15:53 -07:00
Dare 9cda36b3c2 Adding link to docs on Scorecard AgentSDK Support
Incredibly excited to add support the agentsdk for Scorecard tracing!
2025-03-12 04:43:50 -07:00
Rohan MehtaandGitHub cd942d0d2f Merge pull request #13 from Jai0401/fix-typo-readme
fix: correct typo in README regarding tool responses
2025-03-11 23:25:05 -07:00
Ali Yaman 3a94e4ece9 docs: Fix typos in documentation files 2025-03-12 00:12:31 +01:00
jhills20 70b70c2547 tweaks to readme 2025-03-11 13:08:35 -07:00
jhills20 7be3a03bd9 fix typo 2025-03-11 12:37:40 -07:00
jhills20 a99478d63c Add note on compatibility w other providers 2025-03-11 12:06:22 -07:00
Dmitry Pimenov 4f5e837f30 updating links/tracing description 2025-03-11 11:39:26 -07:00
Jai0401 47a6e2721b fix: correct wording in README for clarity on response handling 2025-03-11 23:59:23 +05:30
Rohan Mehta d9d96d3be8 link to documentation from readme 2025-03-11 11:29:22 -07:00
Jai0401 c9f0c7301c fix: correct typo in README regarding tool responses 2025-03-11 23:53:45 +05:30
Dmitry Pimenov 3c7fef4230 updating screenshot to CDN link 2025-03-11 10:21:11 -07:00
Rohan Mehta aaec57a426 Initial commit 2025-03-11 09:42:28 -07:00