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

Function create_message

tests/lib/test_refusal_fallback.py:82–98  ·  view source on GitHub ↗
(
    client: Anthropic,
    *,
    betas: List[AnthropicBetaParam] | Omit = omit,
    fallbacks: List[BetaFallbackParam] | Omit = omit,
    output_config: BetaOutputConfigParam | Omit = omit,
    speed: Literal["standard", "fast"] | Omit = omit,
)

Source from the content-addressed store, hash-verified

80
81
82def create_message(
83 client: Anthropic,
84 *,
85 betas: List[AnthropicBetaParam] | Omit = omit,
86 fallbacks: List[BetaFallbackParam] | Omit = omit,
87 output_config: BetaOutputConfigParam | Omit = omit,
88 speed: Literal["standard", "fast"] | Omit = omit,
89) -> BetaMessage:
90 return client.beta.messages.create(
91 model="primary-model",
92 max_tokens=1024,
93 messages=[{"role": "user", "content": "hi"}],
94 betas=betas,
95 fallbacks=fallbacks,
96 output_config=output_config,
97 speed=speed,
98 )
99
100
101async def create_message_async(

Calls 1

createMethod · 0.45

Tested by

no test coverage detected