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

Function sync_client

examples/vertex.py:6–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6def sync_client() -> None:
7 print("------ Sync Vertex ------")
8
9 client = AnthropicVertex()
10
11 message = client.messages.create(
12 model="claude-sonnet-4@20250514",
13 max_tokens=100,
14 messages=[
15 {
16 "role": "user",
17 "content": "Hello!",
18 }
19 ],
20 )
21 print(message.to_json())
22
23
24async def async_client() -> None:

Callers 1

vertex.pyFile · 0.85

Calls 3

AnthropicVertexClass · 0.90
to_jsonMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected