mirascope.llm.stream | Mirascope
MirascopeLilypad

mirascope.llm.stream

This module contains the Stream class that inherits from BaseStream.

Class Stream

A non-pydantic class that inherits from BaseStream.

Bases:

BaseStream[BaseCallResponse, BaseCallResponseChunk, BaseMessageParam, BaseMessageParam, BaseMessageParam, BaseMessageParam, BaseTool, Any, BaseDynamicConfig, BaseCallParams, FinishReason]

Attributes

NameTypeDescription
costfloat | None-

Function construct_call_response

Parameters

NameTypeDescription
selfAny-

Returns

TypeDescription
CallResponse-

Function tool_message_params

Returns the tool message parameters for tool call results.

Parameters

NameTypeDescription
clsAny-
tools_and_outputslist[tuple[Tool, JsonableType]]The list of tools and their outputs from which the tool message parameters should be constructed.

Returns

TypeDescription
list[BaseMessageParam]-