Skip to main content

OpenAgentFramework — minimal, fast, transparent AI agent framework

Project description

OAF — OpenAgentFramework

Minimal, fast, transparent AI agent framework for Python.

JSON-based tool calling, provider-agnostic (OpenAI + Anthropic), full prompt inspectability.

Install

pip install scope-oaf

Or from source:

pip install /path/to/oaf

Quick Start

import asyncio
from oaf import Agent, ToolRegistry

registry = ToolRegistry()

@registry.register
async def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"Weather in {city}: 72°F, sunny"

agent = Agent(model="gpt-4.1-nano", tools=registry)
response = asyncio.run(agent.message("What's the weather in Tokyo?", role="user"))
print(response.text)

Top-level API

from oaf import Agent, Hooks, Tool, tool, tool_method, BaseToolGroup, ToolRegistry

That's the full autocomplete list. Everything else lives in subpackages.

Subpackages

# LLM client, types, models, errors
from oaf.llmclient import LLMClient, Message, ChatResponse, Models, LLMError

# Context / memory
from oaf.context import BaseContext, ConversationalInMemory

# Prompt builders
from oaf.prompts import BasePromptBuilder, DefaultPromptBuilder

Tool Groups

from oaf import BaseToolGroup, tool_method, ToolRegistry

class MathTools(BaseToolGroup):
    """Mathematical operations."""
    name = "math"

    @tool_method
    async def add(self, a: int, b: int) -> str:
        """Add two numbers."""
        return str(a + b)

registry = ToolRegistry()
registry.register_group(MathTools())

Providers

Set OPENAI_API_KEY and/or ANTHROPIC_API_KEY as environment variables, or pass them directly:

from oaf.llmclient import LLMClient

client = LLMClient(openai_api_key="sk-...", anthropic_api_key="sk-ant-...")

License

MIT

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

scope_oaf-0.1.0.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

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

scope_oaf-0.1.0-py3-none-any.whl (39.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scope_oaf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c783faf8b7480219f4e28d06567954da7b608beb65629c5ddce9b7491d76b378
MD5 44d098990360645212cccca426155c36
BLAKE2b-256 230ae2950bdd005c057e4d645a704effb152b1205355bdb354a6c3ec0115c18a

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on devincii-io/scope-oaf

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

File details

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

File metadata

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

File hashes

Hashes for scope_oaf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5bf54401e62239183a4788eae6b0dadcdbcdd6048ee9e176a6a22626eed7169
MD5 3bcd9f9a99ad37f1cfaf0701bd1684f8
BLAKE2b-256 dab17bf5a7fcd5585453a22f89c66118e36dd0ef2b81d4d3aba0dbf36f615db4

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on devincii-io/scope-oaf

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