---
# AUTO-GENERATED API DOCUMENTATION - DO NOT EDIT
title: mirascope.core.azure.stream
description: API documentation for mirascope.core.azure.stream
---

# mirascope.core.azure.stream

The `AzureStream` class for convenience around streaming LLM calls.

<Info title="Usage">

[Streams](/docs/v1/learn/streams)

</Info>

## <ApiType type="Class" path="core/azure/stream" symbolName="AzureStream" /> AzureStream

A class for convenience around streaming Azure LLM calls.

Example:

```python
from mirascope.core import prompt_template
from mirascope.core.azure import azure_call


@azure_call("gpt-4o-mini", stream=True)
def recommend_book(genre: str) -> str:
    return f"Recommend a {genre} book"


stream = recommend_book("fantasy")  # returns `AzureStream` instance
for chunk, _ in stream:
    print(chunk.content, end="", flush=True)
```

**Bases:** 
<TypeLink type={{"type_str": "BaseStream[AzureCallResponse, AzureCallResponseChunk, UserMessage, AssistantMessage, ToolMessage, ChatRequestMessage, AzureTool, ChatCompletionsToolDefinition, AsyncAzureDynamicConfig | AzureDynamicConfig, AzureCallParams, CompletionsFinishReason]", "description": null, "kind": "generic", "base_type": {"type_str": "BaseStream", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/base/stream#basestream"}, "parameters": [{"type_str": "AzureCallResponse", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/call_response#azurecallresponse"}, {"type_str": "AzureCallResponseChunk", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/call_response_chunk#azurecallresponsechunk"}, {"type_str": "UserMessage", "description": null, "kind": "simple", "doc_identifier": "UserMessage"}, {"type_str": "AssistantMessage", "description": null, "kind": "simple", "doc_identifier": "AssistantMessage"}, {"type_str": "ToolMessage", "description": null, "kind": "simple", "doc_identifier": "ToolMessage"}, {"type_str": "ChatRequestMessage", "description": null, "kind": "simple", "doc_identifier": "ChatRequestMessage"}, {"type_str": "AzureTool", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/tool#azuretool"}, {"type_str": "ChatCompletionsToolDefinition", "description": null, "kind": "simple", "doc_identifier": "ChatCompletionsToolDefinition"}, {"type_str": "AsyncAzureDynamicConfig | AzureDynamicConfig", "description": null, "kind": "union", "base_type": {"type_str": "Union", "description": null, "kind": "simple", "doc_url": "https://docs.python.org/3/library/typing.html#typing.Union"}, "parameters": [{"type_str": "AsyncAzureDynamicConfig", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/dynamic_config#asyncazuredynamicconfig"}, {"type_str": "AzureDynamicConfig", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/dynamic_config#azuredynamicconfig"}]}, {"type_str": "AzureCallParams", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/call_params#azurecallparams"}, {"type_str": "CompletionsFinishReason", "description": null, "kind": "simple", "doc_identifier": "CompletionsFinishReason"}]}} />

<AttributesTable
  attributes={[
  {
    "name": "cost_metadata",
    "type_info": {
      "type_str": "CostMetadata",
      "description": null,
      "kind": "simple",
      "doc_url": "/docs/v1/api/core/base/types#costmetadata"
    },
    "description": "Get metadata required for cost calculation."
  }
]}
/>

## <ApiType type="Function" path="core/azure/stream" symbolName="construct_call_response" /> construct_call_response

Constructs the call response from a consumed AzureStream.

<ParametersTable
  parameters={[
  {
    "name": "self",
    "type_info": {
      "type_str": "Any",
      "description": null,
      "kind": "simple",
      "doc_identifier": null
    }
  }
]}
/>

<ReturnTable
  returnType={{
  "type_info": {
    "type_str": "AzureCallResponse",
    "description": null,
    "kind": "simple",
    "doc_url": "/docs/v1/api/core/azure/call_response#azurecallresponse"
  }
}}
/>



