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
6 changes: 3 additions & 3 deletions .agents/skills/behaviors/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: behaviors
description: Call language models from fxtr experiments with the behaviors Python library, covering one-shot requests and judge steps, multi-turn chat rollouts, scripted or custom user and tool policies, retries and failures, streaming, checkpoints, and storing conversations. Use whenever a fxtr experiment calls a model or holds a conversation, or when extending behaviors' model adapters or policies.
description: Call language models from fxtr experiments with the behaviors Python library, covering one-shot requests and judge steps, multi-turn chat rollouts, scripted, model-simulated, or custom users and tool policies, retries and failures, streaming, checkpoints, and storing conversations. Use whenever a fxtr experiment calls a model or holds a conversation, or when extending behaviors' model adapters or policies.
---

# behaviors
Expand All @@ -18,11 +18,11 @@ The pages below are its documentation. Read the ones a task needs before writing
| --- | --- |
| Add behaviors to a project; hold a conversation, judge outputs, and summarize verdicts in fxtr steps; test without credentials | [Calling language models](../../../docs/behaviors/guides/language-models.mdx) |
| Pick a provider, an adapter, and an exact model ID | [Choosing models](../../../docs/behaviors/guides/choosing-models.mdx) |
| Script users, offer tools, or write a custom conversation flow | [Policies and tools](../../../docs/behaviors/guides/policies-and-tools.mdx) |
| Script users or simulate them with models (a base model, steered by a pilot), offer tools, or write a custom conversation flow | [Policies and tools](../../../docs/behaviors/guides/policies-and-tools.mdx) |
| Rollout statuses and `max_turns`, failures, retries, streaming | [Rollout outcomes and retries](../../../docs/behaviors/guides/rollout-outcomes.mdx) |
| Messages and content, stored records, transcripts, conversations in the viewer, checkpoints | [Conversation records and checkpoints](../../../docs/behaviors/guides/conversation-records.mdx) |
| Run Docent readings, or convert records for Docent | [Docent readings](../../../docs/behaviors/guides/docent-readings.mdx) |
| Choose a layer; imports, adapters, sampling settings, requests and responses | [API overview](../../../docs/behaviors/reference/api.mdx) |
| Choose a layer; imports, adapters and their options, model providers, sampling and reasoning settings, requests and responses | [API overview](../../../docs/behaviors/reference/api.mdx) |
| Steps, workflows, arrays, launching jobs, and the step cache | the adjacent [fxtr skill](../fxtr/SKILL.md) |

## Best practices
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ A new shipped skill is added to `skillNames` in `scripts/skills/bundle.mjs`.
To update the plugins, complete the JavaScript setup above, then run
`pnpm sync:plugin PATH/TO/claude-code-plugins PATH/TO/codex-plugins` against checkouts of those
repositories (either one alone also works) and open a pull request in each with the result. The
command prepares the skills once, copies them into each checkout's plugin, and bumps that plugin's
patch version when content changes, including documentation alone. It tells the two kinds of
checkout apart by their marketplace files. Unchanged content writes nothing, even when its source
commit changed. Generated copies may normalize formatting; authored sources are never modified. To
inspect a bundle directly, run `node scripts/skills/prepare.mjs . /tmp/fxtr-skills-preview` with a
new output directory.
command prepares the skills once. When any bundled content changes, including documentation alone,
it copies all three skills from the same snapshot and bumps the plugin patch version once.
It tells the two kinds of checkout apart by their marketplace files. Unchanged content writes
nothing, even when its source commit changed. The tool normalizes formatting in generated
copies and preserves the authored files. To inspect a bundle directly, run
`node scripts/skills/prepare.mjs . /tmp/fxtr-skills-preview` with a new output directory.
Use `pnpm sync:plugin --check` with the same checkout paths for a read-only
comparison. It exits nonzero when a marketplace needs an update.

Repository instructions for coding agents live in `AGENTS.md`, with `CLAUDE.md` linked to it.

Expand Down
7 changes: 7 additions & 0 deletions behaviors/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# behaviors changelog

