Skip to content

Commit

Permalink
🔧 fix: Anthropic Agent Model Assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila committed Nov 17, 2024
1 parent b5232af commit 951bb9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/server/services/Endpoints/anthropic/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { getUserKey, checkUserKeyExpiry } = require('~/server/services/UserServic
const { getLLMConfig } = require('~/server/services/Endpoints/anthropic/llm');
const { AnthropicClient } = require('~/app');

const initializeClient = async ({ req, res, endpointOption, optionsOnly }) => {
const initializeClient = async ({ req, res, endpointOption, overrideModel, optionsOnly }) => {
const { ANTHROPIC_API_KEY, ANTHROPIC_REVERSE_PROXY, PROXY } = process.env;
const expiresAt = req.body.key;
const isUserProvided = ANTHROPIC_API_KEY === 'user_provided';
Expand Down Expand Up @@ -40,10 +40,13 @@ const initializeClient = async ({ req, res, endpointOption, optionsOnly }) => {
{
reverseProxyUrl: ANTHROPIC_REVERSE_PROXY ?? null,
proxy: PROXY ?? null,
modelOptions: endpointOption.modelOptions,
modelOptions: endpointOption.model_parameters,
},
clientOptions,
);
if (overrideModel) {
requestOptions.modelOptions.model = overrideModel;
}
return getLLMConfig(anthropicApiKey, requestOptions);
}

Expand Down

0 comments on commit 951bb9d

Please sign in to comment.