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

# mirascope.core.azure.call_response

This module contains the `AzureCallResponse` class.

<Info title="Usage">

[Calls](/docs/v1/learn/calls#handling-responses)

</Info>

## <ApiType type="Class" path="core/azure/call_response" symbolName="AzureCallResponse" /> AzureCallResponse

A convenience wrapper around the Azure `ChatCompletion` response.

When calling the Azure API using a function decorated with `azure_call`, the
response will be an `AzureCallResponse` instance with properties that allow for
more convenience access to commonly used attributes.

Example:

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


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


response = recommend_book("fantasy")  # response is an `AzureCallResponse` instance
print(response.content)
```

**Bases:** 
<TypeLink type={{"type_str": "BaseCallResponse[ChatCompletions, AzureTool, ChatCompletionsToolDefinition, AsyncAzureDynamicConfig | AzureDynamicConfig, ChatRequestMessage, AzureCallParams, UserMessage, AzureMessageParamConverter]", "description": null, "kind": "generic", "base_type": {"type_str": "BaseCallResponse", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/base/call_response#basecallresponse"}, "parameters": [{"type_str": "ChatCompletions", "description": null, "kind": "simple", "doc_identifier": "ChatCompletions"}, {"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": "ChatRequestMessage", "description": null, "kind": "simple", "doc_identifier": "ChatRequestMessage"}, {"type_str": "AzureCallParams", "description": null, "kind": "simple", "doc_url": "/docs/v1/api/core/azure/call_params#azurecallparams"}, {"type_str": "UserMessage", "description": null, "kind": "simple", "doc_identifier": "UserMessage"}, {"type_str": "AzureMessageParamConverter", "description": null, "kind": "simple", "doc_identifier": "AzureMessageParamConverter"}]}} />

<AttributesTable
  attributes={[
  {
    "name": "response",
    "type_info": {
      "type_str": "SkipValidation[ChatCompletions]",
      "description": null,
      "kind": "generic",
      "base_type": {
        "type_str": "SkipValidation",
        "description": null,
        "kind": "simple",
        "doc_url": "https://docs.pydantic.dev/latest/api/functional_validators/#pydantic.functional_validators.SkipValidation"
      },
      "parameters": [
        {
          "type_str": "ChatCompletions",
          "description": null,
          "kind": "simple",
          "doc_identifier": "ChatCompletions"
        }
      ]
    }
  },
  {
    "name": "content",
    "type_info": {
      "type_str": "str",
      "description": null,
      "kind": "simple",
      "doc_url": "https://docs.python.org/3/library/stdtypes.html#str"
    },
    "description": "Returns the content of the chat completion for the 0th choice."
  },
  {
    "name": "finish_reasons",
    "type_info": {
      "type_str": "list[str]",
      "description": null,
      "kind": "generic",
      "base_type": {
        "type_str": "list",
        "description": null,
        "kind": "simple",
        "doc_url": "https://docs.python.org/3/library/stdtypes.html#list"
      },
      "parameters": [
        {
          "type_str": "str",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/stdtypes.html#str"
        }
      ]
    },
    "description": "Returns the finish reasons of the response."
  },
  {
    "name": "model",
    "type_info": {
      "type_str": "str",
      "description": null,
      "kind": "simple",
      "doc_url": "https://docs.python.org/3/library/stdtypes.html#str"
    },
    "description": "Returns the name of the response model."
  },
  {
    "name": "id",
    "type_info": {
      "type_str": "str",
      "description": null,
      "kind": "simple",
      "doc_url": "https://docs.python.org/3/library/stdtypes.html#str"
    },
    "description": "Returns the id of the response."
  },
  {
    "name": "usage",
    "type_info": {
      "type_str": "CompletionsUsage | None",
      "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": "CompletionsUsage",
          "description": null,
          "kind": "simple",
          "doc_identifier": "CompletionsUsage"
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Returns the usage of the chat completion."
  },
  {
    "name": "input_tokens",
    "type_info": {
      "type_str": "int | None",
      "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": "int",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/functions.html#int"
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Returns the number of input tokens."
  },
  {
    "name": "cached_tokens",
    "type_info": {
      "type_str": "int | None",
      "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": "int",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/functions.html#int"
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Returns the number of cached tokens."
  },
  {
    "name": "output_tokens",
    "type_info": {
      "type_str": "int | None",
      "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": "int",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/functions.html#int"
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Returns the number of output tokens."
  },
  {
    "name": "message_param",
    "type_info": {
      "type_str": "SerializeAsAny[AssistantMessage]",
      "description": null,
      "kind": "generic",
      "base_type": {
        "type_str": "SerializeAsAny",
        "description": null,
        "kind": "simple",
        "doc_identifier": "SerializeAsAny"
      },
      "parameters": [
        {
          "type_str": "AssistantMessage",
          "description": null,
          "kind": "simple",
          "doc_identifier": "AssistantMessage"
        }
      ]
    },
    "description": "Returns the assistants's response as a message parameter."
  },
  {
    "name": "tools",
    "type_info": {
      "type_str": "list[AzureTool] | None",
      "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": "list[AzureTool]",
          "description": null,
          "kind": "generic",
          "base_type": {
            "type_str": "list",
            "description": null,
            "kind": "simple",
            "doc_url": "https://docs.python.org/3/library/stdtypes.html#list"
          },
          "parameters": [
            {
              "type_str": "AzureTool",
              "description": null,
              "kind": "simple",
              "doc_url": "/docs/v1/api/core/azure/tool#azuretool"
            }
          ]
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Returns any available tool calls as their `AzureTool` definition."
  },
  {
    "name": "tool",
    "type_info": {
      "type_str": "AzureTool | None",
      "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": "AzureTool",
          "description": null,
          "kind": "simple",
          "doc_url": "/docs/v1/api/core/azure/tool#azuretool"
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Returns the 0th tool for the 0th choice message."
  },
  {
    "name": "common_finish_reasons",
    "type_info": {
      "type_str": "list[FinishReason] | None",
      "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": "list[FinishReason]",
          "description": null,
          "kind": "generic",
          "base_type": {
            "type_str": "list",
            "description": null,
            "kind": "simple",
            "doc_url": "https://docs.python.org/3/library/stdtypes.html#list"
          },
          "parameters": [
            {
              "type_str": "FinishReason",
              "description": null,
              "kind": "simple",
              "doc_url": "/docs/v1/api/core/openai/call_response_chunk#finishreason"
            }
          ]
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    },
    "description": "Provider-agnostic finish reasons."
  },
  {
    "name": "common_message_param",
    "type_info": {
      "type_str": "BaseMessageParam",
      "description": null,
      "kind": "simple",
      "doc_url": "/docs/v1/api/core/base/message_param#basemessageparam"
    }
  },
  {
    "name": "common_user_message_param",
    "type_info": {
      "type_str": "BaseMessageParam | None",
      "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": "BaseMessageParam",
          "description": null,
          "kind": "simple",
          "doc_url": "/docs/v1/api/core/base/message_param#basemessageparam"
        },
        {
          "type_str": "None",
          "description": null,
          "kind": "simple",
          "doc_url": "https://docs.python.org/3/library/constants.html#None"
        }
      ]
    }
  },
  {
    "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/call_response" symbolName="tool_message_params" /> tool_message_params

Returns the tool message parameters for tool call results.

<ParametersTable
  parameters={[
  {
    "name": "cls",
    "type_info": {
      "type_str": "Any",
      "description": null,
      "kind": "simple",
      "doc_identifier": null
    }
  },
  {
    "name": "tools_and_outputs",
    "type_info": {
      "type_str": "Sequence[tuple[AzureTool, str]]",
      "description": null,
      "kind": "generic",
      "base_type": {
        "type_str": "Sequence",
        "description": null,
        "kind": "simple",
        "doc_identifier": "Sequence"
      },
      "parameters": [
        {
          "type_str": "tuple[AzureTool, str]",
          "description": null,
          "kind": "generic",
          "base_type": {
            "type_str": "tuple",
            "description": null,
            "kind": "simple",
            "doc_url": "https://docs.python.org/3/library/stdtypes.html#tuple"
          },
          "parameters": [
            {
              "type_str": "AzureTool",
              "description": null,
              "kind": "simple",
              "doc_url": "/docs/v1/api/core/azure/tool#azuretool"
            },
            {
              "type_str": "str",
              "description": null,
              "kind": "simple",
              "doc_url": "https://docs.python.org/3/library/stdtypes.html#str"
            }
          ]
        }
      ]
    },
    "description": "The sequence of tools and their outputs from which the tool\nmessage parameters should be constructed."
  }
]}
/>

<ReturnTable
  returnType={{
  "type_info": {
    "type_str": "list[ToolMessage]",
    "description": null,
    "kind": "generic",
    "base_type": {
      "type_str": "list",
      "description": null,
      "kind": "simple",
      "doc_url": "https://docs.python.org/3/library/stdtypes.html#list"
    },
    "parameters": [
      {
        "type_str": "ToolMessage",
        "description": null,
        "kind": "simple",
        "doc_identifier": "ToolMessage"
      }
    ]
  },
  "description": "The list of constructed `ChatCompletionToolMessageParam` parameters."
}}
/>



