Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
625b0afa
Unverified
Commit
625b0afa
authored
Jan 31, 2024
by
zxhlyh
Committed by
GitHub
Jan 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: next public edition default value (#2310)
parent
2660fbaa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
28 deletions
+7
-28
index.ts
web/config/index.ts
+7
-28
No files found.
web/config/index.ts
View file @
625b0afa
/* eslint-disable import/no-mutable-exports */
/* eslint-disable import/no-mutable-exports */
import
{
AgentStrategy
,
AppType
,
ProviderType
}
from
'@/types/app'
import
{
AgentStrategy
}
from
'@/types/app'
const
isDevelopment
=
process
.
env
.
NODE_ENV
===
'development'
export
let
apiPrefix
=
''
export
let
apiPrefix
=
''
export
let
publicApiPrefix
=
''
export
let
publicApiPrefix
=
''
...
@@ -20,38 +18,19 @@ else if (
...
@@ -20,38 +18,19 @@ else if (
publicApiPrefix
=
globalThis
.
document
.
body
.
getAttribute
(
'data-pubic-api-prefix'
)
as
string
publicApiPrefix
=
globalThis
.
document
.
body
.
getAttribute
(
'data-pubic-api-prefix'
)
as
string
}
}
else
{
else
{
if
(
isDevelopment
)
{
apiPrefix
=
'https://cloud.dify.dev/console/api'
publicApiPrefix
=
'https://dev.udify.app/api'
}
else
{
// const domainParts = globalThis.location?.host?.split('.');
// const domainParts = globalThis.location?.host?.split('.');
// in production env, the host is dify.app . In other env, the host is [dev].dify.app
// in production env, the host is dify.app . In other env, the host is [dev].dify.app
// const env = domainParts.length === 2 ? 'ai' : domainParts?.[0];
// const env = domainParts.length === 2 ? 'ai' : domainParts?.[0];
apiPrefix
=
'/console/api'
apiPrefix
=
'http://localhost:5001/console/api'
publicApiPrefix
=
'/api'
// avoid browser private mode api cross origin
publicApiPrefix
=
'http://localhost:5001/api'
// avoid browser private mode api cross origin
}
}
}
export
const
API_PREFIX
:
string
=
apiPrefix
export
const
API_PREFIX
:
string
=
apiPrefix
export
const
PUBLIC_API_PREFIX
:
string
=
publicApiPrefix
export
const
PUBLIC_API_PREFIX
:
string
=
publicApiPrefix
const
EDITION
=
process
.
env
.
NEXT_PUBLIC_EDITION
||
globalThis
.
document
?.
body
?.
getAttribute
(
'data-public-edition'
)
const
EDITION
=
process
.
env
.
NEXT_PUBLIC_EDITION
||
globalThis
.
document
?.
body
?.
getAttribute
(
'data-public-edition'
)
||
'SELF_HOSTED'
export
const
IS_CE_EDITION
=
EDITION
===
'SELF_HOSTED'
export
const
IS_CE_EDITION
=
EDITION
===
'SELF_HOSTED'
export
const
MODEL_LIST
=
[
{
id
:
'gpt-3.5-turbo'
,
name
:
'gpt-3.5-turbo'
,
type
:
AppType
.
chat
},
{
id
:
'gpt-3.5-turbo-16k'
,
name
:
'gpt-3.5-turbo-16k'
,
type
:
AppType
.
chat
},
{
id
:
'gpt-4'
,
name
:
'gpt-4'
,
type
:
AppType
.
chat
},
// 8k version
{
id
:
'claude-instant-1'
,
name
:
'claude-instant-1'
,
type
:
AppType
.
chat
,
provider
:
ProviderType
.
anthropic
},
// set 30k
{
id
:
'claude-2'
,
name
:
'claude-2'
,
type
:
AppType
.
chat
,
provider
:
ProviderType
.
anthropic
},
// set 30k
{
id
:
'gpt-3.5-turbo'
,
name
:
'gpt-3.5-turbo'
,
type
:
AppType
.
completion
},
{
id
:
'gpt-3.5-turbo-16k'
,
name
:
'gpt-3.5-turbo-16k'
,
type
:
AppType
.
completion
},
{
id
:
'text-davinci-003'
,
name
:
'text-davinci-003'
,
type
:
AppType
.
completion
},
{
id
:
'gpt-4'
,
name
:
'gpt-4'
,
type
:
AppType
.
completion
},
// 8k version
{
id
:
'claude-instant-1'
,
name
:
'claude-instant-1'
,
type
:
AppType
.
completion
,
provider
:
ProviderType
.
anthropic
},
// set 30k
{
id
:
'claude-2'
,
name
:
'claude-2'
,
type
:
AppType
.
completion
,
provider
:
ProviderType
.
anthropic
},
// set 30k
]
export
const
TONE_LIST
=
[
export
const
TONE_LIST
=
[
{
{
id
:
1
,
id
:
1
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment