from inline_snapshot import snapshot

from mirascope.llm import (
    AssistantMessage,
    Text,
    ToolCall,
    ToolOutput,
    UserMessage,
)

test_snapshot = snapshot(
    {
        "response": {
            "provider_id": "google",
            "model_id": "google/gemini-3-pro-preview",
            "provider_model_name": "gemini-3-pro-preview",
            "finish_reason": None,
            "messages": [
                UserMessage(
                    content=[
                        Text(
                            text="Answer this question: What is 2 + 3, using the custom addition tool?"
                        )
                    ]
                ),
                AssistantMessage(
                    content=[
                        ToolCall(
                            id="google_unknown_tool_id",
                            name="customAdditionImplementation",
                            args='{"a": 2, "b": 3}',
                        )
                    ],
                    provider_id="google",
                    model_id="google/gemini-3-pro-preview",
                    provider_model_name="gemini-3-pro-preview",
                    raw_message={
                        "parts": [
                            {
                                "media_resolution": None,
                                "code_execution_result": None,
                                "executable_code": None,
                                "file_data": None,
                                "function_call": {
                                    "id": None,
                                    "args": {"a": 2, "b": 3},
                                    "name": "customAdditionImplementation",
                                    "partial_args": None,
                                    "will_continue": None,
                                },
                                "function_response": None,
                                "inline_data": None,
                                "text": None,
                                "thought": None,
                                "thought_signature": b"\x12\xde\x05\n\xdb\x05\x01r\xc8\xda|\x03\xd3T\xb2>\x03i\xc2\xbd\xb2\x14%O\xc3!]\xa9\xc8\xd0\xaec0\xa4\xd5j\xee7t\xbb\xa2\xca\xe9p\xa5Q\x81\x8cC\x12\xcd\xab\xbb,\x11\x8es%\x10\r\xe4Mq\x1a\x00\xd0\xd6\x8fQ!c\xac\x99\x0b\xab\xd0r\xa6\x00\x91\x8f\xab\xe3q&\x8fd\xae\xe0\xc2B/)/\xaf6;\xd8fZ\xc2\x95\x03\x0c\xd6\x06\xba\xbc\x83\xe6h\xfccN\x96w\x9e\xc1\xe3\xa5\xf2\xe6\xe3\x8f\xc3\xc8J9\x7f,\x16\xcd*\xc6c\xa2\xe1u\x80t\xbf\xcbX\x127 \xf2JW6\xef\x7f.\xb5~\xf7F\xaf\xdd\xbd\xc2?\x85\xf3s\x96\x04\xcc\xa1\xae\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8f\x16L\xc0|\x0b\xa4a\x87\xf5Y\x9b\x8b\xc9\x8e\xc0\x10\xaak\x10)f\xbe\x87\xa15\xa2b\xe6B\x18\xd2M,P\x9bi\x10\x8a\xee\x1f@[\xb6H\x9fP\xb0\xcf\x87}\x0f:7c-q#\xbb6\xa3\xf0\x07\xfa\xdc3\xad(\xed\x92\xa5\x90\xde\xf2Kv\xcb\x13G\xf8\x91\x98\xee9\xee\xf2\xf6\x8d\xffr\x16\x9f]\xf7vP\xdb\x9f\xb3\x9e\x1e\xe4O=>\xc9\x90\x14\x1d\xe7\x0f\xba\xf5\xe0\xa830#`7\x91\xd7]r\x8e\xee~&H\xd0\xe4\x13'\x96\x1aA\x8a\xdc\xa0\xcdQ\xf2|kv\xf3\xb7b\xb5\x02\xe5\x13\x14\xb0zre\xc38\xc4\xe0\xa1:o\xceAP}\x9f\xb0\xf5\x9cz!~|a\xb0\xb6#l\xf5\xe6D\x1c,",
                                "video_metadata": None,
                            },
                            {
                                "media_resolution": None,
                                "code_execution_result": None,
                                "executable_code": None,
                                "file_data": None,
                                "function_call": None,
                                "function_response": None,
                                "inline_data": None,
                                "text": "",
                                "thought": None,
                                "thought_signature": None,
                                "video_metadata": None,
                            },
                        ],
                        "role": "model",
                    },
                ),
                UserMessage(
                    content=[
                        ToolOutput(
                            id="google_unknown_tool_id",
                            name="customAdditionImplementation",
                            result=13,
                        )
                    ]
                ),
                AssistantMessage(
                    content=[
                        Text(
                            text="""\
{
  "integer_a": 2,
  "integer_b": 3,
  "answer": 13
} \
"""
                        )
                    ],
                    provider_id="google",
                    model_id="google/gemini-3-pro-preview",
                    provider_model_name="gemini-3-pro-preview",
                    raw_message={
                        "parts": [
                            {
                                "media_resolution": None,
                                "code_execution_result": None,
                                "executable_code": None,
                                "file_data": None,
                                "function_call": None,
                                "function_response": None,
                                "inline_data": None,
                                "text": "{",
                                "thought": None,
                                "thought_signature": None,
                                "video_metadata": None,
                            },
                            {
                                "media_resolution": None,
                                "code_execution_result": None,
                                "executable_code": None,
                                "file_data": None,
                                "function_call": None,
                                "function_response": None,
                                "inline_data": None,
                                "text": """\

  "integer_a": 2,
  "integer_b\
""",
                                "thought": None,
                                "thought_signature": None,
                                "video_metadata": None,
                            },
                            {
                                "media_resolution": None,
                                "code_execution_result": None,
                                "executable_code": None,
                                "file_data": None,
                                "function_call": None,
                                "function_response": None,
                                "inline_data": None,
                                "text": """\
": 3,
  "answer": 13
} \
""",
                                "thought": None,
                                "thought_signature": None,
                                "video_metadata": None,
                            },
                            {
                                "media_resolution": None,
                                "code_execution_result": None,
                                "executable_code": None,
                                "file_data": None,
                                "function_call": None,
                                "function_response": None,
                                "inline_data": None,
                                "text": "",
                                "thought": None,
                                "thought_signature": None,
                                "video_metadata": None,
                            },
                        ],
                        "role": "model",
                    },
                ),
            ],
            "format": {
                "name": "IntegerAdditionResponse",
                "description": "A simple response for testing.",
                "schema": {
                    "description": "A simple response for testing.",
                    "properties": {
                        "integer_a": {"title": "Integer A", "type": "integer"},
                        "integer_b": {"title": "Integer B", "type": "integer"},
                        "answer": {"title": "Answer", "type": "integer"},
                    },
                    "required": ["integer_a", "integer_b", "answer"],
                    "title": "IntegerAdditionResponse",
                    "type": "object",
                },
                "mode": "strict",
                "formatting_instructions": None,
            },
            "tools": [
                {
                    "name": "customAdditionImplementation",
                    "description": "Perform computation on integers.",
                    "parameters": """\
{
  "properties": {
    "a": {
      "title": "A",
      "type": "integer"
    },
    "b": {
      "title": "B",
      "type": "integer"
    }
  },
  "required": [
    "a",
    "b"
  ],
  "additionalProperties": false,
  "defs": null
}\
""",
                    "strict": None,
                }
            ],
            "usage": {
                "input_tokens": 271,
                "output_tokens": 32,
                "cache_read_tokens": 0,
                "cache_write_tokens": 0,
                "reasoning_tokens": 0,
                "provider_tool_usage": None,
                "raw": "None",
                "total_tokens": 303,
            },
            "n_chunks": 5,
        }
    }
)
