Skip to content

Commit 944a709

Browse files
authored
Merge pull request #67 from a-akimov/python-client-model-constant
Refactor the Python client to define the model only once
2 parents 63f93b6 + dc60b2a commit 944a709

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mcp-client-python/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
load_dotenv() # load environment variables from .env
1212

13+
# Claude model constant
14+
ANTHROPIC_MODEL = "claude-sonnet-4-5"
15+
1316
class MCPClient:
1417
def __init__(self):
1518
# Initialize session and client objects
@@ -64,7 +67,7 @@ async def process_query(self, query: str) -> str:
6467

6568
# Initial Claude API call
6669
response = self.anthropic.messages.create(
67-
model="claude-sonnet-4-5",
70+
model=ANTHROPIC_MODEL,
6871
max_tokens=1000,
6972
messages=messages,
7073
tools=available_tools
@@ -97,7 +100,7 @@ async def process_query(self, query: str) -> str:
97100

98101
# Get next response from Claude
99102
response = self.anthropic.messages.create(
100-
model="claude-sonnet-4-5",
103+
model=ANTHROPIC_MODEL,
101104
max_tokens=1000,
102105
messages=messages,
103106
)

0 commit comments

Comments
 (0)