Automation foundation model for tiny devices: 2-bit, 8-29 MB, tool calls, ASR, structured extraction and embeddings on phones, wearables, smart homes, robots, cars and microcontrollers.
docs: document the weights parameter of needle.extract() (#81)
LeonSGP954b60655e41
diff --git a/doc/apis.md b/doc/apis.mdindex 6be0929..6569506 100644--- a/doc/apis.md+++ b/doc/apis.md@@ -8,7 +8,7 @@| `agent.reset()` | Rewind the conversation, keep the tools loaded. || `needle.tool` | Decorator that turns a function into a tool schema (attached as `fn._needle_tool`). || `needle.Field(...)` | Per argument constraints, attached inline with `typing.Annotated` or passed as a default. |-| `needle.extract(text, schema, system=None, max_new_tokens=256)` | One shot extraction. Returns a Pydantic instance if `schema` is a model, else a dict, or `None` if nothing matched. |+| `needle.extract(text, schema, system=None, max_new_tokens=256, weights=None)` | One shot extraction. Returns a Pydantic instance if `schema` is a model, else a dict, or `None` if nothing matched. `weights` selects a tuned `.cact` and defaults to whatever the engine already has loaded. |## Declaring toolsdiff --git a/llms.txt b/llms.txtindex 2d63569..3df6d98 100644--- a/llms.txt+++ b/llms.txt@@ -24,7 +24,7 @@ pip install cactus-needle- `agent.reset()` - rewind the conversation, keep the tools loaded.- `needle.tool` - decorator that turns a function into a tool schema (attached as `fn._needle_tool`).- `needle.Field(default=..., *, description, enum, const, ge, le, gt, lt, multiple_of, min_length, max_length, pattern, format, min_items, max_items, unique_items)` - per-argument constraints; attach inline with `typing.Annotated`.-- `needle.extract(text, schema, system=None, max_new_tokens=256)` - one-shot extraction; returns a Pydantic instance if `schema` is a model, else a dict (or `None` if nothing matched).+- `needle.extract(text, schema, system=None, max_new_tokens=256, weights=None)` - one-shot extraction; returns a Pydantic instance if `schema` is a model, else a dict (or `None` if nothing matched). `weights` selects a tuned `.cact` and defaults to whatever the engine already has loaded, so extraction inherits the active tuned model unless you pass another path.## Defining tools (three equivalent ways)