# Trigger Authoring Chat Agent

> Author and run a durable AI chat agent with chat.agent from @trigger.dev/sdk/ai: the per-turn run…

Author and run a durable AI chat agent with chat.agent from @trigger.dev/sdk/ai: the per-turn run loop, why you MUST spread ...chat.toStreamTextOptions() first, returning a StreamTextResult vs calling chat.pipe(), the two server actions (chat.createStartSessionAction + auth.createPublicToken), and wiring useChat to useTriggerChatTransport. Load this when building, modifying, or debugging a chat backend (the agent task or its lifecycle hooks) or its React transport, when declaring typed tools or custom data parts, or when migrating a plain AI SDK streamText route to chat.agent.

- Page: https://ss33.ai/skills/triggerdotdev/trigger-authoring-chat-agent-12415498692
- Publisher: triggerdotdev
- Category: [AI & Agents](https://ss33.ai/skills/category/ai-and-agents-y6jz7i) › [Orchestration & multi-agent](https://ss33.ai/skills/category/ai-and-agents-y6jz7i/orchestration-and-multi-agent-tlbx40)
- Source: https://github.com/triggerdotdev/skills/blob/e0f9f87153d1502fd9f6298e2eb1d58cfd7f9871/trigger-authoring-chat-agent/SKILL.md

## Skill

This skill's licence does not allow redistribution, so the store does not serve its text. Get it from the author: https://github.com/triggerdotdev/skills/blob/e0f9f87153d1502fd9f6298e2eb1d58cfd7f9871/trigger-authoring-chat-agent/SKILL.md
