Merge pull request #68 from a-akimov/node-client-model-constant
Refactor the Node client to define the model only once
This commit is contained in:
commit
b49339f092
1 changed files with 3 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ import dotenv from "dotenv";
|
||||||
|
|
||||||
dotenv.config(); // load environment variables from .env
|
dotenv.config(); // load environment variables from .env
|
||||||
|
|
||||||
|
const ANTHROPIC_MODEL = "claude-sonnet-4-5";
|
||||||
const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
|
const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
|
||||||
if (!ANTHROPIC_API_KEY) {
|
if (!ANTHROPIC_API_KEY) {
|
||||||
throw new Error("ANTHROPIC_API_KEY is not set");
|
throw new Error("ANTHROPIC_API_KEY is not set");
|
||||||
|
|
@ -92,7 +93,7 @@ class MCPClient {
|
||||||
|
|
||||||
// Initial Claude API call
|
// Initial Claude API call
|
||||||
const response = await this.anthropic.messages.create({
|
const response = await this.anthropic.messages.create({
|
||||||
model: "claude-sonnet-4-5",
|
model: ANTHROPIC_MODEL,
|
||||||
max_tokens: 1000,
|
max_tokens: 1000,
|
||||||
messages,
|
messages,
|
||||||
tools: this.tools,
|
tools: this.tools,
|
||||||
|
|
@ -125,7 +126,7 @@ class MCPClient {
|
||||||
|
|
||||||
// Get next response from Claude
|
// Get next response from Claude
|
||||||
const response = await this.anthropic.messages.create({
|
const response = await this.anthropic.messages.create({
|
||||||
model: "claude-sonnet-4-5",
|
model: ANTHROPIC_MODEL,
|
||||||
max_tokens: 1000,
|
max_tokens: 1000,
|
||||||
messages,
|
messages,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue