@agenttool/sdk 0.2.11 → 0.2.13
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 +13 -9
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,22 +160,26 @@ await at.economy.releaseEscrow(escrow.id);
|
|
|
160
160
|
```typescript
|
|
161
161
|
// Store a reasoning trace
|
|
162
162
|
const trace = await at.traces.store({
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
observations: [
|
|
164
|
+
"User asked about climate solutions",
|
|
165
|
+
"Searched web: found 3 relevant papers",
|
|
166
|
+
],
|
|
167
|
+
conclusion: "Renewable energy is the most actionable near-term solution",
|
|
168
|
+
decision_type: "decision", // "decision" | "tool_call" | "plan" | "verification" | "other"
|
|
169
|
+
confidence: 0.87,
|
|
170
|
+
tags: ["climate", "research"],
|
|
171
|
+
agent_id: "research-agent",
|
|
166
172
|
});
|
|
173
|
+
console.log(trace.trace_id); // "tr_a1b2c3d4e5f6"
|
|
167
174
|
|
|
168
175
|
// Semantic search across traces
|
|
169
|
-
const results = await at.traces.search({
|
|
170
|
-
query: "decisions about climate data",
|
|
171
|
-
limit: 5,
|
|
172
|
-
});
|
|
176
|
+
const results = await at.traces.search("decisions about climate data", { limit: 5 });
|
|
173
177
|
|
|
174
178
|
// Get a chain of reasoning steps
|
|
175
|
-
const chain = await at.traces.chain(
|
|
179
|
+
const chain = await at.traces.chain(trace.trace_id);
|
|
176
180
|
|
|
177
181
|
// Delete
|
|
178
|
-
await at.traces.delete(trace.
|
|
182
|
+
await at.traces.delete(trace.trace_id);
|
|
179
183
|
```
|
|
180
184
|
|
|
181
185
|
## Integration example — LangChain / Vercel AI SDK
|
package/dist/index.d.ts
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
export { AgentTool } from "./client.js";
|
|
13
13
|
export { AgentToolError } from "./errors.js";
|
|
14
14
|
export type { Trace, StoreTraceOptions, SearchTracesOptions, TraceSearchResult, TraceChain } from "./traces.js";
|
|
15
|
-
export type { CreateEscrowOptions, CreateWalletOptions, DocumentResult, Escrow, ExecuteResult, ParseDocumentOptions, Memory, ScrapeResult, SearchMemoryOptions, SearchResponse, SearchResult, StoreOptions, UsageStats, VerifyResult, Wallet, WalletPolicy, } from "./types.js";
|
|
15
|
+
export type { CreateEscrowOptions, CreateWalletOptions, DocumentResult, Escrow, ExecuteResult, ParseDocumentOptions, Memory, ScrapeResult, SearchMemoryOptions, SearchResponse, SearchResult, StoreOptions, UsageStats, VerifyEvidence, VerifyResult, VerifySource, Wallet, WalletPolicy, } from "./types.js";
|