Skip to content
Closed
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 plugins/fxtr/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fxtr",
"version": "0.1.5",
"version": "0.1.6",
"description": "Write, run, and view fxtr experiments, and call models from them with behaviors.",
"author": {
"name": "Transluce",
Expand Down
8 changes: 4 additions & 4 deletions plugins/fxtr/skills/behaviors/provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"skill": "behaviors",
"documentation": "https://docs.transluce.ai/behaviors",
"packages": {
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
"fxtr": "0.2.0a1",
"behaviors": "0.0.1a6"
},
"revision": "6432f6ad1682ca0a8ff344a6ef66cb09bbccb8f7",
"revision": "15e931fd57b9731c677daebd977e474baaf11868",
"modified": false,
"content_sha256": "f67fdb291628ed957c6fa39d933926312c3c3864bea083e28264c69666da8d96"
"content_sha256": "2f7c10c745c1a4fa5df386e2417cf07fe36a43d25b95b4460eb625b4bbe00407"
}
16 changes: 15 additions & 1 deletion plugins/fxtr/skills/behaviors/references/reference/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ async def judge_run(
),
sampling=sampling.params,
custom_formats=[AGENT_RUN_LINE_CITATION_FORMAT],
preview=context.preview,
)
finally:
await api.aclose()
Expand Down Expand Up @@ -408,6 +409,19 @@ The arguments:
written once.
* **`sampling`** is the sampling parameters for each call, and **`callback`**, if given,
receives the events of each call when the model API can stream.
* **`preview`**, if given, receives the judgment so far, so you can watch it in the viewer while
its step runs. In a step, pass `preview=context.preview`. It receives a function that builds a
partial `Judgment` (see [Partial values](../../../fxtr/references/concepts/entities-and-custom-types.mdx#partial-values)),
so the value is built only when the viewer's copy is saved. In it, `entity_ids` is set, and
`output` and `citations` are `None`. `attempts` holds a partial `JudgeAttempt` for each finished
attempt, with its `response` and `invalid_output_reasons`, then one for the attempt in flight,
whose `response` is a partial `ModelResponse` holding the answer so far (`None` before the
answer starts). Each attempt's `request` is `None`: every request repeats the entities, so the
preview leaves them out, and the judgment `judge` returns keeps them. With the behaviors
renderers (`behaviorsRenderers` from `fxtr-view-behaviors`) registered, the step's panel shows
the judge's answers so far, each invalid one with what was wrong, ending in the answer being
written, and its row in the run's table says which attempt it is on ("attempt 2 · 1 invalid ·
streaming…"). When `judge` returns, the step's result takes the preview's place.
* **`max_answers`** is how many answers the model gets, 3 by default. An answer that is not
accepted goes back to the model with what was wrong, until it has given this many.
* **`retry`** and **`failure_categories_to_retry`** say when a failed call is made again. By
Expand All @@ -417,7 +431,7 @@ The arguments:
failed calls, the two multiply: pass `retry=RetryConfig(max_attempts=1)` to make each call
once.

All of these but `callback` change what a judgment can come out as. In a step, pass the ones you
All of these but `callback` and `preview` change what a judgment can come out as. In a step, pass the ones you
vary as step inputs, so the judgment points at the settings that produced it and the step cache
sees each one: `sampling` in a sampling entity of the project's own, as the example does, and
`max_answers` as a number. A setting kept in the step's code, such as `retry`, is invisible to the
Expand Down
6 changes: 3 additions & 3 deletions plugins/fxtr/skills/first-experiment/provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"skill": "first-experiment",
"documentation": null,
"packages": {
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
"fxtr": "0.2.0a1",
"behaviors": "0.0.1a6"
},
"revision": "6432f6ad1682ca0a8ff344a6ef66cb09bbccb8f7",
"revision": "15e931fd57b9731c677daebd977e474baaf11868",
"modified": false,
"content_sha256": "a940ab9c02eec8a663fd3ef94d622a4dc88c9a42b4d5f7faa777c4c90b3e340a"
}
24 changes: 18 additions & 6 deletions plugins/fxtr/skills/fxtr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,10 @@ before [adding one](references/reference/renderers.mdx#adding-a-package-to-a-pro
the viewer's URL (the one `fxtr view` printed, also saved in `.fxtr/viewer.json` within the project), then `#` and `&`-separated parts.

```
http://127.0.0.1:8000/#job=<job id>&w=flowchart(/outer,model=sonnet)&slice=(prompt=3)&card=judge&p=table(/outer/judge,model=sonnet)&p=.output.transcript
http://127.0.0.1:8000/#job=<job id>&p=table(/outer/judge,model=sonnet)&p=.output.transcript
```

`job` is the job's ID (left out, the newest job). `w` is the workflow invocation shown (left
out, the root's trace): `trace`, `flowchart`, or the id of an `InvocationPanel` renderer
of that workflow, applied to its step path from the root, with the keys of the mapped workflows
on the way. `slice` picks dim values for every card and panel. `card` names a step of that workflow (or
`return`, what it returned) whose card to scroll to. Each `p` opens a panel, in order,
`job` is the job's ID (left out, the newest job). Each `p` opens a panel, in order,
each following the one before it; `pin` opens one that stays as it is. A panel is an address,
a view applied to a location and params: the view is `table`, `invocation`, `tree`, `code`, a
renderer's or page's id, or nothing for the default; the location is a step path from the root
Expand All @@ -158,6 +154,22 @@ before [adding one](references/reference/renderers.mdx#adding-a-package-to-a-pro
panel, a location may be relative to the panel before it: `.field…` below it, `../step` a
sibling. Percent-encode only spaces, `%`, `&`, `#`, `+`, and quotes.

A panel on a step is enough to show where the step is: the link opens on the trace of the
workflow that step is in, scrolled to its card, so bind the keys of the mapped workflows on the
way (`model=sonnet` above) in the panel or the slice. Three more parts say otherwise:

```
http://127.0.0.1:8000/#job=<job id>&w=flowchart(/outer,model=sonnet)&slice=(prompt=3)&card=judge
```

`w` is the workflow invocation shown: `trace`, `flowchart`, or the id of an `InvocationPanel`
renderer of that workflow, applied to its step path from the root, with the keys of the mapped
workflows on the way. Left out, it is the trace of the workflow the first panel's step is in,
or the root's when no panel shows a step. `card` names a step of the workflow shown (or
`return`, what it returned) whose card to scroll to, which points at a step without opening a
panel; left out, it is the first panel's step. `slice` picks dim values for every card and
panel.

### Reading the documentation

* **Know which documentation you have.** Distributed in the fxtr plugin for Claude Code or
Expand Down
8 changes: 4 additions & 4 deletions plugins/fxtr/skills/fxtr/provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"skill": "fxtr",
"documentation": "https://docs.transluce.ai/fxtr",
"packages": {
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
"fxtr": "0.2.0a1",
"behaviors": "0.0.1a6"
},
"revision": "6432f6ad1682ca0a8ff344a6ef66cb09bbccb8f7",
"revision": "15e931fd57b9731c677daebd977e474baaf11868",
"modified": false,
"content_sha256": "3188553424bccd6a1a5b64c814bec89797e7468678f4d4e0fed6540d89636780"
"content_sha256": "d4abbc2df2317b0199f41169698ed57c65206989c424230be0347c86351200e2"
}
Loading