Ir al contenido

Patrones y ejemplos de Crew

PasoMecanismo¿LLM?
RefrescarJob query_snapshotNo
NarrarCrew + json_get / json_set
Entregarnotify_send o job de entregaOpcional

1. Job de refresh (12:50 UTC) con clave digest:

Ventana de terminal
curl -X POST https://shareout.site/v1/jobs \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{
"artifact_id": "art_dashboard",
"action": "query_snapshot",
"schedule": "50 12 * * *",
"config": {
"connection": "bigquery",
"params": { "projectId": "my-gcp-project" },
"queries": [
{ "query": "SELECT …", "target": { "type": "json", "name": "digest", "path": "trends" } }
]
}
}'

2. Crew de narración (13:00 UTC):

await sdk.crew.define({
name: 'Briefing diario',
instructions: 'json_get digest → briefing 110–170 palabras en mrkdwn → notify_send Slack mode both.',
tools: { read: ['json_get'], write: ['notify_send'], approval: { notify_send: 'never' } },
});
await sdk.crew.triggers.create({ kind: 'cron', cron: '0 13 * * *' });
await sdk.crew.define({
instructions: 'Si revenue < 0 en sales, json_set alerts con ids; si no, [].',
tools: { read: ['table_query'], write: ['json_set'] },
});
"on_trigger": {
"crew": true,
"instruction": "Explicá la caída en 3 bullets y notify_send a Slack."
}

Ver alertas de métricas.

@ShareOutAI_botask_crew. Ver Bot de Telegram.

const { runs } = await sdk.crew.runs.list({ limit: 10 });
for await (const event of sdk.crew.runs.stream(runs[0].id)) {
console.log(event.type, event.summary ?? event.content ?? '');
}