DoDo - A stateful agentic framework
Project description
dodo
A stateful agentic framework for building AI agents.
Installation
pip install dodoai
pip install dodoai[gemini] # With Gemini support
Overview
from dodo import Agent, Gemini
agent = Agent(llm=Gemini(), tools=[add_todo, complete_todo])
await agent.do("add buy milk to my list")
await agent.do("mark buy milk as done")
ok = await agent.check("all tasks are completed")
if ok:
print("Success!")
Features
Stateful agents
# Agent remembers context across tasks
await agent.do("calculate 25 * 4")
await agent.do("add 10 to the result")
await agent.do("multiply by 2")
Structured output (using Pydantic)
from pydantic import BaseModel
class Result(BaseModel):
value: float
expression: str
result = await agent.tell("the calculation result", schema=Result)
Verdicts with reasons
ok = await agent.check("result is greater than 100")
if ok:
print("Success!")
else:
print(f"Failed: {ok.reason}")
Usage
1. Create tools
Simple tools using @tool decorator:
from dodo import tool
@tool
async def calculator(expression: str) -> str:
"""Perform arithmetic calculations.
Args:
expression: Math expression to evaluate
"""
return str(eval(expression))
Tools with dependencies using classes:
@tool
class SearchTool:
"""Search the database."""
def __init__(self, database):
self.database = database
async def run(self, query: str) -> str:
"""
Args:
query: Search query
"""
return self.database.search(query)
2. Define observation function
async def observe():
"""Return current environment state as a list of strings or Content objects."""
return [f"Current user: {username}", f"History: {history}"]
3. Create agent and run tasks
from dodo import Agent, Gemini
agent = Agent(llm=Gemini(), tools=[calculator], observe=observe)
await agent.do("calculate 25 * 4 + 10") # Do a task
result = await agent.tell("the last calculation") # Get information
ok = await agent.check("result is greater than 100") # Check a condition
4. Error handling
try:
await agent.do("divide 10 by 0")
except TaskAbortedError as e:
print(f"Task failed: {e}")
Supported LLMs
from dodo import Gemini
Gemini(model="gemini-2.5-flash") # Default
Gemini(model="gemini-2.5-pro") # Pro model
You can also implement your own LLM by extending the LLM base class:
from dodo import LLM
class MyLLM(LLM):
async def call_tools(self, messages, tools):
# Your LLM API call here
pass
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 dodoai-0.1.1.tar.gz.
File metadata
- Download URL: dodoai-0.1.1.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4148b9ca246dc3a0807a43776b0cd678bc003214140c3c99a93cb280a502c919
|
|
| MD5 |
1351158a777e65b5322662cff5d8d2e2
|
|
| BLAKE2b-256 |
ec1d227e6262dc534003167eee67d6daadf7a32463391cac082f2b99a8e7811d
|
Provenance
The following attestation bundles were made for dodoai-0.1.1.tar.gz:
Publisher:
publish.yml on steve-z-wang/dodo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dodoai-0.1.1.tar.gz -
Subject digest:
4148b9ca246dc3a0807a43776b0cd678bc003214140c3c99a93cb280a502c919 - Sigstore transparency entry: 719575617
- Sigstore integration time:
-
Permalink:
steve-z-wang/dodo@01b9e352d7cac0c5e8860897d62b6cbdcc8a422d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/steve-z-wang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01b9e352d7cac0c5e8860897d62b6cbdcc8a422d -
Trigger Event:
release
-
Statement type:
File details
Details for the file dodoai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dodoai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.8 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 |
2f72840fc35614675bd29908270011aa91117a9f2baad48783381ca32e1a43df
|
|
| MD5 |
b199f8de7db220bd3c12821c0b294060
|
|
| BLAKE2b-256 |
e2f6fe966fb01a7ca13b754f3ea2ddd7811340f43d079f1c0e91892279aa43ff
|
Provenance
The following attestation bundles were made for dodoai-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on steve-z-wang/dodo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dodoai-0.1.1-py3-none-any.whl -
Subject digest:
2f72840fc35614675bd29908270011aa91117a9f2baad48783381ca32e1a43df - Sigstore transparency entry: 719575618
- Sigstore integration time:
-
Permalink:
steve-z-wang/dodo@01b9e352d7cac0c5e8860897d62b6cbdcc8a422d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/steve-z-wang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01b9e352d7cac0c5e8860897d62b6cbdcc8a422d -
Trigger Event:
release
-
Statement type: