[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M753WS0HR5G4ASJ9ZYB8WJZD":3,"skill-same:01M753WS0HR5G4ASJ9ZYB8WJZD":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M753WS0HR5G4ASJ9ZYB8WJZD","mistral-webhooks-events",null,"Implement event handling patterns for Mistral AI integrations.\nUse when building async workflows, implementing queues,\nor handling long-running Mistral AI operations.\nTrigger with phrases like \"mistral events\", \"mistral async\",\n\"mistral queue\", \"mistral background jobs\", \"mistral webhook\".","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fmistral-webhooks-events\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: mistral-webhooks-events\ndescription: |\n  Implement event handling patterns for Mistral AI integrations.\n  Use when building async workflows, implementing queues,\n  or handling long-running Mistral AI operations.\n  Trigger with phrases like \"mistral events\", \"mistral async\",\n  \"mistral queue\", \"mistral background jobs\", \"mistral webhook\".\nallowed-tools: Read, Write, Edit, Bash(curl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\ncompatible-with: claude-code, codex, openclaw\n---\n# Mistral AI Events & Async Patterns\n\n## Overview\nImplement async patterns and event handling for Mistral AI integrations. Note: Mistral AI does not have native webhooks, so this skill covers async patterns and event-driven architectures.\n\n## Prerequisites\n- Mistral AI SDK installed\n- Queue system (Redis, SQS, etc.) for async processing\n- Event emitter or pub\u002Fsub for notifications\n- Background job processor (BullMQ, etc.)\n\n## Instructions\n\n### Step 1: Event-Driven Chat Architecture\n\n```typescript\nimport { EventEmitter } from 'events';\nimport Mistral from '@mistralai\u002Fmistralai';\n\n\u002F\u002F Custom event types\ninterface MistralEvents {\n  'chat:start': { requestId: string; model: string; timestamp: Date };\n  'chat:chunk': { requestId: string; content: string; index: number };\n  'chat:complete': { requestId: string; fullResponse: string; usage: any };\n  'chat:error': { requestId: string; error: Error };\n}\n\nclass MistralEventEmitter extends EventEmitter {\n  private client: Mistral;\n\n  constructor() {\n    super();\n    this.client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY! });\n  }\n\n  async chat(requestId: string, messages: any[], model = 'mistral-small-latest') {\n    this.emit('chat:start', { requestId, model, timestamp: new Date() });\n\n    try {\n      const stream = await this.client.chat.stream({ model, messages });\n\n      let fullResponse = '';\n      let index = 0;\n\n      for await (const event of stream) {\n        const content = event.data?.choices?.[0]?.delta?.content;\n        if (content) {\n          fullResponse += content;\n          this.emit('chat:chunk', { requestId, content, index: index++ });\n        }\n      }\n\n      const usage = { totalTokens: fullResponse.length \u002F 4 }; \u002F\u002F Estimate\n      this.emit('chat:complete', { requestId, fullResponse, usage });\n\n      return fullResponse;\n    } catch (error) {\n      this.emit('chat:error', { requestId, error: error as Error });\n      throw error;\n    }\n  }\n}\n\n\u002F\u002F Usage\nconst mistral = new MistralEventEmitter();\n\nmistral.on('chat:start', ({ requestId, model }) => {\n  console.log(`[${requestId}] Starting chat with ${model}`);\n});\n\nmistral.on('chat:chunk', ({ requestId, content }) => {\n  process.stdout.write(content);\n});\n\nmistral.on('chat:complete', ({ requestId, usage }) => {\n  console.log(`\\n[${requestId}] Complete. Tokens: ${usage.totalTokens}`);\n});\n\nmistral.on('chat:error', ({ requestId, error }) => {\n  console.error(`[${requestId}] Error:`, error.message);\n});\n\nawait mistral.chat('req-123', [{ role: 'user', content: 'Hello!' }]);\n```\n\n### Step 2: Background Job Processing with BullMQ\n\n```typescript\nimport { Queue, Worker, Job } from 'bullmq';\nimport Mistral from '@mistralai\u002Fmistralai';\nimport Redis from 'ioredis';\n\nconst connection = new Redis(process.env.REDIS_URL);\n\n\u002F\u002F Define job types\ninterface ChatJob {\n  id: string;\n  messages: Array\u003C{ role: string; content: string }>;\n  model: string;\n  callback?: string; \u002F\u002F Webhook URL to call on completion\n}\n\n\u002F\u002F Create queue\nconst chatQueue = new Queue\u003CChatJob>('mistral-chat', { connection });\n\n\u002F\u002F Create worker\nconst chatWorker = new Worker\u003CChatJob>(\n  'mistral-chat',\n  async (job: Job\u003CChatJob>) => {\n    const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY! });\n\n    const response = await client.chat.complete({\n      model: job.data.model,\n      messages: job.data.messages,\n    });\n\n    const result = {\n      jobId: job.id,\n      requestId: job.data.id,\n      content: response.choices?.[0]?.message?.content,\n      usage: response.usage,\n      completedAt: new Date().toISOString(),\n    };\n\n    \u002F\u002F Call webhook if provided\n    if (job.data.callback) {\n      await fetch(job.data.callback, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\u002Fjson' },\n        body: JSON.stringify(result),\n      });\n    }\n\n    return result;\n  },\n  {\n    connection,\n    concurrency: 5,\n    limiter: {\n      max: 10,\n      duration: 1000, \u002F\u002F Max 10 jobs per second  # 1000: 1 second in ms\n    },\n  }\n);\n\n\u002F\u002F Event handlers\nchatWorker.on('completed', (job, result) => {\n  console.log(`Job ${job.id} completed:`, result);\n});\n\nchatWorker.on('failed', (job, err) => {\n  console.error(`Job ${job?.id} failed:`, err.message);\n});\n\n\u002F\u002F API endpoint to queue jobs\nexport async function POST(request: Request) {\n  const body = await request.json();\n\n  const job = await chatQueue.add('chat', {\n    id: crypto.randomUUID(),\n    messages: body.messages,\n    model: body.model || 'mistral-small-latest',\n    callback: body.callback,\n  }, {\n    attempts: 3,\n    backoff: { type: 'exponential', delay: 1000 },  # 1 second in ms\n  });\n\n  return Response.json({\n    jobId: job.id,\n    status: 'queued',\n    statusUrl: `\u002Fapi\u002Fjobs\u002F${job.id}`,\n  });\n}\n```\n\n### Step 3: Webhook Notification System\n\n```typescript\nimport crypto from 'crypto';\n\ninterface WebhookPayload {\n  event: string;\n  timestamp: string;\n  data: any;\n}\n\nclass WebhookNotifier {\n  private secret: string;\n\n  constructor(secret: string) {\n    this.secret = secret;\n  }\n\n  private sign(payload: string): string {\n    return crypto\n      .createHmac('sha256', this.secret)\n      .update(payload)\n      .digest('hex');\n  }\n\n  async notify(url: string, event: string, data: any): Promise\u003Cboolean> {\n    const payload: WebhookPayload = {\n      event,\n      timestamp: new Date().toISOString(),\n      data,\n    };\n\n    const body = JSON.stringify(payload);\n    const signature = this.sign(body);\n\n    try {\n      const response = await fetch(url, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application\u002Fjson',\n          'X-Webhook-Signature': signature,\n          'X-Webhook-Timestamp': payload.timestamp,\n        },\n        body,\n      });\n\n      return response.ok;\n    } catch (error) {\n      console.error('Webhook failed:', error);\n      return false;\n    }\n  }\n}\n\n\u002F\u002F Usage\nconst notifier = new WebhookNotifier(process.env.WEBHOOK_SECRET!);\n\n\u002F\u002F After Mistral completion\nawait notifier.notify(\n  'https:\u002F\u002Fyourapp.com\u002Fwebhooks\u002Fmistral',\n  'chat.completed',\n  {\n    requestId: 'req-123',\n    content: response.choices?.[0]?.message?.content,\n    usage: response.usage,\n  }\n);\n```\n\n### Step 4: Server-Sent Events (SSE) for Real-Time Updates\n\n```typescript\n\u002F\u002F api\u002Fchat\u002Fstream\u002Froute.ts\nimport Mistral from '@mistralai\u002Fmistralai';\n\nexport async function POST(request: Request) {\n  const { messages } = await request.json();\n\n  const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY! });\n\n  const stream = await client.chat.stream({\n    model: 'mistral-small-latest',\n    messages,\n  });\n\n  const encoder = new TextEncoder();\n\n  const readable = new ReadableStream({\n    async start(controller) {\n      \u002F\u002F Send initial event\n      controller.enqueue(encoder.encode(`event: start\\ndata: {\"status\":\"started\"}\\n\\n`));\n\n      try {\n        let tokenCount = 0;\n        for await (const event of stream) {\n          const content = event.data?.choices?.[0]?.delta?.content;\n          if (content) {\n            tokenCount++;\n            controller.enqueue(\n              encoder.encode(`event: chunk\\ndata: ${JSON.stringify({ content, tokenCount })}\\n\\n`)\n            );\n          }\n        }\n\n        \u002F\u002F Send completion event\n        controller.enqueue(\n          encoder.encode(`event: complete\\ndata: ${JSON.stringify({ totalTokens: tokenCount })}\\n\\n`)\n        );\n      } catch (error: any) {\n        controller.enqueue(\n          encoder.encode(`event: error\\ndata: ${JSON.stringify({ error: error.message })}\\n\\n`)\n        );\n      }\n\n      controller.close();\n    },\n  });\n\n  return new Response(readable, {\n    headers: {\n      'Content-Type': 'text\u002Fevent-stream',\n      'Cache-Control': 'no-cache',\n      'Connection': 'keep-alive',\n    },\n  });\n}\n```\n\n### Step 5: Client-Side SSE Consumption\n\n```typescript\n\u002F\u002F Client-side JavaScript\nfunction streamChat(messages: any[]): EventSource {\n  const eventSource = new EventSource('\u002Fapi\u002Fchat\u002Fstream', {\n    \u002F\u002F Note: EventSource doesn't support POST directly\n    \u002F\u002F Use fetch with ReadableStream instead, or use a library\n  });\n\n  eventSource.addEventListener('start', (e) => {\n    console.log('Stream started');\n  });\n\n  eventSource.addEventListener('chunk', (e) => {\n    const { content } = JSON.parse(e.data);\n    process.stdout.write(content);\n  });\n\n  eventSource.addEventListener('complete', (e) => {\n    const { totalTokens } = JSON.parse(e.data);\n    console.log(`\\nComplete. Tokens: ${totalTokens}`);\n    eventSource.close();\n  });\n\n  eventSource.addEventListener('error', (e) => {\n    console.error('Stream error:', e);\n    eventSource.close();\n  });\n\n  return eventSource;\n}\n```\n\n## Output\n- Event-driven Mistral AI integration\n- Background job processing\n- Webhook notification system\n- Real-time streaming with SSE\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Job stuck in queue | Worker crashed | Implement job timeout and retry |\n| Webhook failed | Network\u002Fauth issue | Retry with exponential backoff |\n| SSE disconnected | Client timeout | Implement reconnection logic |\n| Event backpressure | Too many events | Implement buffering |\n\n## Examples\n\n### Python Async Pattern\n```python\nimport asyncio\nfrom mistralai import Mistral\n\nasync def process_batch(prompts: list[str]):\n    client = Mistral(api_key=os.environ.get(\"MISTRAL_API_KEY\"))\n\n    async def process_one(prompt: str):\n        response = await client.chat.complete_async(\n            model=\"mistral-small-latest\",\n            messages=[{\"role\": \"user\", \"content\": prompt}]\n        )\n        return response.choices[0].message.content\n\n    results = await asyncio.gather(*[process_one(p) for p in prompts])\n    return results\n```\n\n## Resources\n- [BullMQ Documentation](https:\u002F\u002Fdocs.bullmq.io\u002F)\n- [Server-Sent Events MDN](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FServer-sent_events)\n- [Mistral AI Streaming](https:\u002F\u002Fdocs.mistral.ai\u002Fcapabilities\u002Fcompletion\u002F#streaming)\n\n## Next Steps\nFor performance optimization, see `mistral-performance-tuning`.","# Mistral AI Events & Async Patterns\n\n## Overview\nImplement async patterns and event handling for Mistral AI integrations. Note: Mistral AI does not have native webhooks, so this skill covers async patterns and event-driven architectures.\n\n## Prerequisites\n- Mistral AI SDK installed\n- Queue system (Redis, SQS, etc.) for async processing\n- Event emitter or pub\u002Fsub for notifications\n- Background job processor (BullMQ, etc.)\n\n## Instructions\n\n### Step 1: Event-Driven Chat Architecture\n\n```typescript\nimport { EventEmitter } from 'events';\nimport Mistral from '@mistralai\u002Fmistralai';\n\n\u002F\u002F Custom event types\ninterface MistralEvents {\n  'chat:start': { requestId: string; model: string; timestamp: Date };\n  'chat:chunk': { requestId: string; content: string; index: number };\n  'chat:complete': { requestId: string; fullResponse: string; usage: any };\n  'chat:error': { requestId: string; error: Error };\n}\n\nclass MistralEventEmitter extends EventEmitter {\n  private client: Mistral;\n\n  constructor() {\n    super();\n    this.client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY! });\n  }\n\n  async chat(requestId: string, messages: any[], model = 'mistral-small-latest') {\n    this.emit('chat:start', { requestId, model, timestamp: new Date() });\n\n    try {\n      const stream = await this.client.chat.stream({ model, messages });\n\n      let fullResponse = '';\n      let index = 0;\n\n      for await (const event of stream) {\n        const content = event.data?.choices?.[0]?.delta?.content;\n        if (content) {\n          fullResponse += content;\n          this.emit('chat:chunk', { requestId, content, index: index++ });\n        }\n      }\n\n      const usage = { totalTokens: fullResponse.length \u002F 4 }; \u002F\u002F Estimate\n      this.emit('chat:complete', { requestId, fullResponse, usage });\n\n      return fullResponse;\n    } catch (error) {\n      this.emit('chat:error', { requestId, error: error as Error });\n      throw error;\n    }\n  }\n}\n\n\u002F\u002F Usage\nconst mistral = new MistralEventEmitter();\n\nmistral.on('chat:start', ({ requestId, model }) => {\n  console.log(`[${requestId}] Starting chat with ${model}`);\n});\n\nmistral.on('chat:chunk', ({ requestId, content }) => {\n  process.stdout.write(content);\n});\n\nmistral.on('chat:complete', ({ requestId, usage }) => {\n  console.log(`\\n[${requestId}] Complete. Tokens: ${usage.totalTokens}`);\n});\n\nmistral.on('chat:error', ({ requestId, error }) => {\n  console.error(`[${requestId}] Error:`, error.message);\n});\n\nawait mistral.chat('req-123', [{ role: 'user', content: 'Hello!' }]);\n```\n\n### Step 2: Background Job Processing with BullMQ\n\n```typescript\nimport { Queue, Worker, Job } from 'bullmq';\nimport Mistral from '@mistralai\u002Fmistralai';\nimport Redis from 'ioredis';\n\nconst connection = new Redis(process.env.REDIS_URL);\n\n\u002F\u002F Define job types\ninterface ChatJob {\n  id: string;\n  messages: Array\u003C{ role: string; content: string }>;\n  model: string;\n  callback?: string; \u002F\u002F Webhook URL to call on completion\n}\n\n\u002F\u002F Create queue\nconst chatQueue = new Queue\u003CChatJob>('mistral-chat', { connection });\n\n\u002F\u002F Create worker\nconst chatWorker = new Worker\u003CChatJob>(\n  'mistral-chat',\n  async (job: Job\u003CChatJob>) => {\n    const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY! });\n\n    const response = await client.chat.complete({\n      model: job.data.model,\n      messages: job.data.messages,\n    });\n\n    const result = {\n      jobId: job.id,\n      requestId: job.data.id,\n      content: response.choices?.[0]?.message?.content,\n      usage: response.usage,\n      completedAt: new Date().toISOString(),\n    };\n\n    \u002F\u002F Call webhook if provided\n    if (job.data.callback) {\n      await fetch(job.data.callback, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application\u002Fjson' },\n        body: JSON.stringify(result),\n      });\n    }\n\n    return result;\n  },\n  {\n    connection,\n    concurrency: 5,\n    limiter: {\n      max: 10,\n      duration: 1000, \u002F\u002F Max 10 jobs per second  # 1000: 1 second in ms\n    },\n  }\n);\n\n\u002F\u002F Event handlers\nchatWorker.on('completed', (job, result) => {\n  console.log(`Job ${job.id} completed:`, result);\n});\n\nchatWorker.on('failed', (job, err) => {\n  console.error(`Job ${job?.id} failed:`, err.message);\n});\n\n\u002F\u002F API endpoint to queue jobs\nexport async function POST(request: Request) {\n  const body = await request.json();\n\n  const job = await chatQueue.add('chat', {\n    id: crypto.randomUUID(),\n    messages: body.messages,\n    model: body.model || 'mistral-small-latest',\n    callback: body.callback,\n  }, {\n    attempts: 3,\n    backoff: { type: 'exponential', delay: 1000 },  # 1 second in ms\n  });\n\n  return Response.json({\n    jobId: job.id,\n    status: 'queued',\n    statusUrl: `\u002Fapi\u002Fjobs\u002F${job.id}`,\n  });\n}\n```\n\n### Step 3: Webhook Notification System\n\n```typescript\nimport crypto from 'crypto';\n\ninterface WebhookPayload {\n  event: string;\n  timestamp: string;\n  data: any;\n}\n\nclass WebhookNotifier {\n  private secret: string;\n\n  constructor(secret: string) {\n    this.secret = secret;\n  }\n\n  private sign(payload: string): string {\n    return crypto\n      .createHmac('sha256', this.secret)\n      .update(payload)\n      .digest('hex');\n  }\n\n  async notify(url: string, event: string, data: any): Promise\u003Cboolean> {\n    const payload: WebhookPayload = {\n      event,\n      timestamp: new Date().toISOString(),\n      data,\n    };\n\n    const body = JSON.stringify(payload);\n    const signature = this.sign(body);\n\n    try {\n      const response = await fetch(url, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application\u002Fjson',\n          'X-Webhook-Signature': signature,\n          'X-Webhook-Timestamp': payload.timestamp,\n        },\n        body,\n      });\n\n      return response.ok;\n    } catch (error) {\n      console.error('Webhook failed:', error);\n      return false;\n    }\n  }\n}\n\n\u002F\u002F Usage\nconst notifier = new WebhookNotifier(process.env.WEBHOOK_SECRET!);\n\n\u002F\u002F After Mistral completion\nawait notifier.notify(\n  'https:\u002F\u002Fyourapp.com\u002Fwebhooks\u002Fmistral',\n  'chat.completed',\n  {\n    requestId: 'req-123',\n    content: response.choices?.[0]?.message?.content,\n    usage: response.usage,\n  }\n);\n```\n\n### Step 4: Server-Sent Events (SSE) for Real-Time Updates\n\n```typescript\n\u002F\u002F api\u002Fchat\u002Fstream\u002Froute.ts\nimport Mistral from '@mistralai\u002Fmistralai';\n\nexport async function POST(request: Request) {\n  const { messages } = await request.json();\n\n  const client = new Mistral({ apiKey: process.env.MISTRAL_API_KEY! });\n\n  const stream = await client.chat.stream({\n    model: 'mistral-small-latest',\n    messages,\n  });\n\n  const encoder = new TextEncoder();\n\n  const readable = new ReadableStream({\n    async start(controller) {\n      \u002F\u002F Send initial event\n      controller.enqueue(encoder.encode(`event: start\\ndata: {\"status\":\"started\"}\\n\\n`));\n\n      try {\n        let tokenCount = 0;\n        for await (const event of stream) {\n          const content = event.data?.choices?.[0]?.delta?.content;\n          if (content) {\n            tokenCount++;\n            controller.enqueue(\n              encoder.encode(`event: chunk\\ndata: ${JSON.stringify({ content, tokenCount })}\\n\\n`)\n            );\n          }\n        }\n\n        \u002F\u002F Send completion event\n        controller.enqueue(\n          encoder.encode(`event: complete\\ndata: ${JSON.stringify({ totalTokens: tokenCount })}\\n\\n`)\n        );\n      } catch (error: any) {\n        controller.enqueue(\n          encoder.encode(`event: error\\ndata: ${JSON.stringify({ error: error.message })}\\n\\n`)\n        );\n      }\n\n      controller.close();\n    },\n  });\n\n  return new Response(readable, {\n    headers: {\n      'Content-Type': 'text\u002Fevent-stream',\n      'Cache-Control': 'no-cache',\n      'Connection': 'keep-alive',\n    },\n  });\n}\n```\n\n### Step 5: Client-Side SSE Consumption\n\n```typescript\n\u002F\u002F Client-side JavaScript\nfunction streamChat(messages: any[]): EventSource {\n  const eventSource = new EventSource('\u002Fapi\u002Fchat\u002Fstream', {\n    \u002F\u002F Note: EventSource doesn't support POST directly\n    \u002F\u002F Use fetch with ReadableStream instead, or use a library\n  });\n\n  eventSource.addEventListener('start', (e) => {\n    console.log('Stream started');\n  });\n\n  eventSource.addEventListener('chunk', (e) => {\n    const { content } = JSON.parse(e.data);\n    process.stdout.write(content);\n  });\n\n  eventSource.addEventListener('complete', (e) => {\n    const { totalTokens } = JSON.parse(e.data);\n    console.log(`\\nComplete. Tokens: ${totalTokens}`);\n    eventSource.close();\n  });\n\n  eventSource.addEventListener('error', (e) => {\n    console.error('Stream error:', e);\n    eventSource.close();\n  });\n\n  return eventSource;\n}\n```\n\n## Output\n- Event-driven Mistral AI integration\n- Background job processing\n- Webhook notification system\n- Real-time streaming with SSE\n\n## Error Handling\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Job stuck in queue | Worker crashed | Implement job timeout and retry |\n| Webhook failed | Network\u002Fauth issue | Retry with exponential backoff |\n| SSE disconnected | Client timeout | Implement reconnection logic |\n| Event backpressure | Too many events | Implement buffering |\n\n## Examples\n\n### Python Async Pattern\n```python\nimport asyncio\nfrom mistralai import Mistral\n\nasync def process_batch(prompts: list[str]):\n    client = Mistral(api_key=os.environ.get(\"MISTRAL_API_KEY\"))\n\n    async def process_one(prompt: str):\n        response = await client.chat.complete_async(\n            model=\"mistral-small-latest\",\n            messages=[{\"role\": \"user\", \"content\": prompt}]\n        )\n        return response.choices[0].message.content\n\n    results = await asyncio.gather(*[process_one(p) for p in prompts])\n    return results\n```\n\n## Resources\n- [BullMQ Documentation](https:\u002F\u002Fdocs.bullmq.io\u002F)\n- [Server-Sent Events MDN](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FServer-sent_events)\n- [Mistral AI Streaming](https:\u002F\u002Fdocs.mistral.ai\u002Fcapabilities\u002Fcompletion\u002F#streaming)\n\n## Next Steps\nFor performance optimization, see `mistral-performance-tuning`.",{"name":5,"author":24,"license":15,"version":25,"description":26,"allowed-tools":27,"compatible-with":28},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Implement event handling patterns for Mistral AI integrations.\nUse when building async workflows, implementing queues,\nor handling long-running Mistral AI operations.\nTrigger with phrases like \"mistral events\", \"mistral async\",\n\"mistral queue\", \"mistral background jobs\", \"mistral webhook\".\n","Read, Write, Edit, Bash(curl:*)","claude-code, codex, openclaw","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill mistral-webhooks-events",{"tool":41,"command":42},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill mistral-webhooks-events",{"tool":44,"command":45},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill mistral-webhooks-events","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fmistral-webhooks-events\u002FSKILL.md",true,[],[50,57,64,71,78,86],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]