Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ from afk.core import Runner

agent = Agent(
name="assistant",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Answer directly with concrete detail.",
)

Expand Down
2 changes: 1 addition & 1 deletion docs/library/a2a.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ from afk.agents import Agent, A2AServiceHost, APIKeyA2AAuthProvider
from afk.core import Runner

# Define the agent
analyzer = Agent(name="analyzer", model="gpt-4.1-mini", instructions="Analyze data.")
analyzer = Agent(name="analyzer", model="gpt-5.5", instructions="Analyze data.")

# Create auth provider
auth = APIKeyA2AAuthProvider(
Expand Down
4 changes: 2 additions & 2 deletions docs/library/agent-skills.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ from afk.agents import Agent

agent = Agent(
name="devops-agent",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
You are a DevOps assistant. Use your skills to help with
deployment, monitoring, and infrastructure tasks.
Expand Down Expand Up @@ -181,7 +181,7 @@ The agent autonomously decides which skills to read based on the user's question
```python
agent = Agent(
name="reader",
model="gpt-4.1-mini",
model="gpt-5.5",
skills_dir="skills/",
skill_tools=["list_skills", "read_skill_md", "read_skill_file"],
# ← No run_skill_command
Expand Down
8 changes: 4 additions & 4 deletions docs/library/agentic-behavior.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ from afk.agents import Agent
from afk.core import Runner

# Specialist agents
researcher = Agent(name="researcher", model="gpt-4.1-mini", instructions="Find facts.")
writer = Agent(name="writer", model="gpt-4.1-mini", instructions="Write summaries.")
reviewer = Agent(name="reviewer", model="gpt-4.1-mini", instructions="Review for accuracy.")
researcher = Agent(name="researcher", model="gpt-5.5", instructions="Find facts.")
writer = Agent(name="writer", model="gpt-5.5", instructions="Write summaries.")
reviewer = Agent(name="reviewer", model="gpt-5.5", instructions="Review for accuracy.")

# Coordinator
coordinator = Agent(
name="coordinator",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
1. Ask 'researcher' for facts
2. Ask 'writer' to summarize
Expand Down
6 changes: 3 additions & 3 deletions docs/library/agentic-levels.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AFK applications progress through five levels of capability. Each level adds fea
One agent, one model, no tools. The simplest possible setup.

```python
agent = Agent(name="classifier", model="gpt-4.1-mini", instructions="Classify as positive/negative/neutral.")
agent = Agent(name="classifier", model="gpt-5.5", instructions="Classify as positive/negative/neutral.")
result = runner.run_sync(agent, user_message="Great product!")
```

Expand All @@ -31,7 +31,7 @@ AFK applications progress through five levels of capability. Each level adds fea
@tool(args_model=SearchArgs, name="search", description="Search knowledge base.")
def search(args: SearchArgs) -> dict: ...

agent = Agent(name="helper", model="gpt-4.1-mini", tools=[search])
agent = Agent(name="helper", model="gpt-5.5", tools=[search])
```

**AFK features added:** `@tool`, Pydantic models, `FailSafeConfig`
Expand All @@ -48,7 +48,7 @@ AFK applications progress through five levels of capability. Each level adds fea
```python
coordinator = Agent(
name="coordinator",
model="gpt-4.1-mini",
model="gpt-5.5",
subagents=[researcher, writer, reviewer],
)
```
Expand Down
14 changes: 7 additions & 7 deletions docs/library/agents.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from afk.agents import Agent

agent = Agent(
name="assistant", # ← Identity (used in logs, telemetry)
model="gpt-4.1-mini", # ← Which LLM to use
model="gpt-5.5", # ← Which LLM to use
instructions="Be helpful and concise.", # ← System prompt
)
```
Expand Down Expand Up @@ -61,7 +61,7 @@ Those are the fields most examples should set. `model` is the only required cons
```python
agent = Agent(
name="classifier",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
Classify the input into one of: positive, negative, neutral.
Output only the label.
Expand All @@ -81,19 +81,19 @@ Those are the fields most examples should set. `model` is the only required cons
```python
researcher = Agent(
name="researcher",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Find relevant facts. Be thorough.",
)

writer = Agent(
name="writer",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Write clear, concise summaries.",
)

coordinator = Agent(
name="coordinator",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
You manage a team:
- Delegate research to 'researcher'
Expand Down Expand Up @@ -139,7 +139,7 @@ from afk.agents import Agent, FailSafeConfig

agent = Agent(
name="safe-agent",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="...",
tools=[...],
fail_safe=FailSafeConfig(
Expand All @@ -155,7 +155,7 @@ agent = Agent(
subagent_failure_policy="continue", # "continue" | "retry_then_fail" | "skip_action"

# Fallback model chain for LLM resilience
fallback_model_chain=["gpt-4.1-mini", "gpt-4.1-nano"],
fallback_model_chain=["gpt-5.5", "gpt-5.5"],
),
)
```
Expand Down
8 changes: 4 additions & 4 deletions docs/library/building-with-ai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ flowchart LR
```python
agent = Agent(
name="classifier",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
Classify the support ticket into exactly one category:
billing, technical, account, feature-request, other.
Expand All @@ -58,7 +58,7 @@ flowchart LR

agent = Agent(
name="rag-agent",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
Always search the knowledge base before answering.
Cite sources. If no relevant docs found, say so.
Expand All @@ -84,7 +84,7 @@ flowchart LR

agent = Agent(
name="coder",
model="gpt-4.1",
model="gpt-5.5",
instructions="""
Write code, then run the tests to verify.
Fix any failures before presenting the final version.
Expand All @@ -110,7 +110,7 @@ flowchart LR
```python
coordinator = Agent(
name="coordinator",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
Route each request to the appropriate specialist:
- Technical questions → 'engineer'
Expand Down
2 changes: 1 addition & 1 deletion docs/library/checkpoint-schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ flowchart TB
from afk.agents import Agent
from afk.core import Runner

agent = Agent(name="analyst", model="gpt-4.1-mini", instructions="Analyze data.")
agent = Agent(name="analyst", model="gpt-5.5", instructions="Analyze data.")
runner = Runner()

# Start a run that might be interrupted
Expand Down
2 changes: 1 addition & 1 deletion docs/library/core-runner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The **Runner** is the execution engine that runs agents. It manages the step loo
from afk.agents import Agent
from afk.core import Runner

agent = Agent(name="demo", model="gpt-4.1-mini", instructions="Be helpful.")
agent = Agent(name="demo", model="gpt-5.5", instructions="Be helpful.")
runner = Runner()

# Synchronous (simplest)
Expand Down
2 changes: 1 addition & 1 deletion docs/library/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Create `config/production.yaml`:

```yaml
agent:
default_model: gpt-4.1-mini
default_model: gpt-5.5
default_fail_safe:
max_steps: 20
max_tool_calls: 10
Expand Down
2 changes: 1 addition & 1 deletion docs/library/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ These variables configure the default LLM provider and behavior. They are read b
| ------------------------------- | -------------- | ------------------------------------------------------------ |
| `AFK_LLM_PROVIDER` | `litellm` | Default provider id (`openai`, `litellm`, `anthropic_agent`) |
| `AFK_LLM_PROVIDER_ORDER` | _(none)_ | Comma-separated provider preference order for routing helpers |
| `AFK_LLM_MODEL` | `gpt-4.1-mini` | Default model name |
| `AFK_LLM_MODEL` | `gpt-5.5` | Default model name |
| `AFK_EMBED_MODEL` | _(none)_ | Embedding model for vector operations |
| `AFK_LLM_API_BASE_URL` | _(none)_ | Provider API base URL |
| `AFK_LLM_API_KEY` | _(none)_ | Provider API key |
Expand Down
2 changes: 1 addition & 1 deletion docs/library/evals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from afk.evals import EvalCase, EvalSuiteConfig, StateCompletedAssertion, run_su

agent = Agent(
name="classifier",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Classify as: billing, technical, account, other. Output only the label.",
)

Expand Down
2 changes: 1 addition & 1 deletion docs/library/failure-policy-matrix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ agent = Agent(
...,
fail_safe=FailSafeConfig(
llm_failure_policy="degrade", # "fail" or "degrade"
fallback_model_chain=["gpt-4.1-mini"], # Try cheaper model
fallback_model_chain=["gpt-5.5"], # Try cheaper model
),
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/library/how-to-use-afk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from afk.core import Runner

agent = Agent(
name="ticket-classifier",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="""
Classify the support ticket as exactly one of:
billing, technical, account, or other.
Expand Down Expand Up @@ -55,7 +55,7 @@ def lookup_ticket(args: TicketArgs) -> dict:

agent = Agent(
name="ticket-agent",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Look up tickets before answering. Never modify data.",
tools=[lookup_ticket],
fail_safe=FailSafeConfig(
Expand Down
10 changes: 5 additions & 5 deletions docs/library/learn-in-15-minutes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from afk.core import Runner

agent = Agent(
name="tutor",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Explain programming concepts in plain language.",
)

Expand Down Expand Up @@ -53,7 +53,7 @@ def search_docs(args: LookupArgs) -> dict:

agent = Agent(
name="research-tutor",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Search docs before answering user questions.",
tools=[search_docs],
)
Expand Down Expand Up @@ -82,7 +82,7 @@ from afk.core import Runner

agent = Agent(
name="streamer",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Explain topics clearly.",
)

Expand Down Expand Up @@ -118,7 +118,7 @@ from afk.core import Runner

agent = Agent(
name="memory-tutor",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Remember the user's earlier questions in this thread.",
)

Expand Down Expand Up @@ -157,7 +157,7 @@ from afk.core import Runner, RunnerConfig

agent = Agent(
name="bounded-agent",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Help users, but stop if the task becomes too large.",
fail_safe=FailSafeConfig(
max_steps=8,
Expand Down
4 changes: 2 additions & 2 deletions docs/library/llm-interaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Each step in this flow is described in detail below.

At each step of the agent loop, the runner builds an `LLMRequest` and sends it to the configured LLM provider. Here is what goes into the request:

**Model resolution.** The agent's `model` field (e.g., `"gpt-4.1-mini"`) is resolved through the model resolution chain. This maps the requested model name to a provider, adapter, and normalized model identifier. Custom `model_resolver` functions can override this mapping.
**Model resolution.** The agent's `model` field (e.g., `"gpt-5.5"`) is resolved through the model resolution chain. This maps the requested model name to a provider, adapter, and normalized model identifier. Custom `model_resolver` functions can override this mapping.

**Message history.** The runner maintains a list of `Message` objects representing the conversation history. This includes:
- A `system` message containing the agent's instructions, skill manifests, and (when enabled) an untrusted-data preamble.
Expand All @@ -48,7 +48,7 @@ At each step of the agent loop, the runner builds an `LLMRequest` and sends it t
```python
# Simplified view of what the runner builds
request = LLMRequest(
model="gpt-4.1-mini",
model="gpt-5.5",
request_id=f"{run_id}:step:{step}",
messages=messages, # Full conversation history
tools=tool_definitions, # OpenAI-format function tools
Expand Down
2 changes: 1 addition & 1 deletion docs/library/mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Discover and use tools from any MCP server:

agent = Agent(
name="assistant",
model="gpt-4.1-mini",
model="gpt-5.5",
instructions="Use available tools to help the user.",
tools=tools, # ← MCP tools work like local tools
)
Expand Down
2 changes: 1 addition & 1 deletion docs/library/memory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import asyncio
from afk.agents import Agent
from afk.core import Runner

agent = Agent(name="tutor", model="gpt-4.1-mini", instructions="You are a Python tutor.")
agent = Agent(name="tutor", model="gpt-5.5", instructions="You are a Python tutor.")

async def main():
runner = Runner()
Expand Down
2 changes: 1 addition & 1 deletion docs/library/mental-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ flowchart LR
# The Decision Loop is shaped by these fields
agent = Agent(
instructions="...", # ← What the model knows
model="gpt-4.1-mini", # ← How the model thinks
model="gpt-5.5", # ← How the model thinks
tools=[...], # ← What the model can do
)
```
Expand Down
Loading
Loading