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
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 scope_oaf-0.2.0.tar.gz.
File metadata
- Download URL: scope_oaf-0.2.0.tar.gz
- Upload date:
- Size: 47.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e555b243ae3deb9c4c9973526988e59f3b5dea700780154ab4cc7b391891a8f1
|
|
| MD5 |
52a3ad098a7ac19e4adccb5829748115
|
|
| BLAKE2b-256 |
17652e29fcda81435468e8b97662fc354d669546a6202da2d2f10746d30d9d2d
|
Provenance
The following attestation bundles were made for scope_oaf-0.2.0.tar.gz:
Publisher:
publish.yml on devincii-io/scope-oaf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scope_oaf-0.2.0.tar.gz -
Subject digest:
e555b243ae3deb9c4c9973526988e59f3b5dea700780154ab4cc7b391891a8f1 - Sigstore transparency entry: 1219792652
- Sigstore integration time:
-
Permalink:
devincii-io/scope-oaf@ef7411d4d95f257de7ee871ed66dd7e9415bf596 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/devincii-io
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef7411d4d95f257de7ee871ed66dd7e9415bf596 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scope_oaf-0.2.0-py3-none-any.whl.
File metadata
- Download URL: scope_oaf-0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9667191db8c8c8a391b51a4db555815c5108a81eba0f7add01a96d8d782429f3
|
|
| MD5 |
834eaea400288edf56797ab54259ecd5
|
|
| BLAKE2b-256 |
351c7e9dd57fb11f1f74bec050f7fedd9b493da9f6a7f6a7f6f0684f5937e4fa
|
Provenance
The following attestation bundles were made for scope_oaf-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on devincii-io/scope-oaf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scope_oaf-0.2.0-py3-none-any.whl -
Subject digest:
9667191db8c8c8a391b51a4db555815c5108a81eba0f7add01a96d8d782429f3 - Sigstore transparency entry: 1219792688
- Sigstore integration time:
-
Permalink:
devincii-io/scope-oaf@ef7411d4d95f257de7ee871ed66dd7e9415bf596 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/devincii-io
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ef7411d4d95f257de7ee871ed66dd7e9415bf596 -
Trigger Event:
push
-
Statement type: