risicare 0.5.2 → 0.6.0

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.
Files changed (38) hide show
  1. package/README.md +11 -6
  2. package/dist/frameworks/instructor.cjs.map +1 -1
  3. package/dist/frameworks/instructor.js.map +1 -1
  4. package/dist/frameworks/langchain.cjs.map +1 -1
  5. package/dist/frameworks/langchain.js.map +1 -1
  6. package/dist/frameworks/langgraph.cjs.map +1 -1
  7. package/dist/frameworks/langgraph.js.map +1 -1
  8. package/dist/frameworks/llamaindex.cjs.map +1 -1
  9. package/dist/frameworks/llamaindex.js.map +1 -1
  10. package/dist/index.cjs +19 -5
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.js +19 -5
  13. package/dist/index.js.map +1 -1
  14. package/dist/providers/anthropic/index.cjs.map +1 -1
  15. package/dist/providers/anthropic/index.js.map +1 -1
  16. package/dist/providers/bedrock/index.cjs.map +1 -1
  17. package/dist/providers/bedrock/index.js.map +1 -1
  18. package/dist/providers/cerebras/index.cjs.map +1 -1
  19. package/dist/providers/cerebras/index.js.map +1 -1
  20. package/dist/providers/cohere/index.cjs.map +1 -1
  21. package/dist/providers/cohere/index.js.map +1 -1
  22. package/dist/providers/google/index.cjs.map +1 -1
  23. package/dist/providers/google/index.js.map +1 -1
  24. package/dist/providers/groq/index.cjs.map +1 -1
  25. package/dist/providers/groq/index.js.map +1 -1
  26. package/dist/providers/huggingface/index.cjs.map +1 -1
  27. package/dist/providers/huggingface/index.js.map +1 -1
  28. package/dist/providers/mistral/index.cjs.map +1 -1
  29. package/dist/providers/mistral/index.js.map +1 -1
  30. package/dist/providers/ollama/index.cjs.map +1 -1
  31. package/dist/providers/ollama/index.js.map +1 -1
  32. package/dist/providers/openai/index.cjs.map +1 -1
  33. package/dist/providers/openai/index.js.map +1 -1
  34. package/dist/providers/together/index.cjs.map +1 -1
  35. package/dist/providers/together/index.js.map +1 -1
  36. package/dist/providers/vercel-ai/index.cjs.map +1 -1
  37. package/dist/providers/vercel-ai/index.js.map +1 -1
  38. package/package.json +1 -1
package/README.md CHANGED
@@ -142,9 +142,10 @@ import {
142
142
  init({ apiKey, endpoint }) // Initialize SDK
143
143
  agent({ name }, fn) // Wrap function with agent identity
144
144
  session({ sessionId, userId }, fn) // Group traces into user sessions
145
- traceThink('analyze', async () => {...}) // Tag reasoning phase
146
- traceDecide('choose', async () => {...}) // Tag decision phase
147
- traceAct('execute', async () => {...}) // Tag action phase
145
+ // These are WRAPPER FACTORIES: they return a function you then call.
146
+ await traceThink('analyze', async () => {...})() // note the trailing ()
147
+ await traceDecide('choose', async () => {...})()
148
+ await traceAct('execute', async () => {...})()
148
149
  reportError(error) // Report caught errors for diagnosis
149
150
  score(traceId, 'quality', 0.92) // Record evaluation score [0.0-1.0]
150
151
  tracedStream(asyncIterable, 'stream') // Trace async iterators
@@ -179,18 +180,22 @@ try {
179
180
  Structure your traces to see how your agent thinks, decides, and acts:
180
181
 
181
182
  ```typescript
183
+ // traceThink / traceDecide / traceAct RETURN A WRAPPED FUNCTION — they do not
184
+ // run your callback themselves. Call the result (the trailing `()` below).
185
+ // Omitting it is silent: you get a function back, your callback never runs,
186
+ // and no span is emitted.
182
187
  const myAgent = agent({ name: 'planner', role: 'coordinator' }, async (input) => {
183
188
  const analysis = await traceThink('analyze', async () => {
184
189
  return await openai.chat.completions.create({ /* ... */ });
185
- });
190
+ })();
186
191
 
187
192
  const decision = await traceDecide('choose-action', async () => {
188
193
  return pickBestAction(analysis);
189
- });
194
+ })();
190
195
 
191
196
  return await traceAct('execute', async () => {
192
197
  return executeAction(decision);
193
- });
198
+ })();
194
199
  });
195
200
  ```
196
201