## 0.0.1a5

- Supports fxtr 0.1 and 0.2 (`fxtr>=0.1.0a0,<0.3`). With the fxtr 0.2 viewer, a link can open
a rollout or transcript at a selected message (#288).
- The guides cover model-driven user simulators, checkpointing, model providers, and
provider-specific sampling and caching options (#261).

## 0.0.1a4

- Tagged `DynamicData` metadata, initialization and session checkpoints, model providers,
Expand Down
4 changes: 2 additions & 2 deletions behaviors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ Install `behaviors[docent]` to convert transcript trees into Docent data models
`behaviors.implementations.docent.DocentReadingStep`. The reading step renders a Docent prompt
against a transcript or agent run, calls an injected `ModelAPI`, and parses and validates the
response and citations. It operates on ordinary Python objects without separate child save/load
calls. Provider and Docent SDKs remain optional dependencies. There is no supplied model-driven
user simulator or general judging implementation.
calls. Provider and Docent SDKs remain optional dependencies. There is no supplied general
judging implementation.

## Development

Expand Down
4 changes: 2 additions & 2 deletions behaviors/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ build-backend = "hatchling.build"

[project]
name = "behaviors"
version = "0.0.1a4"
version = "0.0.1a5"
description = "Types, context policies, and chat model rollouts for behavioral experiments"
requires-python = ">=3.12.4"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE"]
dependencies = [
"anyio>=4.14.0",
"cattrs>=26.1.0",
"fxtr>=0.1.0a0,<0.2",
"fxtr>=0.1.0a0,<0.3",
"pyyaml>=6",
]

Expand Down
12 changes: 11 additions & 1 deletion docs/behaviors/guides/conversation-records.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ A new project's renderer package doesn't depend on it yet: add
[The renderer package](/fxtr/reference/renderers#the-renderer-package)). The package also exports
`ChatRolloutView`, for a rollout inside a view of your own, and `ComparedRollouts`.

A rollout's or a transcript's conversation view reads a `selector` param, `{ message: n }`, and
marks and scrolls to that message: the `n`th of the messages it draws, counting a transcript's
messages in order, and a rollout's turn by turn, each turn's context messages and then its model's
(not its initialization). A view of your own links to it with that selector, read from an entity
that stores one (see [Params of an entity's
views](/fxtr/reference/renderers#params-of-an-entitys-views)); `MessageSelector` and
`isMessageSelector` are exported for it. This selector is provisional.

## Checkpointing sessions

A serializable session can save its state and be restored from it. `await session.get_state()`
Expand All @@ -140,7 +148,9 @@ returns the state as `DynamicData`, tagged with the implementation's own state t
for a state that isn't its own. To keep a state as JSON, write
`json.dumps(thaw_fxtr_data(state.data))` (`thaw_fxtr_data` is in `fxtr.core.entity_data`), and
read it back with `DynamicData.from_data(json.loads(text))`.
The sessions of `chat_session_model_from_api` and of `ScriptedUserSimulator` support this, and the
The sessions of `chat_session_model_from_api`, `ScriptedUserSimulator`, and the
[simulated users](/behaviors/guides/policies-and-tools#checkpointing-a-simulated-user)
(`BaseModelUserSimulator` and `PilotSteeredUserSimulator`) support this, and the
`serializable_context_policy_from_*` combinators build checkpointable policies when every component
they combine is checkpointable. Generator-based policies can't be checkpointed, because a
suspended generator can't be saved.
Expand Down
2 changes: 1 addition & 1 deletion docs/behaviors/guides/language-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Use the behaviors library to hold conversations and judge outputs

- model adapters for Anthropic, OpenAI, and OpenAI-compatible services;
- conversation sessions and **context policies**, which decide what the model sees next:
scripted user messages, tool results, or custom logic;
scripted or model-simulated user messages, tool results, or custom logic;
- retries for rate limits and server errors;
- conversation records that are fxtr entities, so they're stored, linked, and shown in the
viewer.
Expand Down
Loading
Loading