Table of Contents

Class StreamBuilder

Namespace
Mythosia.AI.Models.Streaming
Assembly
Mythosia.AI.dll

Fluent builder for streaming structured output. Created by BeginStream(string).

var run = service.BeginStream(prompt)
    .WithStructuredOutput(new StructuredOutputPolicy { MaxRepairAttempts = 2 })
    .As<MyDto>();
public class StreamBuilder
Inheritance
StreamBuilder
Inherited Members

Methods

As<T>()

Begin a streaming run that will deserialize the final result to T. The stream starts immediately in the background.

public StructuredStreamRun<T> As<T>() where T : class

Returns

StructuredStreamRun<T>

Type Parameters

T

The target POCO type to deserialize to.

WithStructuredOutput(StructuredOutputPolicy)

Configure structured output policy for this streaming run. If not called, the service-level StructuredOutputMaxRetries is used.

public StreamBuilder WithStructuredOutput(StructuredOutputPolicy policy)

Parameters

policy StructuredOutputPolicy

Returns

StreamBuilder