Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1baf092c
authored
Dec 19, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gemini
parent
79676022
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
controller/relay-text.go
+3
-1
web/src/constants/channel.constants.js
+15
-15
No files found.
controller/relay-text.go
View file @
1baf092c
...
@@ -188,7 +188,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
...
@@ -188,7 +188,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
if
baseURL
!=
""
{
if
baseURL
!=
""
{
requestBaseURL
=
baseURL
requestBaseURL
=
baseURL
}
}
version
:=
"v1"
version
:=
"v1
beta
"
if
c
.
GetString
(
"api_version"
)
!=
""
{
if
c
.
GetString
(
"api_version"
)
!=
""
{
version
=
c
.
GetString
(
"api_version"
)
version
=
c
.
GetString
(
"api_version"
)
}
}
...
@@ -200,6 +200,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
...
@@ -200,6 +200,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
apiKey
:=
c
.
Request
.
Header
.
Get
(
"Authorization"
)
apiKey
:=
c
.
Request
.
Header
.
Get
(
"Authorization"
)
apiKey
=
strings
.
TrimPrefix
(
apiKey
,
"Bearer "
)
apiKey
=
strings
.
TrimPrefix
(
apiKey
,
"Bearer "
)
fullRequestURL
+=
"?key="
+
apiKey
fullRequestURL
+=
"?key="
+
apiKey
//log.Println(fullRequestURL)
case
APITypeZhipu
:
case
APITypeZhipu
:
method
:=
"invoke"
method
:=
"invoke"
if
textRequest
.
Stream
{
if
textRequest
.
Stream
{
...
...
web/src/constants/channel.constants.js
View file @
1baf092c
export
const
CHANNEL_OPTIONS
=
[
export
const
CHANNEL_OPTIONS
=
[
{
key
:
1
,
text
:
'OpenAI'
,
value
:
1
,
color
:
'green'
,
label
:
'OpenAI'
},
{
key
:
1
,
text
:
'OpenAI'
,
value
:
1
,
color
:
'green'
,
label
:
'OpenAI'
},
{
key
:
24
,
text
:
'Midjourney Proxy'
,
value
:
24
,
color
:
'light-blue'
,
label
:
'Midjourney Proxy'
},
{
key
:
2
,
text
:
'Midjourney Proxy'
,
value
:
2
,
color
:
'light-blue'
,
label
:
'Midjourney Proxy'
},
{
key
:
14
,
text
:
'Anthropic Claude'
,
value
:
14
,
color
:
'black'
,
label
:
'Anthropic Claude'
},
{
key
:
14
,
text
:
'Anthropic Claude'
,
value
:
14
,
color
:
'black'
,
label
:
'Anthropic Claude'
},
{
key
:
3
,
text
:
'Azure OpenAI'
,
value
:
3
,
color
:
'olive'
,
label
:
'Azure OpenAI'
},
{
key
:
3
,
text
:
'Azure OpenAI'
,
value
:
3
,
color
:
'olive'
,
label
:
'Azure OpenAI'
},
{
key
:
11
,
text
:
'Google PaLM2'
,
value
:
11
,
color
:
'orange'
,
label
:
'Google PaLM2'
},
{
key
:
11
,
text
:
'Google PaLM2'
,
value
:
11
,
color
:
'orange'
,
label
:
'Google PaLM2'
},
{
key
:
24
,
text
:
'Google Gemini'
,
value
:
24
,
color
:
'orange'
},
{
key
:
24
,
text
:
'Google Gemini'
,
value
:
24
,
color
:
'orange'
,
label
:
'Google Gemini'
},
{
key
:
15
,
text
:
'百度文心千帆'
,
value
:
15
,
color
:
'blue'
,
label
:
'百度文心千帆'
},
{
key
:
15
,
text
:
'百度文心千帆'
,
value
:
15
,
color
:
'blue'
,
label
:
'百度文心千帆'
},
{
key
:
17
,
text
:
'阿里通义千问'
,
value
:
17
,
color
:
'orange'
,
label
:
'阿里通义千问'
},
{
key
:
17
,
text
:
'阿里通义千问'
,
value
:
17
,
color
:
'orange'
,
label
:
'阿里通义千问'
},
{
key
:
18
,
text
:
'讯飞星火认知'
,
value
:
18
,
color
:
'blue'
,
label
:
'讯飞星火认知'
},
{
key
:
18
,
text
:
'讯飞星火认知'
,
value
:
18
,
color
:
'blue'
,
label
:
'讯飞星火认知'
},
{
key
:
16
,
text
:
'智谱 ChatGLM'
,
value
:
16
,
color
:
'violet'
,
label
:
'智谱 ChatGLM'
},
{
key
:
16
,
text
:
'智谱 ChatGLM'
,
value
:
16
,
color
:
'violet'
,
label
:
'智谱 ChatGLM'
},
{
key
:
19
,
text
:
'360 智脑'
,
value
:
19
,
color
:
'blue'
,
label
:
'360 智脑'
},
{
key
:
19
,
text
:
'360 智脑'
,
value
:
19
,
color
:
'blue'
,
label
:
'360 智脑'
},
{
key
:
23
,
text
:
'腾讯混元'
,
value
:
23
,
color
:
'teal'
,
label
:
'腾讯混元'
},
{
key
:
23
,
text
:
'腾讯混元'
,
value
:
23
,
color
:
'teal'
,
label
:
'腾讯混元'
},
{
key
:
8
,
text
:
'自定义渠道'
,
value
:
8
,
color
:
'pink'
,
label
:
'自定义渠道'
},
{
key
:
8
,
text
:
'自定义渠道'
,
value
:
8
,
color
:
'pink'
,
label
:
'自定义渠道'
},
{
key
:
22
,
text
:
'知识库:FastGPT'
,
value
:
22
,
color
:
'blue'
,
label
:
'知识库:FastGPT'
},
{
key
:
22
,
text
:
'知识库:FastGPT'
,
value
:
22
,
color
:
'blue'
,
label
:
'知识库:FastGPT'
},
{
key
:
21
,
text
:
'知识库:AI Proxy'
,
value
:
21
,
color
:
'purple'
,
label
:
'知识库:AI Proxy'
},
{
key
:
21
,
text
:
'知识库:AI Proxy'
,
value
:
21
,
color
:
'purple'
,
label
:
'知识库:AI Proxy'
},
];
];
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