diff --git a/.env.development b/.env.development index 9c4c2960ab..408824a801 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ -# OpenAI keys -OPENAI_API_HOST="" -OPENAI_API_KEY="" -OPENAI_API_VERSION="2023-03-15-preview" +# Dial environment variables +DIAL_API_HOST="" +DIAL_API_KEY="" +DIAL_API_VERSION="2023-03-15-preview" # App Settings APP_BASE_PATH="" @@ -86,10 +86,10 @@ THEMES_CONFIG_HOST="" FOOTER_HTML_MESSAGE="For API access please fill this form. If you have a problem please report an issue. Version %%VERSION%%" AZURE_FUNCTIONS_API_HOST="" -## Report issue modal +## Report issue modal code REPORT_ISSUE_CODE="" -## Request API Key code +## Request API Key modal code REQUEST_API_KEY_CODE="" ## Warning regarding code generation diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json index ad060a0e16..1903287690 100644 --- a/.github/pr-title-checker-config.json +++ b/.github/pr-title-checker-config.json @@ -4,7 +4,7 @@ "color": "EEEEEE" }, "CHECKS": { - "prefixes": ["fix: ", "feat: ", "feature: ", "chore: ", "hotfix: ", "e2e: "] + "prefixes": ["fix: ", "feat: ", "feature: ", "chore: ", "hotfix: ", "e2e: ", "fix!: ", "feat!: ", "feature!: ", "chore!: ", "hotfix!: "] }, "MESSAGES": { "success": "All OK", diff --git a/README.md b/README.md index 49aae815b0..189e377eae 100644 --- a/README.md +++ b/README.md @@ -110,75 +110,75 @@ This project leverages environment variables for configuration. **Note: for development we have some predefined variables located in `.env.development`** -| Variable | Required | Description | Available Values | Default values | -| ----------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---------------- | -| `OPENAI_API_HOST` | Yes | OpenAI API Host | Any string | | -| `OPENAI_API_KEY` | Yes | OpenAI API Key | Any string | | -| `OPENAI_API_VERSION` | Yes | OpenAI API Version | Any string | | -| `APP_BASE_PATH` | No | Application base path | Any string | | -| `APP_BASE_ORIGIN` | Yes (if `APP_BASE_PATH` is set) | Application base origin | Any string | | -| `ALLOWED_IFRAME_ORIGINS` | No | Allowed iFrame Origins | Any origin valid format. See | none | -| `IS_IFRAME` | No | Is iFrame | `true`, `false` | false | -| `ENABLED_FEATURES` | No | Enabled Features | See available features [here](src/types/features.ts) | | -| `NEXT_PUBLIC_APP_NAME` | No | Public Application Name | Any string | AI Dial | -| `NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT` | No | Public Default System Prompt | Any string | | -| `NEXT_PUBLIC_DEFAULT_TEMPERATURE` | No | Public Default Temperature | 0 to 1 | | -| `DEFAULT_MODEL` | No | Default Model | Any string | gpt-35-turbo | -| `DEFAULT_ASSISTANT_SUB_MODEL` | No | Default Assistant Sub Model | Any string | gpt-4 | -| `RECENT_MODELS_IDS` | No | A list of IDs for recently used AI models. | Any string | | -| `RECENT_ADDONS_IDS` | No | A list of IDs for recently used AI model addons. | Any string | | -| `E2E_HOST` | No | The host URL for end-to-end testing. More info in [E2E tests documentation](e2e/README.md) | Any string | | -| `E2E_USERNAME` | No | A username for e2e authentification | Any string | | -| `E2E_PASSWORD` | No | A password for e2e authentification | Any string | | -| `TRACES_URL` | No | Traces URL | Any string | | -| `TMS_URL` | No | TMS URL | Any string | | -| `ISSUE_URL` | No | Issue URL | Any string | | -| `THEMES_CONFIG_HOST` | No | The host URL for custom themes configuration. More info in [Themes configuration documentation](docs/THEME-CUSTOMIZATION.md) | Any string | | -| `FOOTER_HTML_MESSAGE` | No | Footer HTML Message | Any string | | -| `ANNOUNCEMENT_HTML_MESSAGE` | No | Announcement banner HTML Message | Any string | | -| `AZURE_FUNCTIONS_API_HOST` | No | Azure Functions API Host | Any string | | -| `REPORT_ISSUE_CODE` | No | Report Issue Code used when sending report issue info to Azure Functions API Host | Any string | | -| `REQUEST_API_KEY_CODE` | No | Request API Key Code used when sending request api key info to Azure Functions API Host | Any string | | -| `CODE_GENERATION_WARNING` | No | Warning text regarding code generation | Any string | | -| `SHOW_TOKEN_SUB` | No | Show token sub in refresh login error logs | `true`, `false` | false | -| `STORAGE_TYPE` | No | Type of storage used for getting and saving information generated by user | `browserStorage`, `api`,`apiMock` | `browserStorage` | +| Variable | Required | Description | Available Values | Default values | +| ----------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ------------------ | +| `DIAL_API_HOST` | Yes | Dial API Host | Any string | | +| `DIAL_API_KEY` | Yes | Dial API Key | Any string | | +| `DIAL_API_VERSION` | No | Dial API Version | Any string | 2023-03-15-preview | +| `APP_BASE_PATH` | No | Application base path | Any string | | +| `APP_BASE_ORIGIN` | Yes (if `APP_BASE_PATH` is set) | Application base origin | Any string | | +| `ALLOWED_IFRAME_ORIGINS` | No | Allowed iFrame Origins | Any origin valid format. See | none | +| `IS_IFRAME` | No | Is iFrame | `true`, `false` | false | +| `ENABLED_FEATURES` | No | Enabled Features | See available features [here](src/types/features.ts) | | +| `NEXT_PUBLIC_APP_NAME` | No | Public Application Name | Any string | AI Dial | +| `NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT` | No | Public Default System Prompt | Any string | | +| `NEXT_PUBLIC_DEFAULT_TEMPERATURE` | No | Public Default Temperature | 0 to 1 | | +| `DEFAULT_MODEL` | No | Default Model | Any string | gpt-35-turbo | +| `DEFAULT_ASSISTANT_SUB_MODEL` | No | Default Assistant Sub Model | Any string | gpt-4 | +| `RECENT_MODELS_IDS` | No | A list of IDs for recently used AI models. | Any string | | +| `RECENT_ADDONS_IDS` | No | A list of IDs for recently used AI model addons. | Any string | | +| `E2E_HOST` | No | The host URL for end-to-end testing. More info in [E2E tests documentation](e2e/README.md) | Any string | | +| `E2E_USERNAME` | No | A username for e2e authentification | Any string | | +| `E2E_PASSWORD` | No | A password for e2e authentification | Any string | | +| `TRACES_URL` | No | Traces URL | Any string | | +| `TMS_URL` | No | TMS URL | Any string | | +| `ISSUE_URL` | No | Issue URL | Any string | | +| `THEMES_CONFIG_HOST` | No | The host URL for custom themes configuration. More info in [Themes configuration documentation](docs/THEME-CUSTOMIZATION.md) | Any string | | +| `FOOTER_HTML_MESSAGE` | No | Footer HTML Message | Any string | | +| `ANNOUNCEMENT_HTML_MESSAGE` | No | Announcement banner HTML Message | Any string | | +| `AZURE_FUNCTIONS_API_HOST` | No | Azure Functions API Host | Any string | | +| `REPORT_ISSUE_CODE` | No | Report Issue Code used when sending report issue info to Azure Functions API Host | Any string | | +| `REQUEST_API_KEY_CODE` | No | Request API Key Code used when sending request api key info to Azure Functions API Host | Any string | | +| `CODE_GENERATION_WARNING` | No | Warning text regarding code generation | Any string | | +| `SHOW_TOKEN_SUB` | No | Show token sub in refresh login error logs | `true`, `false` | false | +| `STORAGE_TYPE` | No | Type of storage used for getting and saving information generated by user | `browserStorage`, `api`,`apiMock` | `browserStorage` | The .env file contains environment variables that can be used to configure your app's settings and behavior. These values can be changed as needed to suit your specific requirements. Also we have a lot of auth specific env variables: -| Variable | Required | Description | Available Values | Default values | -| ------------------------- | -------------------- | ------------------------------------------------------------------- | ---------------- | -------------- | -| `AUTH_DISABLED` | No | A flag to enable or disable authentication. | `true`, `false` | false | -| `NEXTAUTH_URL` | Yes (for production) | NextAuth URL | Any string | | -| `NEXTAUTH_SECRET` | Yes | NextAuth Secret (generate by `openssl rand -base64 32` for example) | Any string | | -| `AUTH_AUTH0_AUDIENCE` | No | Auth0 Audience | Any string | | -| `AUTH_AUTH0_CLIENT_ID` | No | Auth0 Client ID | Any string | | -| `AUTH_AUTH0_HOST` | No | Auth0 Host | Any string | | -| `AUTH_AUTH0_NAME` | No | Auth0 Name | Any string | | -| `AUTH_AUTH0_SECRET` | No | Auth0 Secret | Any string | | -| `AUTH_AUTH0_SCOPE` | No | Auth0 Scope | Any string | `openid email profile offline_access` | -| `AUTH_AZURE_AD_CLIENT_ID` | No | Azure AD Client ID | Any string | | -| `AUTH_AZURE_AD_NAME` | No | Azure AD Name | Any string | | -| `AUTH_AZURE_AD_SECRET` | No | Azure AD Secret | Any string | | -| `AUTH_AZURE_AD_TENANT_ID` | No | Azure AD Tenant ID | Any string | | +| Variable | Required | Description | Available Values | Default values | +| ------------------------- | -------------------- | ------------------------------------------------------------------- | ---------------- | ----------------------------------------------- | +| `AUTH_DISABLED` | No | A flag to enable or disable authentication. | `true`, `false` | false | +| `NEXTAUTH_URL` | Yes (for production) | NextAuth URL | Any string | | +| `NEXTAUTH_SECRET` | Yes | NextAuth Secret (generate by `openssl rand -base64 32` for example) | Any string | | +| `AUTH_AUTH0_AUDIENCE` | No | Auth0 Audience | Any string | | +| `AUTH_AUTH0_CLIENT_ID` | No | Auth0 Client ID | Any string | | +| `AUTH_AUTH0_HOST` | No | Auth0 Host | Any string | | +| `AUTH_AUTH0_NAME` | No | Auth0 Name | Any string | | +| `AUTH_AUTH0_SECRET` | No | Auth0 Secret | Any string | | +| `AUTH_AUTH0_SCOPE` | No | Auth0 Scope | Any string | `openid email profile offline_access` | +| `AUTH_AZURE_AD_CLIENT_ID` | No | Azure AD Client ID | Any string | | +| `AUTH_AZURE_AD_NAME` | No | Azure AD Name | Any string | | +| `AUTH_AZURE_AD_SECRET` | No | Azure AD Secret | Any string | | +| `AUTH_AZURE_AD_TENANT_ID` | No | Azure AD Tenant ID | Any string | | | `AUTH_AZURE_AD_SCOPE` | No | Azure AD Scope | Any string | `openid profile user.Read email offline_access` | -| `AUTH_GITLAB_CLIENT_ID` | No | GitLab Client ID | Any string | | -| `AUTH_GITLAB_HOST` | No | GitLab Host | Any string | | -| `AUTH_GITLAB_NAME` | No | GitLab Name | Any string | | -| `AUTH_GITLAB_SECRET` | No | GitLab Secret | Any string | | -| `AUTH_GITLAB_SCOPE` | No | GitLab Scope | Any string | `read_user` | -| `AUTH_GOOGLE_CLIENT_ID` | No | Google Client ID | Any string | | -| `AUTH_GOOGLE_NAME` | No | Google Name | Any string | | -| `AUTH_GOOGLE_SECRET` | No | Google Secret | Any string | | -| `AUTH_GOOGLE_SCOPE` | No | Google Scope | Any string | `openid email profile offline_access` | -| `AUTH_KEYCLOAK_CLIENT_ID` | No | Keycloak Client ID | Any string | | -| `AUTH_KEYCLOAK_HOST` | No | Keycloak Host | Any string | | -| `AUTH_KEYCLOAK_NAME` | No | Keycloak Name | Any string | | -| `AUTH_KEYCLOAK_SECRET` | No | Keycloak Secret | Any string | | -| `AUTH_KEYCLOAK_SCOPE` | No | Keycloak Scope | Any string | `openid email profile offline_access` | -| `AUTH_PING_ID_CLIENT_ID` | No | PingID Client ID | Any string | | -| `AUTH_PING_ID_HOST` | No | PingID Host | Any string | | -| `AUTH_PING_ID_NAME` | No | PingID Name | Any string | | -| `AUTH_PING_ID_SECRET` | No | PingID Secret | Any string | | -| `AUTH_PING_ID_SCOPE` | No | PingID Scope | Any string | `offline_access` | +| `AUTH_GITLAB_CLIENT_ID` | No | GitLab Client ID | Any string | | +| `AUTH_GITLAB_HOST` | No | GitLab Host | Any string | | +| `AUTH_GITLAB_NAME` | No | GitLab Name | Any string | | +| `AUTH_GITLAB_SECRET` | No | GitLab Secret | Any string | | +| `AUTH_GITLAB_SCOPE` | No | GitLab Scope | Any string | `read_user` | +| `AUTH_GOOGLE_CLIENT_ID` | No | Google Client ID | Any string | | +| `AUTH_GOOGLE_NAME` | No | Google Name | Any string | | +| `AUTH_GOOGLE_SECRET` | No | Google Secret | Any string | | +| `AUTH_GOOGLE_SCOPE` | No | Google Scope | Any string | `openid email profile offline_access` | +| `AUTH_KEYCLOAK_CLIENT_ID` | No | Keycloak Client ID | Any string | | +| `AUTH_KEYCLOAK_HOST` | No | Keycloak Host | Any string | | +| `AUTH_KEYCLOAK_NAME` | No | Keycloak Name | Any string | | +| `AUTH_KEYCLOAK_SECRET` | No | Keycloak Secret | Any string | | +| `AUTH_KEYCLOAK_SCOPE` | No | Keycloak Scope | Any string | `openid email profile offline_access` | +| `AUTH_PING_ID_CLIENT_ID` | No | PingID Client ID | Any string | | +| `AUTH_PING_ID_HOST` | No | PingID Host | Any string | | +| `AUTH_PING_ID_NAME` | No | PingID Name | Any string | | +| `AUTH_PING_ID_SECRET` | No | PingID Secret | Any string | | +| `AUTH_PING_ID_SCOPE` | No | PingID Scope | Any string | `offline_access` | diff --git a/environment.d.ts b/environment.d.ts index 69b688c6ed..c372dcd155 100644 --- a/environment.d.ts +++ b/environment.d.ts @@ -3,11 +3,73 @@ export {}; declare global { namespace NodeJS { interface ProcessEnv { - OPENAI_API_KEY: string; - OPENAI_API_HOST: string; - OPENAI_API_VERSION?: string; + DIAL_API_KEY: string; + DIAL_API_HOST: string; + DIAL_API_VERSION?: string; + APP_BASE_PATH?: string; + APP_BASE_ORIGIN?: string; + ALLOWED_IFRAME_ORIGINS?: string; + IS_IFRAME?: string; + ENABLED_FEATURES?: string; + NEXT_PUBLIC_APP_NAME?: string; + NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT?: string; + NEXT_PUBLIC_DEFAULT_TEMPERATURE?: string; + DEFAULT_MODEL?: string; + DEFAULT_ASSISTANT_SUB_MODEL?: string; + RECENT_MODELS_IDS?: string; + RECENT_ADDONS_IDS?: string; + E2E_HOST?: string; + E2E_USERNAME?: string; + E2E_PASSWORD?: string; TRACES_URL?: string; + TMS_URL?: string; + ISSUE_URL?: string; + THEMES_CONFIG_HOST?: string; + FOOTER_HTML_MESSAGE?: string; + ANNOUNCEMENT_HTML_MESSAGE?: string; + AZURE_FUNCTIONS_API_HOST?: string; + REPORT_ISSUE_CODE?: string; + REQUEST_API_KEY_CODE?: string; + CODE_GENERATION_WARNING?: string; + SHOW_TOKEN_SUB?: string; + STORAGE_TYPE?: string; + TRACES_URL?: string; + + AUTH_DISABLED?: string; + NEXTAUTH_URL?: string; + NEXTAUTH_SECRET?: string; + AUTH_TEST_TOKEN?: string; + AUTH_AUTH0_AUDIENCE?: string; + AUTH_AUTH0_CLIENT_ID?: string; + AUTH_AUTH0_HOST?: string; + AUTH_AUTH0_NAME?: string; + AUTH_AUTH0_SECRET?: string; + AUTH_AUTH0_SCOPE?: string; + AUTH_AZURE_AD_CLIENT_ID?: string; + AUTH_AZURE_AD_NAME?: string; + AUTH_AZURE_AD_SECRET?: string; + AUTH_AZURE_AD_TENANT_ID?: string; + AUTH_AZURE_AD_SCOPE?: string; + AUTH_GITLAB_CLIENT_ID?: string; + AUTH_GITLAB_HOST?: string; + AUTH_GITLAB_NAME?: string; + AUTH_GITLAB_SECRET?: string; + AUTH_GITLAB_SCOPE?: string; + AUTH_GOOGLE_CLIENT_ID?: string; + AUTH_GOOGLE_NAME?: string; + AUTH_GOOGLE_SECRET?: string; + AUTH_GOOGLE_SCOPE?: string; + AUTH_KEYCLOAK_CLIENT_ID?: string; + AUTH_KEYCLOAK_HOST?: string; + AUTH_KEYCLOAK_NAME?: string; + AUTH_KEYCLOAK_SECRET?: string; + AUTH_KEYCLOAK_SCOPE?: string; + AUTH_PING_ID_CLIENT_ID?: string; + AUTH_PING_ID_HOST?: string; + AUTH_PING_ID_NAME?: string; + AUTH_PING_ID_SECRET?: string; + AUTH_PING_ID_SCOPE?: string; } } } diff --git a/src/constants/default-settings.ts b/src/constants/default-settings.ts index 0a4e23f145..b90934fb51 100644 --- a/src/constants/default-settings.ts +++ b/src/constants/default-settings.ts @@ -3,8 +3,7 @@ import { OpenAIEntityModelID, OpenAIEntityModels } from '@/src/types/openai'; export const DEFAULT_SYSTEM_PROMPT = process.env.NEXT_PUBLIC_DEFAULT_SYSTEM_PROMPT ?? ''; -export const OPENAI_API_HOST = - process.env.OPENAI_API_HOST || 'https://api.openai.com'; +export const DIAL_API_HOST = process.env.DIAL_API_HOST; export const DEFAULT_TEMPERATURE = parseFloat( process.env.NEXT_PUBLIC_DEFAULT_TEMPERATURE || '1', @@ -12,8 +11,8 @@ export const DEFAULT_TEMPERATURE = parseFloat( export const DEFAULT_CONVERSATION_NAME = 'New conversation'; -export const OPENAI_API_VERSION = - process.env.OPENAI_API_VERSION || '2023-03-15-preview'; +export const DIAL_API_VERSION = + process.env.DIAL_API_VERSION || '2023-03-15-preview'; export const DEFAULT_ASSISTANT_SUBMODEL = OpenAIEntityModels[OpenAIEntityModelID.GPT_4]; diff --git a/src/pages/api/files/file/[...slug].ts b/src/pages/api/files/file/[...slug].ts index 49b9291889..5b60ce7613 100644 --- a/src/pages/api/files/file/[...slug].ts +++ b/src/pages/api/files/file/[...slug].ts @@ -64,7 +64,7 @@ async function handlePutRequest( if (!slugs || slugs.length === 0) { throw new OpenAIError('No file path provided', '', '', '400'); } - const url = `${process.env.OPENAI_API_HOST}/v1/files/${encodeURI( + const url = `${process.env.DIAL_API_HOST}/v1/files/${encodeURI( slugs.join('/'), )}`; const proxyRes = await fetch(url, { @@ -101,7 +101,7 @@ async function handleGetRequest( if (!slugs || slugs.length === 0) { throw new OpenAIError('No file path provided', '', '', '400'); } - const url = `${process.env.OPENAI_API_HOST}/v1/files/${encodeURI( + const url = `${process.env.DIAL_API_HOST}/v1/files/${encodeURI( slugs.join('/'), )}`; const proxyRes = await fetch(url, { @@ -134,7 +134,7 @@ async function handleDeleteRequest( if (!slugs || slugs.length === 0) { throw new OpenAIError('No file path provided', '', '', '400'); } - const url = `${process.env.OPENAI_API_HOST}/v1/files/${encodeURI( + const url = `${process.env.DIAL_API_HOST}/v1/files/${encodeURI( slugs.join('/'), )}`; diff --git a/src/pages/api/files/listing.ts b/src/pages/api/files/listing.ts index 38934e6021..1c3db67910 100644 --- a/src/pages/api/files/listing.ts +++ b/src/pages/api/files/listing.ts @@ -35,7 +35,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const token = await getToken({ req }); - const url = `${process.env.OPENAI_API_HOST}/v1/files/metadata/${bucket}${ + const url = `${process.env.DIAL_API_HOST}/v1/files/metadata/${bucket}${ path && `/${encodeURI(path)}` }/`; diff --git a/src/pages/api/rate.ts b/src/pages/api/rate.ts index 217d8685c5..8cead408ec 100644 --- a/src/pages/api/rate.ts +++ b/src/pages/api/rate.ts @@ -8,7 +8,7 @@ import { logger } from '@/src/utils/server/logger'; import { RateBody } from '../../types/chat'; -import { OPENAI_API_HOST } from '@/src/constants/default-settings'; +import { DIAL_API_HOST } from '@/src/constants/default-settings'; import { errorsMessages } from '@/src/constants/errors'; import { authOptions } from './auth/[...nextauth]'; @@ -30,7 +30,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { return res.status(400).send(errorsMessages[400]); } - const url = `${OPENAI_API_HOST}/v1/${modelId}/rate`; + const url = `${DIAL_API_HOST}/v1/${modelId}/rate`; const token = await getToken({ req }); await fetch(url, { diff --git a/src/utils/server/get-entities.ts b/src/utils/server/get-entities.ts index 062df1b81b..33494fd966 100644 --- a/src/utils/server/get-entities.ts +++ b/src/utils/server/get-entities.ts @@ -1,8 +1,8 @@ import { EntityType } from '@/src/types/common'; import { - OPENAI_API_HOST, - OPENAI_API_VERSION, + DIAL_API_HOST, + DIAL_API_VERSION, } from '../../constants/default-settings'; import { getApiHeaders } from './get-headers'; @@ -14,7 +14,7 @@ export async function getEntities( jwt: string, jobTitle: string | undefined, ): Promise { - const url = `${OPENAI_API_HOST}/openai/${type}s?api-version=${OPENAI_API_VERSION}`; + const url = `${DIAL_API_HOST}/openai/${type}s?api-version=${DIAL_API_VERSION}`; const errMsg = `Request for ${type}s returned an error`; const response = await fetch(url, { headers: getApiHeaders({ jwt, jobTitle }), diff --git a/src/utils/server/get-headers.ts b/src/utils/server/get-headers.ts index 21a6047d9b..7b8ec9be4c 100644 --- a/src/utils/server/get-headers.ts +++ b/src/utils/server/get-headers.ts @@ -17,7 +17,7 @@ export const getApiHeaders = ({ if (jwt) { headers['authorization'] = 'Bearer ' + jwt; } else if (process.env.AUTH_DISABLED === 'true') { - headers['Api-Key'] = process.env.OPENAI_API_KEY; + headers['Api-Key'] = process.env.DIAL_API_HOST; } if (jobTitle) { diff --git a/src/utils/server/index.ts b/src/utils/server/index.ts index f73020ce98..2c11970403 100644 --- a/src/utils/server/index.ts +++ b/src/utils/server/index.ts @@ -8,8 +8,8 @@ import { import { DEFAULT_ASSISTANT_SUBMODEL, - OPENAI_API_HOST, - OPENAI_API_VERSION, + DIAL_API_HOST, + DIAL_API_VERSION, } from '../../constants/default-settings'; import { errorsMessages } from '@/src/constants/errors'; @@ -42,10 +42,10 @@ function getUrl( isAddonsAdded: boolean, ): string { if (modelType === EntityType.Model && isAddonsAdded) { - return `${OPENAI_API_HOST}/openai/deployments/assistant/chat/completions?api-version=${OPENAI_API_VERSION}`; + return `${DIAL_API_HOST}/openai/deployments/assistant/chat/completions?api-version=${DIAL_API_VERSION}`; } - return `${OPENAI_API_HOST}/openai/deployments/${modelId}/chat/completions?api-version=${OPENAI_API_VERSION}`; + return `${DIAL_API_HOST}/openai/deployments/${modelId}/chat/completions?api-version=${DIAL_API_VERSION}`; } const encoder = new TextEncoder();