Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions api-reference/cli/cloud/deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `deploy` command creates a new agent deployment or updates an existing one.

When no image is specified, the CLI will offer to build your agent using [Pipecat Cloud Build](/pipecat-cloud/guides/cloud-builds). This handles building and deploying without requiring you to manage a container registry. A `Dockerfile` must be present in your build context directory.

If the agent name already exists, you'll be prompted to confirm the update unless the `--force` flag is used.
If the agent name already exists, you'll be prompted to confirm the update. Use `--force` to skip this prompt and also force a new deployment even if the configuration hasn't changed (replacing all running pods).

This command will wait for the active deployment / revision to enter a ready state before returning. If the deployment fails, the command will exit with an [error](/pipecat-cloud/fundamentals/error-codes) with more information.

Expand Down Expand Up @@ -91,7 +91,9 @@ See [Agent Profiles](/pipecat-cloud/fundamentals/deploy#agent-profiles) for more
</ParamField>

<ParamField path="--force / -f" type="boolean" default="false">
Force deployment and skip confirmation prompts. Use with caution.
Force a new deployment even if the configuration hasn't changed, replacing all
running pods. Useful for picking up updated container images when using mutable
tags like `latest`, or for refreshing modified secret values.
</ParamField>

<ParamField path="--yes / -y" type="boolean" default="false">
Expand Down Expand Up @@ -220,7 +222,7 @@ This allows you to define defaults in the config file while still overriding spe

<ParamField path="agent_name" type="string" required>
Name of the agent to deploy. Must start with a lowercase letter or number, can
include hyphens, and must end with a lowercase letter or number.
include hyphens, and must end with a lowercase letter or number. Maximum 54 characters.

```toml
agent_name = "my-voice-agent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@
"properties": {
"serviceName": {
"type": "string",
"description": "Name of the agent to create.\n\nMust start with a lowercase letter or number, can include hyphens, and must end with a lowercase letter or number. No uppercase letters or special characters allowed.",
"description": "Name of the agent to create.\n\nMust start with a lowercase letter or number, can include hyphens, and must end with a lowercase letter or number. No uppercase letters or special characters allowed. Maximum 54 characters.",
"example": "my-voice-agent",
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$"
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])$",
"maxLength": 54
},
"image": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@
"enum": ["agent-1x", "agent-2x", "agent-3x"],
"default": "agent-1x",
"example": "agent-1x"
},
"forceRedeploy": {
"type": "boolean",
"description": "Force a new deployment even if the configuration hasn't changed. Useful for picking up updated container images when using mutable tags like `latest`, or for refreshing modified secret values.",
"default": false,
"example": true
}
}
},
Expand Down
16 changes: 16 additions & 0 deletions api-reference/pipecat-subagents/base-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ agent.active -> bool

Whether this agent is currently active.

### activation_args

```python
agent.activation_args -> Optional[dict]
```

The arguments from the most recent activation, or `None` if the agent is inactive. The value is cleared when the agent is deactivated.

### parent

```python
Expand All @@ -87,6 +95,14 @@ agent.bridged -> bool

Whether this agent is bridged (receives pipeline frames from the bus).

### ready

```python
agent.ready -> bool
```

Whether this agent's pipeline has started and is ready to operate.

### started_at

```python
Expand Down
18 changes: 17 additions & 1 deletion api-reference/pipecat-subagents/bus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,28 @@ pipeline = Pipeline([transport.input(), bridge, transport.output()])

## BusSubscriber

Mixin for objects that receive messages from an `AgentBus`. Implementors override `on_bus_message()` to handle incoming messages.
Mixin for objects that receive messages from an `AgentBus`. Implementors override `on_bus_message()` to handle incoming messages. Concrete subscribers must provide a `name` property (typically inherited from `BaseObject`) that uniquely identifies the subscriber on the bus.

```python
from pipecat_subagents.bus.subscriber import BusSubscriber

class MySubscriber(BusSubscriber):
@property
def name(self) -> str:
return "my_subscriber"

async def on_bus_message(self, message: BusMessage) -> None:
...
```

### Properties

<ParamField path="name" type="str" required>
Unique name identifying this subscriber on the bus. Built-in subscribers inherit this from `BaseObject`; custom implementations that extend `BusSubscriber` directly must provide one.
</ParamField>

### Methods

<ParamField path="on_bus_message" type="async (message: BusMessage) -> None">
Override to handle an incoming bus message.
</ParamField>
13 changes: 1 addition & 12 deletions api-reference/pipecat-subagents/decorators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def get_weather(self, params, location: str, unit: str = "celsius"):

Mark an agent method as a task handler.

Decorated methods are automatically collected by [`BaseAgent`](/api-reference/pipecat-subagents/base-agent) at initialization and dispatched when matching task requests arrive.
Decorated methods are automatically collected by [`BaseAgent`](/api-reference/pipecat-subagents/base-agent) at initialization and dispatched when matching task requests arrive. Each request runs in its own asyncio task so the bus message loop is never blocked.

```python
from pipecat_subagents.agents import task
Expand All @@ -78,12 +78,6 @@ async def on_task_request(self, message):

# Named handler (receives only "research" requests)
@task(name="research")
async def on_research(self, message):
result = await do_research(message.payload)
await self.send_task_response(result)

# Parallel handler (each request runs concurrently)
@task(name="research", parallel=True)
async def on_research(self, message):
result = await do_research(message.payload)
await self.send_task_response(result)
Expand All @@ -97,11 +91,6 @@ async def on_research(self, message):
matching named handler).
</ParamField>

