> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# streamText()

> Function exported by @botmesh/core.

```ts theme={null}
function streamText(
   target, 
   source, 
   opts?
): Promise<StreamResult>;
```

Defined in: [streaming/streamText.ts:464](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/streamText.ts#L464)

Stream `source` into `target`. `ctx.stream(source, opts)` is this function
bound to the current chat; use it directly for custom sinks (and tests).
Rejects with the source's error (after flushing what was produced) or with the
first send error.

## Parameters

| Parameter | Type |
| - | - |
| `target` | [`StreamTarget`](https://botmesh.afaya.com.co/api/core/interfaces/StreamTarget) |
| `source` | [`StreamSource`](https://botmesh.afaya.com.co/api/core/type-aliases/StreamSource) |
| `opts?` | [`StreamOptions`](https://botmesh.afaya.com.co/api/core/interfaces/StreamOptions) |

## Returns

`Promise`\<[`StreamResult`](https://botmesh.afaya.com.co/api/core/interfaces/StreamResult)>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.