mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-19 15:14:21 +01:00
feat: add default value for openai host (#1336)
This commit is contained in:
@@ -3,7 +3,7 @@ import { Card } from '../ui/card';
|
|||||||
import { Lock } from 'lucide-react';
|
import { Lock } from 'lucide-react';
|
||||||
import { Input } from '../ui/input';
|
import { Input } from '../ui/input';
|
||||||
import { Button } from '../ui/button';
|
import { Button } from '../ui/button';
|
||||||
import { required_keys } from './models/hardcoded_stuff';
|
import { required_keys, default_key_value } from './models/hardcoded_stuff';
|
||||||
import { isSecretKey } from './api_keys/utils';
|
import { isSecretKey } from './api_keys/utils';
|
||||||
import { OllamaBattleGame } from './OllamaBattleGame';
|
import { OllamaBattleGame } from './OllamaBattleGame';
|
||||||
|
|
||||||
@@ -26,7 +26,9 @@ export function ProviderSetupModal({
|
|||||||
onCancel,
|
onCancel,
|
||||||
forceBattle = false,
|
forceBattle = false,
|
||||||
}: ProviderSetupModalProps) {
|
}: ProviderSetupModalProps) {
|
||||||
const [configValues, setConfigValues] = React.useState<{ [key: string]: string }>({});
|
const [configValues, setConfigValues] = React.useState<{ [key: string]: string }>(
|
||||||
|
default_key_value
|
||||||
|
);
|
||||||
const requiredKeys = required_keys[provider] || ['API Key'];
|
const requiredKeys = required_keys[provider] || ['API Key'];
|
||||||
const headerText = title || `Setup ${provider}`;
|
const headerText = title || `Setup ${provider}`;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export function isSecretKey(keyName: string): boolean {
|
|||||||
const nonSecretKeys = [
|
const nonSecretKeys = [
|
||||||
'DATABRICKS_HOST',
|
'DATABRICKS_HOST',
|
||||||
'OLLAMA_HOST',
|
'OLLAMA_HOST',
|
||||||
|
'OPENAI_HOST',
|
||||||
'AZURE_OPENAI_ENDPOINT',
|
'AZURE_OPENAI_ENDPOINT',
|
||||||
'AZURE_OPENAI_DEPLOYMENT_NAME',
|
'AZURE_OPENAI_DEPLOYMENT_NAME',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ export const required_keys = {
|
|||||||
'Azure OpenAI': ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT', 'AZURE_OPENAI_DEPLOYMENT_NAME'],
|
'Azure OpenAI': ['AZURE_OPENAI_API_KEY', 'AZURE_OPENAI_ENDPOINT', 'AZURE_OPENAI_DEPLOYMENT_NAME'],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const default_key_value = {
|
||||||
|
OPENAI_HOST: 'https://api.openai.com',
|
||||||
|
OLLAMA_HOST: 'localhost',
|
||||||
|
};
|
||||||
|
|
||||||
export const supported_providers = [
|
export const supported_providers = [
|
||||||
'OpenAI',
|
'OpenAI',
|
||||||
'Anthropic',
|
'Anthropic',
|
||||||
|
|||||||
Reference in New Issue
Block a user