@raindrop-ai/ai-sdk 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -55,6 +55,28 @@ await raindrop.users.identify({
55
55
  await raindrop.flush();
56
56
  ```
57
57
 
58
+ ## Tool catalog capture
59
+
60
+ Every model-call span (`ai.generateText.doGenerate`, `ai.streamText.doStream`, ...)
61
+ records the tools the model was given as `ai.prompt.tools`: one JSON document per
62
+ tool with `name`, `description` and the JSON Schema as `inputSchema` (Zod and other
63
+ framework schemas are converted through the AI SDK's own `asSchema`). Provider-defined
64
+ tools (`openai.web_search`, ...) keep their `id` / `args` and get no invented schema.
65
+ This works on both the `wrap()` Proxy path and the v7 native telemetry path and is
66
+ gated by `recordInputs`, like `ai.prompt.messages`.
67
+
68
+ | Option | Type | Default | Description |
69
+ | --- | --- | --- | --- |
70
+ | `tools` | `ToolDeclaration[]` | - | Overrides the tool catalog recorded as `ai.prompt.tools` on every model span. Use when the integration cannot see the tools the model was given. |
71
+
72
+ ```ts
73
+ // wrap() path
74
+ const { generateText } = raindrop.wrap(ai, { context: { userId }, tools: myToolCatalog });
75
+ // v7 native telemetry path
76
+ registerTelemetry(raindrop({ writeKey, tools: myToolCatalog }));
77
+ registerTelemetry(client.createTelemetryIntegration({ context: { userId }, tools: [] }));
78
+ ```
79
+
58
80
  ## Projects
59
81
 
60
82
  If your org has multiple projects, route events to a specific one by passing its