<ParamField path="parallel" type="bool" default="False">
When `True`, each request runs in a separate asyncio task for concurrent
execution.
</ParamField>

### Method Signature

Task handler methods receive a [`BusTaskRequestMessage`](/api-reference/pipecat-subagents/messages#bustaskrequestmessage):
Expand Down
90 changes: 90 additions & 0 deletions client/concepts/events-and-callbacks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ You are currently viewing the React version of this page. Use the dropdown to th
You are currently viewing the JavaScript version of this page. Use the dropdown to the right to customize this page for your client framework.
</Callout>
</View>
<View title="React Native" icon="mobile">
<Callout icon="mobile" color="#FFC107">
You are currently viewing the React Native version of this page. Use the dropdown to the right to customize this page for your client framework.
</Callout>
</View>

The Pipecat client emits events throughout the session lifecycle — when the bot connects, when the user speaks, when a transcript arrives, and more.

Expand Down Expand Up @@ -69,6 +74,29 @@ Callbacks and event listeners are equivalent — use whichever pattern fits your

</View>

<View title="React Native" icon="mobile">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use exactly the same code snippet for JavaScript ? I noticed they are slightly different.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, claude seemed to take the approach of using react with the ReactNative docs and wasn't sure if that was the right thing or if 99% of the docs should just look the same as JavaScript.


Use `useEffect` with `.on()` and `.off()` to subscribe and clean up within a component:

```tsx
import { RTVIEvent, TranscriptData } from "@pipecat-ai/client-js";
import { useEffect } from "react";

function TranscriptDisplay() {
useEffect(() => {
const handler = (data: TranscriptData) => {
if (data.final) setTranscript(data.text);
};
client.on(RTVIEvent.UserTranscript, handler);
return () => client.off(RTVIEvent.UserTranscript, handler);
}, []);
}
```

Always return a cleanup function from `useEffect` to remove the listener when the component unmounts.

</View>

---

## Event reference
Expand Down Expand Up @@ -157,6 +185,24 @@ client.on(RTVIEvent.UserTranscript, (data) => {

</View>

<View title="React Native" icon="mobile">

```tsx
useEffect(() => {
const handler = (data: TranscriptData) => {
if (data.final) {
addMessage(data.text); // committed
} else {
updatePartial(data.text); // still in progress
}
};
client.on(RTVIEvent.UserTranscript, handler);
return () => client.off(RTVIEvent.UserTranscript, handler);
}, []);
```

</View>

`BotOutput` is the recommended way to display the bot's response text. It provides the best possible representation of what the bot is saying — supporting interruptions and unspoken responses. By default, Pipecat aggregates output by sentences and words (assuming your TTS supports streaming), but custom aggregation strategies are supported too - like breaking out code snippets or other structured content:

<View title="React" icon="react">
Expand Down Expand Up @@ -186,6 +232,22 @@ client.on(RTVIEvent.BotOutput, (data) => {

</View>

<View title="React Native" icon="mobile">

```tsx
useEffect(() => {
const handler = (data: BotOutputData) => {
if (data.aggregated_by === "sentence") {
appendSentence(data.text);
}
};
client.on(RTVIEvent.BotOutput, handler);
return () => client.off(RTVIEvent.BotOutput, handler);
}, []);
```

</View>

### Errors

| Event | Callback | When it fires |
Expand Down Expand Up @@ -226,6 +288,24 @@ client.on(RTVIEvent.Error, ({ data }) => {

</View>

<View title="React Native" icon="mobile">

```tsx
useEffect(() => {
const handler = ({ data }) => {
if (data.fatal) {
showReconnectPrompt(data.message);
} else {
showToast(data.message);
}
};
client.on(RTVIEvent.Error, handler);
return () => client.off(RTVIEvent.Error, handler);
}, []);
```

</View>

### Devices and tracks

| Event | Callback | When it fires |
Expand Down Expand Up @@ -285,3 +365,13 @@ For custom server\<-\>client messaging, see [Custom Messaging](/client/guides/cu
</CardGroup>

</View>

<View title="React Native" icon="mobile">

<CardGroup cols={1}>
<Card title="JavaScript SDK Callbacks" icon="js" href="/api-reference/client/js/callbacks">
Complete callback signatures, data types, and transport compatibility
</Card>
</CardGroup>

</View>
Loading