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
13 changes: 9 additions & 4 deletions api-reference/pipecat-flows/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ TypedDict for configuring actions that execute during node transitions.
</ParamField>

<ParamField path="text" type="str" default="None">
Text content used by `tts_say` and optionally by `end_conversation` (as a
goodbye message).
Text to speak for the `tts_say` action, or the optional goodbye message for
the `end_conversation` action.
</ParamField>

<ParamField path="append_text_to_context" type="bool" default="True">
For the built-in TTS actions (`tts_say` and `end_conversation`), whether the
spoken text is appended to the LLM context. Defaults to `True`.
</ParamField>

<Note>
Expand All @@ -199,8 +204,8 @@ TypedDict for configuring actions that execute during node transitions.

| Type | Description | Required Fields |
| ------------------ | ----------------------------------------------------------- | ----------------- |
| `tts_say` | Speak text using the pipeline's TTS service | `text` |
| `end_conversation` | End the conversation, optionally speaking a goodbye message | `text` (optional) |
| `tts_say` | Speak text using the pipeline's TTS service. The spoken text is appended to the LLM context by default; set `append_text_to_context=False` to opt out. | `text` |
| `end_conversation` | End the conversation, optionally speaking a goodbye message. If `text` is provided, it is appended to the LLM context by default; set `append_text_to_context=False` to opt out. | `text` (optional) |
| `function` | Execute a function inline in the pipeline | `handler` |

### Example
Expand Down
24 changes: 24 additions & 0 deletions pipecat-flows/guides/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ Speak a phrase immediately (useful for "please wait" messages):
]
```

The spoken text is appended to the LLM context by default. To prevent the text from being added to the context, set `append_text_to_context=False`:

```python
"pre_actions": [
{
"type": "tts_say",
"text": "Processing...",
"append_text_to_context": False
}
]
```

### end_conversation

Gracefully terminate the conversation:
Expand All @@ -40,6 +52,18 @@ Gracefully terminate the conversation:
]
```

The goodbye text is appended to the LLM context by default. To prevent the text from being added to the context, set `append_text_to_context=False`:

```python
"post_actions": [
{
"type": "end_conversation",
"text": "Goodbye!",
"append_text_to_context": False
}
]
```

### function

Execute a custom function at the specified timing:
Expand Down
7 changes: 7 additions & 0 deletions pipecat-flows/guides/context-strategies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ Flows provides three built-in ways to manage conversation context as you move be
pre-action.
</Warning>

<Info>
**Initial node behavior:** The initial flow node follows its context strategy (default `APPEND`)
instead of always replacing the context. With the default strategy, context written before the
node's first inference — for example by a `tts_say` pre-action — is now preserved rather than
discarded. Set `context_strategy=RESET` on the initial node for the previous clean-slate behavior.
</Info>

## When to Use Each Strategy

- Use **APPEND** when full conversation history is important for context
Expand Down
Loading