Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
00d21dfc
authored
2024-03-06 18:00:15 +0800
by
Jerald Lim
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
30033_open_ai_brand
1 parent
56e92779
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
client/src/SideMenu.js
index.js
client/src/SideMenu.js
View file @
00d21df
...
...
@@ -33,7 +33,7 @@ const SideMenu = ({
{
models
&&
models
.
length
?
(
models
.
map
((
model
,
index
)
=>
(
<
option
key
=
{
model
.
id
}
value
=
{
model
.
id
}
>
{
model
.
id
}
{
model
.
beta
?
"(beta)"
:
""
}
{
model
.
name
}
{
model
.
beta
?
"(beta)"
:
""
}
<
/option
>
))
)
:
(
...
...
index.js
View file @
00d21df
...
...
@@ -250,15 +250,15 @@ async function runOpensource(req, res) {
},
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Authorization'
:
'Bearer '
+
api_key
'Authorization'
:
'Bearer '
+
api_key
},
})
.
catch
(
error
=>
{
}).
catch
(
error
=>
{
error_msg
=
error
.
response
.
statusText
?
error
.
response
.
statusText
:
''
;
});
if
(
error_msg
!==
''
)
{
input
=
"Error: "
+
error_msg
;
}
else
{
if
(
error_msg
!==
''
)
{
input
=
"Error: "
+
error_msg
;
}
else
{
input
=
response
.
data
.
choices
[
0
].
message
.
content
}
...
...
@@ -302,12 +302,12 @@ async function runOpensource(req, res) {
// Get Models Route
app
.
get
(
'/models'
,
async
(
req
,
res
)
=>
{
const
response
=
await
openai
.
list
Engine
s
();
const
response
=
await
openai
.
list
Model
s
();
const
models
=
response
.
data
;
const
opensource_models
=
process
.
env
.
OPENSOURCE_MODELS
?
process
.
env
.
OPENSOURCE_MODELS
.
split
(
','
)
:
[];
models
.
data
=
models
.
data
.
filter
((
model
)
=>
{
return
model
.
id
.
indexOf
(
'gpt-
4'
)
<
0
return
model
.
id
.
indexOf
(
'gpt-
3'
)
===
0
})
opensource_models
.
forEach
((
model
)
=>
{
...
...
@@ -317,6 +317,23 @@ app.get('/models', async (req, res) => {
});
})
const
months
=
[
"JAN"
,
"FEB"
,
"MAR"
,
"APR"
,
"MAY"
,
"JUN"
,
"JUL"
,
"AUG"
,
"SEP"
,
"OCT"
,
"NOV"
,
"DEC"
];
// add name
models
.
data
.
forEach
((
model
)
=>
{
if
(
model
.
id
.
includes
(
'gpt-3'
))
{
const
d
=
new
Date
(
model
.
created
*
1000
);
let
month
=
months
[
d
.
getMonth
()];
model
.
name
=
'GPT-3 '
+
month
+
' '
+
d
.
getDate
();
}
else
if
(
model
.
id
==
'dall-e-2'
)
{
model
.
name
=
'DALL-E 2'
;
}
else
if
(
model
.
id
==
'dall-e-3'
)
{
model
.
name
=
'DALL-E 3'
;
}
else
{
model
.
name
=
model
.
id
;
}
})
res
.
json
({
models
})
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment