@alveus-ai/std 0.1.38 → 0.1.40
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/examples/fan-out.ts +5 -1
- package/examples/router.ts +2 -2
- package/package.json +1 -1
package/examples/fan-out.ts
CHANGED
|
@@ -28,9 +28,13 @@ const scraper = agent$(async (_state, input: ScrapeInput, ctx: ExecutionContext)
|
|
|
28
28
|
const html = await response.text();
|
|
29
29
|
|
|
30
30
|
const result = await ctx.llm.chat([
|
|
31
|
+
{
|
|
32
|
+
role: 'system',
|
|
33
|
+
content: 'Respond with valid JSON only, no markdown or extra text.',
|
|
34
|
+
},
|
|
31
35
|
{
|
|
32
36
|
role: 'user',
|
|
33
|
-
content: `Extract the title and a one-sentence summary from this HTML:\n\n${html.slice(0, 5000)}`,
|
|
37
|
+
content: `Extract the title and a one-sentence summary from this HTML. Return as {"title": "...", "summary": "..."}:\n\n${html.slice(0, 5000)}`,
|
|
34
38
|
},
|
|
35
39
|
]);
|
|
36
40
|
|
package/examples/router.ts
CHANGED
|
@@ -54,11 +54,11 @@ export const ticketRouter = agent$(async (_state, input: Ticket, ctx: ExecutionC
|
|
|
54
54
|
ctx,
|
|
55
55
|
[
|
|
56
56
|
{
|
|
57
|
-
|
|
57
|
+
when: (ticket) => ticket.priority === 'high' || ticket.priority === 'critical',
|
|
58
58
|
agent: urgentHandler,
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
|
|
61
|
+
when: (ticket) =>
|
|
62
62
|
ticket.subject.toLowerCase().includes('payment') ||
|
|
63
63
|
ticket.subject.toLowerCase().includes('billing') ||
|
|
64
64
|
ticket.subject.toLowerCase().includes('invoice'),
|