Skip to content

Commit

Permalink
✨ feat: support DEFAULT_AGENT_CONFIG env
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 12, 2024
1 parent 57458d4 commit e512f81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/api/config/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { getServerConfig } from '@/config/server';
import { GlobalServerConfig } from '@/types/settings';

import { parseAgentConfig } from './parseDefaultAgent';

export const runtime = 'edge';

/**
Expand All @@ -14,10 +16,14 @@ export const GET = async () => {
ENABLED_AWS_BEDROCK,
ENABLED_GOOGLE,
ENABLE_OAUTH_SSO,
DEFAULT_AGENT_CONFIG,
} = getServerConfig();

const config: GlobalServerConfig = {
customModelName: CUSTOM_MODELS,
defaultAgent: {
config: parseAgentConfig(DEFAULT_AGENT_CONFIG),
},
enabledOAuthSSO: ENABLE_OAUTH_SSO,
languageModel: {
bedrock: { enabled: ENABLED_AWS_BEDROCK },
Expand Down
4 changes: 4 additions & 0 deletions src/config/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ declare global {

PLUGINS_INDEX_URL?: string;
PLUGIN_SETTINGS?: string;

DEFAULT_AGENT_CONFIG?: string;
}
}
}
Expand All @@ -32,6 +34,8 @@ export const getAppConfig = () => {
return {
ACCESS_CODES,

DEFAULT_AGENT_CONFIG: process.env.DEFAULT_AGENT_CONFIG || '',

SHOW_ACCESS_CODE_CONFIG: !!ACCESS_CODES.length,

METADATA_BASE_URL: process.env.METADATA_BASE_URL,
Expand Down

0 comments on commit e512f81

Please sign in to comment.