Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

1002 B
Raw Blame
import { AuthKeys } from 'librechat-data-provider';
import { createAnthropicVertexClient } from './vertex';

describe('createAnthropicVertexClient', () => {
  const credentials = {
    [AuthKeys.GOOGLE_SERVICE_KEY]: {
      project_id: 'test-project',
      client_email: '[email protected]',
      private_key: 'test-private-key',
    },
  };

  it('should use Vertex AI multi-region base URLs for Anthropic', () => {
    const testCases = [
      { region: 'eu', baseURL: 'https://aiplatform.eu.rep.googleapis.com/v1' },
      { region: 'us', baseURL: 'https://aiplatform.us.rep.googleapis.com/v1' },
      { region: 'global', baseURL: 'https://aiplatform.googleapis.com/v1' },
    ];

    testCases.forEach(({ region, baseURL }) => {
      const client = createAnthropicVertexClient(credentials, undefined, {
        region,
        projectId: 'test-project',
      });

      expect(client.region).toBe(region);
      expect(client.baseURL).toBe(baseURL);
    });
  });
});