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
736b77b6
authored
Nov 14, 2023
by
luxl-1379
Committed by
GitHub
Nov 14, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1 from Calcium-Ion/main
1
parents
227711b2
539e598c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
11 deletions
+21
-11
common/model-ratio.go
+1
-0
controller/model.go
+9
-0
docker-compose.yml
+1
-1
web/src/components/SiderBar.js
+9
-10
web/src/constants/channel.constants.js
+1
-0
No files found.
common/model-ratio.go
View file @
736b77b6
...
...
@@ -14,6 +14,7 @@ import (
// 1 === $0.002 / 1K tokens
// 1 === ¥0.014 / 1k tokens
var
ModelRatio
=
map
[
string
]
float64
{
"midjourney"
:
50
,
"gpt-4"
:
15
,
"gpt-4-0314"
:
15
,
"gpt-4-0613"
:
15
,
...
...
controller/model.go
View file @
736b77b6
...
...
@@ -55,6 +55,15 @@ func init() {
// https://platform.openai.com/docs/models/model-endpoint-compatibility
openAIModels
=
[]
OpenAIModels
{
{
Id
:
"midjourney"
,
Object
:
"model"
,
Created
:
1677649963
,
OwnedBy
:
"Midjourney"
,
Permission
:
permission
,
Root
:
"midjourney"
,
Parent
:
nil
,
},
{
Id
:
"dall-e-2"
,
Object
:
"model"
,
Created
:
1677649963
,
...
...
docker-compose.yml
View file @
736b77b6
...
...
@@ -2,7 +2,7 @@ version: '3.4'
services
:
one-api
:
image
:
justsong/one-api:latest
image
:
calciumion/neko-api:main
container_name
:
one-api
restart
:
always
command
:
--log-dir /app/logs
...
...
web/src/components/SiderBar.js
View file @
736b77b6
...
...
@@ -15,7 +15,7 @@ import {
IconLayers
,
IconSetting
,
IconCreditCard
,
Icon
SemiLogo
,
Icon
Comment
,
IconHome
,
IconImage
}
from
'@douyinfe/semi-icons'
;
...
...
@@ -36,7 +36,13 @@ let headerButtons = [
icon
:
<
IconLayers
/>
,
className
:
isAdmin
()?
'semi-navigation-item-normal'
:
'tableHiddle'
,
},
{
text
:
'聊天'
,
itemKey
:
'chat'
,
to
:
'/chat'
,
icon
:
<
IconComment
/>
,
className
:
localStorage
.
getItem
(
'chat_link'
)?
'semi-navigation-item-normal'
:
'tableHiddle'
,
},
{
text
:
'令牌'
,
itemKey
:
'token'
,
...
...
@@ -89,14 +95,6 @@ let headerButtons = [
// }
];
if
(
localStorage
.
getItem
(
'chat_link'
))
{
headerButtons
.
splice
(
1
,
0
,
{
name
:
'聊天'
,
to
:
'/chat'
,
icon
:
'comments'
});
}
const
HeaderBar
=
()
=>
{
const
[
userState
,
userDispatch
]
=
useContext
(
UserContext
);
let
navigate
=
useNavigate
();
...
...
@@ -134,6 +132,7 @@ const HeaderBar = () => {
midjourney
:
"/midjourney"
,
setting
:
"/setting"
,
about
:
"/about"
,
chat
:
"/chat"
,
};
return
(
<
Link
...
...
web/src/constants/channel.constants.js
View file @
736b77b6
export
const
CHANNEL_OPTIONS
=
[
{
key
:
1
,
text
:
'OpenAI'
,
value
:
1
,
color
:
'green'
},
{
key
:
99
,
text
:
'Midjourney-Proxy'
,
value
:
99
,
color
:
'green'
},
{
key
:
14
,
text
:
'Anthropic Claude'
,
value
:
14
,
color
:
'black'
},
{
key
:
3
,
text
:
'Azure OpenAI'
,
value
:
3
,
color
:
'olive'
},
{
key
:
11
,
text
:
'Google PaLM2'
,
value
:
11
,
color
:
'orange'
},
...
...
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