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 .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"name": "fxtr",
"source": "./plugins/fxtr",
"description": "Skills for writing, running, and viewing fxtr experiments, and for calling models from them with behaviors",
"version": "0.1.4",
"version": "0.1.5",
"author": {
"name": "TransluceAI"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/fxtr/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"author": {
"name": "TransluceAI"
},
"version": "0.1.4"
"version": "0.1.5"
}
21 changes: 11 additions & 10 deletions plugins/fxtr/skills/behaviors/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ The pages below are its documentation. Read the ones a task needs before writing

## Where to read

| Task | Read |
| ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| Add behaviors to a project; hold a conversation, judge outputs, and summarize verdicts in fxtr steps; test without credentials | [Calling language models](references/guides/language-models.mdx) |
| Pick a provider, an adapter, and an exact model ID | [Choosing models](references/guides/choosing-models.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](references/guides/policies-and-tools.mdx) |
| Rollout statuses and `max_turns`, failures, retries, streaming | [Rollout outcomes and retries](references/guides/rollout-outcomes.mdx) |
| Messages and content, stored records, transcripts, conversations in the viewer, checkpoints | [Conversation records and checkpoints](references/guides/conversation-records.mdx) |
| Run Docent readings, or convert records for Docent | [Docent readings](references/guides/docent-readings.mdx) |
| Choose a layer; imports, adapters and their options, model providers, sampling and reasoning settings, requests and responses | [API overview](references/reference/api.mdx) |
| Steps, workflows, arrays, launching jobs, and the step cache | the adjacent [fxtr skill](../fxtr/SKILL.md) |
| Task | Read |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Add behaviors to a project; hold a conversation, judge outputs, and summarize verdicts in fxtr steps; test without credentials | [Calling language models](references/guides/language-models.mdx) |
| Pick a provider, an adapter, and an exact model ID | [Choosing models](references/guides/choosing-models.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](references/guides/policies-and-tools.mdx) |
| What each provider's dialect carries, adaptation losses and refusing them, structured output (`response_format`, strict tools, tool output schemas), refusals and other stops, codecs | [Dialects and adaptation](references/guides/dialects-and-adaptation.mdx) |
| Rollout statuses and `max_turns`, failures, retries, streaming | [Rollout outcomes and retries](references/guides/rollout-outcomes.mdx) |
| Messages and content, stored records, transcripts, conversations in the viewer, checkpoints | [Conversation records and checkpoints](references/guides/conversation-records.mdx) |
| Run Docent readings, or convert records for Docent | [Docent readings](references/guides/docent-readings.mdx) |
| Choose a layer; imports, adapters (including Gemini and OpenRouter) and their options, model providers, sampling, reasoning and speed settings, requests and responses | [API overview](references/reference/api.mdx) |
| Steps, workflows, arrays, launching jobs, and the step cache | the adjacent [fxtr skill](../fxtr/SKILL.md) |

## Best practices

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.1.0a0",
"behaviors": "0.0.1a4"
"fxtr": "0.2.0a0",
"behaviors": "0.0.1a5"
},
"revision": "052f907cc35979930fda832a71aec0c2194e7e48",
"revision": "d4dc6a2e28ca36addbd6aee70256eb22317e1c93",
"modified": false,
"content_sha256": "a9a5b26e4b86c7b765f0d3c7ce1ce7bea062364e7112c5bec2ad86aed6ca2f1d"
"content_sha256": "384ea30cb2960b22608612b69eae76cde2e91e70eca2341ebcb3df757e0c7a90"
}
1 change: 1 addition & 0 deletions plugins/fxtr/skills/behaviors/references/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ in the order of the site's navigation.

