AnthropicStream
Namespace: Vercel.AI.Anthropic
public sealed class AnthropicStreamTurns Anthropic SSE JSON events into SDK stream parts.
Inheritance: object
Constructors
Section titled “Constructors”AnthropicStream(bool, bool)
Section titled “AnthropicStream(bool, bool)”public AnthropicStream(bool includeRawChunks, bool usesJsonResponseTool)Creates a stream reader.
Parameters
| Name | Type | Description |
|---|---|---|
includeRawChunks |
bool | |
usesJsonResponseTool |
bool |
AnthropicStream(bool, bool, string, bool)
Section titled “AnthropicStream(bool, bool, string, bool)”public AnthropicStream(bool includeRawChunks, bool usesJsonResponseTool, string providerOptionsName, bool usedCustomProviderKey)Creates a stream reader that mirrors the finish metadata under a custom provider key.
Parameters
| Name | Type | Description |
|---|---|---|
includeRawChunks |
bool | |
usesJsonResponseTool |
bool | |
providerOptionsName |
string | |
usedCustomProviderKey |
bool |
Methods
Section titled “Methods”Complete()
Section titled “Complete()”public IEnumerable<LanguageModelStreamPart> Complete()Ends the stream. Returns an interrupted finish part when the events ended cleanly after output
without a message_stop for the last message. A stream without output, or with an error,
gets no finish part so the existing no-output and error paths apply.
Returns: IEnumerable<LanguageModelStreamPart>
Push(string)
Section titled “Push(string)”public IEnumerable<LanguageModelStreamPart> Push(string json)Reads one SSE data payload.
Parameters
| Name | Type | Description |
|---|---|---|
json |
string |
Returns: IEnumerable<LanguageModelStreamPart>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product