Skip to main content

Graph-based agent framework powered by oauth-codex

Project description

Fabrix

Fabrix is a graph-based agent framework built on top of oauth-codex>=2.2.0.

Key Features

  • Graph-based state transitions
  • Structured state outputs via Pydantic
  • Tool execution with strict, tool-specific argument schemas
  • Tool execution with Pydantic parameter validation
  • Async-only, streaming-first API

Installation

pip install fabrix

Quickstart

import asyncio

from pydantic import BaseModel

from fabrix import Agent
from fabrix.events import ReasoningEvent, TaskFinishedEvent, ToolEvent


class AddInput(BaseModel):
    a: int
    b: int


def add_numbers(payload: AddInput) -> int:
    return payload.a + payload.b


async def main() -> None:
    agent = Agent(
        instructions="You are a precise assistant.",
        tools=[add_numbers],
    )

    async for event in agent.run_task_stream("Use add_numbers to compute 3 + 9"):
        print(f"[step={event.step}] {event.event_type}")
        if isinstance(event, ReasoningEvent):
            print("reasoning:", event.reasoning)
        elif isinstance(event, ToolEvent):
            if event.phase == "start":
                print("tool call:", event.tool_name, event.arguments)
            elif event.result is not None:
                print("tool result:", event.result.model_dump())
        elif isinstance(event, TaskFinishedEvent):
            print("final:", event.final_output)


asyncio.run(main())

See examples/minimal/quickstart.py and examples/advanced/data_workflow.py for more.

Notes

  • Structured state output is compiled to a Structured Outputs-compatible schema subset.
  • Tool-call items use strict schemas (anyOf, no oneOf/const) for provider compatibility.
  • Every object node is normalized to explicit properties + required consistency.
  • Map-like dict[...] shapes may be narrowed to empty-object constraints for strict compatibility.
  • Define tool parameters with explicit fields (Pydantic models recommended) for reliable validation.

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

fabrix_ai-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

fabrix_ai-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file fabrix_ai-0.1.0.tar.gz.

File metadata

  • Download URL: fabrix_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fabrix_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31d547171777cd3a3e218df8f2302da8ebc00e18016a4d6b45c845154200ca13
MD5 a656aae8b7765e2bd7021d94622389a3
BLAKE2b-256 ef52d60d99874071b1d17d8420135e948a533ec30432f2fd894014622c1382f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabrix_ai-0.1.0.tar.gz:

Publisher: publish-pypi.yml on smturtle2/fabrix

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

File details

Details for the file fabrix_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fabrix_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fabrix_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cae9201a3c0abf6ad5d6b7d9dc1e2bb31a0e78ec21485f55316442900ec49390
MD5 e7d5929382b2085f22c3715ef0317253
BLAKE2b-256 18c1d01353848a913c1b1d993f0e7ed2ed85fbeff9fcc52ee883123d62baed4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabrix_ai-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on smturtle2/fabrix

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