- [Choosing models](guides/choosing-models.mdx): Find the exact model IDs a provider offers your account, pick the adapter for its endpoint, and check a model before a sweep.
- [Conversation records and checkpoints](guides/conversation-records.mdx): What a rollout records, how conversations are stored as fxtr entities and flattened into transcripts, and how to checkpoint a session.
- [Dialects and adaptation](guides/dialects-and-adaptation.mdx): How a request reaches each provider: the dialects the adapters speak, what an adapter changes to send a request and how to refuse it, structured output, responses that are not answers, and the codecs behind the adapters.
- [Docent readings](guides/docent-readings.mdx): Convert conversations to Docent's data models, and run a Docent reading against a transcript or agent run with a model you choose.
- [Calling language models](guides/language-models.mdx): Use the behaviors library to hold conversations and judge outputs in fxtr steps.
- [Policies and tools](guides/policies-and-tools.mdx): Decide what the model sees each turn: scripted users, users simulated by a base model and steered by a pilot, tool policies, their combinations, and custom conversation flows.
Expand Down
45 changes: 32 additions & 13 deletions plugins/fxtr/skills/behaviors/references/guides/choosing-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ This is one page, even with `limit=1000`. While `has_more` is true, request the
`after_id` set to the returned `last_id`, and collect its models before advancing again.
Pass a returned `id` to `AnthropicMessagesAPI(model_id)`; `display_name` is only for presentation.

## Gemini

[List models](https://ai.google.dev/api/models#method:-models.list)
with `GET https://generativelanguage.googleapis.com/v1beta/models`:

```bash
curl --fail-with-body --silent --show-error \
'https://generativelanguage.googleapis.com/v1beta/models?pageSize=1000' \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-o /tmp/gemini-models.json &&
jq -r '.models[]
| select(.supportedGenerationMethods | index("generateContent"))
| [(.name | sub("^models/"; "")), .displayName] | @tsv' /tmp/gemini-models.json &&
jq '{nextPageToken}' /tmp/gemini-models.json
```

While `nextPageToken` is set, request the next page with `pageToken` set to it. The filter keeps
models that serve `generateContent`, the method the adapter calls. Pass the returned `name`
without its `models/` prefix to `GeminiGenerateContentAPI(model_id)`, from
`behaviors.implementations.models.gemini`.

## OpenRouter

OpenRouter serves models from multiple vendors through an OpenAI-compatible endpoint. Its
Expand All @@ -71,31 +92,29 @@ For the general catalog, change `/models/user` to `/models`. The
Use the full returned `id`, including its vendor prefix and any suffix, with:

```python
import os

from behaviors.implementations.models.openai_compatible import OpenAICompatibleAPI
from behaviors.implementations.models.openrouter import OpenRouterAPI

api = OpenAICompatibleAPI(
model_id, # Exact id selected from the OpenRouter listing.
base_url="https://openrouter.ai/api/v1",
api_key=os.environ["OPENROUTER_API_KEY"],
)
api = OpenRouterAPI(model_id) # Exact id selected from the OpenRouter listing.
```

The OpenAI SDK does not read `OPENROUTER_API_KEY` by itself, so pass it explicitly as above.
`OpenRouterAPI` reads `OPENROUTER_API_KEY` unless you pass `api_key`, and sends back the
reasoning state OpenRouter returns, which `OpenAICompatibleAPI` pointed at OpenRouter would not.
Close the adapter with `await api.aclose()` when finished, as in the
[conversation step](language-models.mdx#a-conversation-as-a-step).

## Search and validate a candidate

Search a saved response by ID or display name, changing the file and search text as needed:
Search a saved response by ID or display name, changing the file and search text as needed. The
filter reads any of the listings above: Gemini's lists `models` rather than `data`, and its `name`
is the ID with a `models/` prefix, which the filter removes.

```bash
jq -r --arg query 'claude' '
.data[]
| select(([.id, (.name // .display_name // "")] | join(" ") | ascii_downcase)
(.data // .models)[]
| (.id // (.name | sub("^models/"; ""))) as $id
| select(([$id, (.display_name // .displayName // .name // "")] | join(" ") | ascii_downcase)
| contains($query | ascii_downcase))
| .id
| $id
' /tmp/openrouter-models.json
```

Expand Down
Loading
Loading