MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / message_body

Function message_body

tests/test_middleware.py:63–73  ·  view source on GitHub ↗
(*, model: str = "claude-opus-4-6")

Source from the content-addressed store, hash-verified

61
62
63def message_body(*, model: str = "claude-opus-4-6") -> dict[str, Any]:
64 return {
65 "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
66 "type": "message",
67 "role": "assistant",
68 "model": model,
69 "content": [{"type": "text", "text": "Hello!"}],
70 "stop_reason": "end_turn",
71 "stop_sequence": None,
72 "usage": {"input_tokens": 10, "output_tokens": 5},
73 }
74
75
76def error_body(*, type: str, message: str) -> dict[str, Any]:

Calls

no outgoing calls

Tested by

no test coverage detected