feat: add ANTHROPIC_HOST configuration for Anthropic in cli and UI (#1776)

This commit is contained in:
Denis Buzmakov
2025-04-02 22:36:47 +02:00
committed by GitHub
parent a923d24f27
commit fc230ded9b
6 changed files with 11 additions and 4 deletions
@@ -5,6 +5,7 @@ import { default_key_value, required_keys } from '../models/hardcoded_stuff'; //
export function isSecretKey(keyName: string): boolean {
// Endpoints and hosts should not be stored as secrets
const nonSecretKeys = [
'ANTHROPIC_HOST',
'DATABRICKS_HOST',
'OLLAMA_HOST',
'OPENAI_HOST',
@@ -58,7 +58,7 @@ export const short_list = ['gpt-4o', 'claude-3-5-sonnet-latest'];
export const required_keys = {
OpenAI: ['OPENAI_API_KEY', 'OPENAI_HOST', 'OPENAI_BASE_PATH'],
Anthropic: ['ANTHROPIC_API_KEY'],
Anthropic: ['ANTHROPIC_API_KEY', 'ANTHROPIC_HOST'],
Databricks: ['DATABRICKS_HOST'],
Groq: ['GROQ_API_KEY'],
Ollama: ['OLLAMA_HOST'],
@@ -75,6 +75,7 @@ export const required_keys = {
};
export const default_key_value = {
ANTHROPIC_HOST: 'https://api.anthropic.com',
OPENAI_HOST: 'https://api.openai.com',
OPENAI_BASE_PATH: 'v1/chat/completions',
OLLAMA_HOST: 'localhost',
@@ -91,6 +91,11 @@ export const PROVIDER_REGISTRY: ProviderRegistry[] = [
name: 'ANTHROPIC_API_KEY',
is_secret: true,
},
{
name: 'ANTHROPIC_HOST',
is_secret: false,
default: 'https://api.anthropic.com',
},
],
},
},