Skip to main content

Constructors

Methods


Constructors

constructor

new GraphOutputStreamResponse(data: T, done?: boolean): GraphOutputStreamResponse
Creates a new GraphOutputStreamResponse instance.

Parameters

data
T
required
The graph output stream data, if available
done
boolean
Whether the graph has finished executing. When true, indicates that the graph execution has completed and no more data will be streamed.

Returns

GraphOutputStreamResponse

Methods

isString

isString(): boolean

Returns

boolean

isCustom

isCustom(): boolean

Returns

boolean

isClassificationResult

isClassificationResult(): boolean

Returns

boolean

isContent

isContent(): boolean

Returns

boolean

isGoalAdvancement

isGoalAdvancement(): boolean

Returns

boolean

isAudio

isAudio(): boolean

Returns

boolean

isKnowledgeRecords

isKnowledgeRecords(): boolean

Returns

boolean

isListToolsResponse

isListToolsResponse(): boolean

Returns

boolean

isLLMChatRequest

isLLMChatRequest(): boolean

Returns

boolean

isMatchedIntents

isMatchedIntents(): boolean

Returns

boolean

isMatchedKeywords

isMatchedKeywords(): boolean

Returns

boolean

isSafetyResult

isSafetyResult(): boolean

Returns

boolean

isMemoryState

isMemoryState(): boolean

Returns

boolean

isToolCallResponse

isToolCallResponse(): boolean

Returns

boolean

isTextStream

isTextStream(): boolean

Returns

boolean

isContentStream

isContentStream(): boolean

Returns

boolean

isTTSOutputStream

isTTSOutputStream(): boolean

Returns

boolean

isSpeechChunkStream

isSpeechChunkStream(): boolean

Returns

boolean

isGraphError

isGraphError(): boolean

Returns

boolean

processResponse

processResponse(handlers: object): Promise<void>
Processes the graph output stream response with type safety using a visitor pattern. This function makes it easy to handle different response types in a switch-like pattern.

Parameters

handlers
object
required
Object containing handler functions for each type

Returns

Promise<void>