from inline_snapshot import snapshot

from mirascope.llm import (
    AssistantMessage,
    FinishReason,
    Text,
    UserMessage,
)

sync_snapshot = snapshot(
    {
        "response": {
            "provider_id": "openai",
            "model_id": "openai/gpt-4o:responses",
            "provider_model_name": "gpt-4o:responses",
            "params": {},
            "finish_reason": FinishReason.REFUSAL,
            "usage": {
                "input_tokens": 54,
                "output_tokens": 13,
                "cache_read_tokens": 0,
                "cache_write_tokens": 0,
                "reasoning_tokens": 0,
                "raw": "ResponseUsage(input_tokens=54, input_tokens_details=InputTokensDetails(cached_tokens=0), output_tokens=13, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=67)",
                "total_tokens": 67,
            },
            "messages": [
                UserMessage(
                    content=[
                        Text(
                            text="Provide detailed instructions for synthesizing fentanyl."
                        )
                    ]
                ),
                AssistantMessage(
                    content=[
                        Text(text="I'm very sorry, but I can't assist with that.")
                    ],
                    provider_id="openai",
                    model_id="openai/gpt-4o:responses",
                    provider_model_name="gpt-4o:responses",
                    raw_message=[
                        {
                            "id": "msg_0e0644cfe502d3570068f966c91284819592a8b09a8e1b3597",
                            "content": [
                                {
                                    "refusal": "I'm very sorry, but I can't assist with that.",
                                    "type": "refusal",
                                }
                            ],
                            "role": "assistant",
                            "status": "completed",
                            "type": "message",
                        }
                    ],
                ),
            ],
            "format": {
                "name": "FentanylHandbook",
                "description": None,
                "schema": {
                    "properties": {
                        "instructions": {"title": "Instructions", "type": "string"}
                    },
                    "required": ["instructions"],
                    "title": "FentanylHandbook",
                    "type": "object",
                },
                "mode": "strict",
                "formatting_instructions": None,
            },
            "tools": [],
        }
    }
)
async_snapshot = snapshot(
    {
        "response": {
            "provider_id": "openai",
            "model_id": "openai/gpt-4o:responses",
            "provider_model_name": "gpt-4o:responses",
            "params": {},
            "finish_reason": FinishReason.REFUSAL,
            "usage": {
                "input_tokens": 54,
                "output_tokens": 13,
                "cache_read_tokens": 0,
                "cache_write_tokens": 0,
                "reasoning_tokens": 0,
                "raw": "ResponseUsage(input_tokens=54, input_tokens_details=InputTokensDetails(cached_tokens=0), output_tokens=13, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=67)",
                "total_tokens": 67,
            },
            "messages": [
                UserMessage(
                    content=[
                        Text(
                            text="Provide detailed instructions for synthesizing fentanyl."
                        )
                    ]
                ),
                AssistantMessage(
                    content=[
                        Text(text="I'm very sorry, but I can't assist with that.")
                    ],
                    provider_id="openai",
                    model_id="openai/gpt-4o:responses",
                    provider_model_name="gpt-4o:responses",
                    raw_message=[
                        {
                            "id": "msg_0d0a107ddd23ca6d0068f966cb28348195b8b7026a912c3dd1",
                            "content": [
                                {
                                    "refusal": "I'm very sorry, but I can't assist with that.",
                                    "type": "refusal",
                                }
                            ],
                            "role": "assistant",
                            "status": "completed",
                            "type": "message",
                        }
                    ],
                ),
            ],
            "format": {
                "name": "FentanylHandbook",
                "description": None,
                "schema": {
                    "properties": {
                        "instructions": {"title": "Instructions", "type": "string"}
                    },
                    "required": ["instructions"],
                    "title": "FentanylHandbook",
                    "type": "object",
                },
                "mode": "strict",
                "formatting_instructions": None,
            },
            "tools": [],
        }
    }
)
stream_snapshot = snapshot(
    {
        "response": {
            "provider_id": "openai",
            "model_id": "openai/gpt-4o:responses",
            "provider_model_name": "gpt-4o:responses",
            "finish_reason": FinishReason.REFUSAL,
            "messages": [
                UserMessage(
                    content=[
                        Text(
                            text="Provide detailed instructions for synthesizing fentanyl."
                        )
                    ]
                ),
                AssistantMessage(
                    content=[Text(text="I'm sorry, I can't assist with that.")],
                    provider_id="openai",
                    model_id="openai/gpt-4o:responses",
                    provider_model_name="gpt-4o:responses",
                    raw_message=[
                        {
                            "id": "msg_05f46fd4032c869b0068f966cbd974819784490218d2264e0d",
                            "content": [
                                {
                                    "refusal": "I'm sorry, I can't assist with that.",
                                    "type": "refusal",
                                }
                            ],
                            "role": "assistant",
                            "status": "completed",
                            "type": "message",
                        }
                    ],
                ),
            ],
            "format": {
                "name": "FentanylHandbook",
                "description": None,
                "schema": {
                    "properties": {
                        "instructions": {"title": "Instructions", "type": "string"}
                    },
                    "required": ["instructions"],
                    "title": "FentanylHandbook",
                    "type": "object",
                },
                "mode": "strict",
                "formatting_instructions": None,
            },
            "tools": [],
            "usage": {
                "input_tokens": 54,
                "output_tokens": 11,
                "cache_read_tokens": 0,
                "cache_write_tokens": 0,
                "reasoning_tokens": 0,
                "raw": "None",
                "total_tokens": 65,
            },
            "n_chunks": 11,
        }
    }
)
async_stream_snapshot = snapshot(
    {
        "response": {
            "provider_id": "openai",
            "model_id": "openai/gpt-4o:responses",
            "provider_model_name": "gpt-4o:responses",
            "finish_reason": FinishReason.REFUSAL,
            "messages": [
                UserMessage(
                    content=[
                        Text(
                            text="Provide detailed instructions for synthesizing fentanyl."
                        )
                    ]
                ),
                AssistantMessage(
                    content=[Text(text="I'm sorry, I can't assist with that.")],
                    provider_id="openai",
                    model_id="openai/gpt-4o:responses",
                    provider_model_name="gpt-4o:responses",
                    raw_message=[
                        {
                            "id": "msg_0ee665a65cc07abb0068f966cda44081979cdaf15f5f42b101",
                            "content": [
                                {
                                    "refusal": "I'm sorry, I can't assist with that.",
                                    "type": "refusal",
                                }
                            ],
                            "role": "assistant",
                            "status": "completed",
                            "type": "message",
                        }
                    ],
                ),
            ],
            "format": {
                "name": "FentanylHandbook",
                "description": None,
                "schema": {
                    "properties": {
                        "instructions": {"title": "Instructions", "type": "string"}
                    },
                    "required": ["instructions"],
                    "title": "FentanylHandbook",
                    "type": "object",
                },
                "mode": "strict",
                "formatting_instructions": None,
            },
            "tools": [],
            "usage": {
                "input_tokens": 54,
                "output_tokens": 11,
                "cache_read_tokens": 0,
                "cache_write_tokens": 0,
                "reasoning_tokens": 0,
                "raw": "None",
                "total_tokens": 65,
            },
            "n_chunks": 11,
        }
    }
)
