mirascope.core.xai.stream | Mirascope
MirascopeLilypad

mirascope.core.xai.stream

The XAIStream class for convenience around streaming xAI LLM calls.

Usage

Class XAIStream

A simple wrapper around OpenAIStream.

Everything is the same except updates to the construct_call_response method and the cost property so that cost is properly calculated using xAI's cost calculation method. This ensures cost calculation works for non-OpenAI models.

Bases:

OpenAIStream

Attributes

NameTypeDescription
costfloat | NoneReturns the cost of the call.

Function construct_call_response

Parameters

NameTypeDescription
selfAny-

Returns

TypeDescription
XAICallResponse-