Skip to content

Commit

Permalink
feat: allow users to configure openai host (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
yingjiehe-xyz authored Feb 18, 2025
1 parent d8ca7a3 commit 92833ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/goose-server/src/routes/providers_and_keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "OpenAI",
"description": "Use GPT-4 and other OpenAI models",
"models": ["gpt-4o", "gpt-4-turbo","o1"],
"required_keys": ["OPENAI_API_KEY"]
"required_keys": ["OPENAI_API_KEY", "OPENAI_HOST"]
},
"anthropic": {
"name": "Anthropic",
Expand Down
4 changes: 2 additions & 2 deletions crates/goose/src/providers/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl Provider for OpenAiProvider {
ProviderMetadata::new(
"openai",
"OpenAI",
"GPT-4 and other OpenAI models",
"GPT-4 and other OpenAI models, including OpenAI compatible ones",
OPEN_AI_DEFAULT_MODEL,
OPEN_AI_KNOWN_MODELS
.iter()
Expand All @@ -107,7 +107,7 @@ impl Provider for OpenAiProvider {
OPEN_AI_DOC_URL,
vec![
ConfigKey::new("OPENAI_API_KEY", true, true, None),
ConfigKey::new("OPENAI_HOST", false, false, Some("https://api.openai.com")),
ConfigKey::new("OPENAI_HOST", true, false, Some("https://api.openai.com")),
ConfigKey::new("OPENAI_ORGANIZATION", false, false, None),
ConfigKey::new("OPENAI_PROJECT", false, false, None),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function getDefaultModel(key: string): string | undefined {
export const short_list = ['gpt-4o', 'claude-3-5-sonnet-latest'];

export const required_keys = {
OpenAI: ['OPENAI_API_KEY'],
OpenAI: ['OPENAI_API_KEY', 'OPENAI_HOST'],
Anthropic: ['ANTHROPIC_API_KEY'],
Databricks: ['DATABRICKS_HOST'],
Groq: ['GROQ_API_KEY'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getArticle(word: string): string {

export function getProviderDescription(provider) {
const descriptions = {
OpenAI: 'Access GPT-4, GPT-3.5 Turbo, and other OpenAI models',
OpenAI: 'Access GPT-4 and other OpenAI models, including OpenAI compatible ones',
Anthropic: 'Access Claude and other Anthropic models',
Google: 'Access Gemini and other Google AI models',
Groq: 'Access Mixtral and other Groq-hosted models',
Expand Down

0 comments on commit 92833ae

Please sign in to comment.