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
57432129
authored
2023-02-03 13:17:05 +0800
by
RSA
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
env
1 parent
b22f9a7b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
2 deletions
client/src/App.js
index.js
package-lock.json
package.json
client/src/App.js
View file @
5743212
...
...
@@ -26,7 +26,7 @@ function App() {
}
function
getEngines
(){
fetch
(
process
.
env
.
SERVER_URL
+
"
/
models"
)
fetch
(
process
.
env
.
SERVER_URL
+
"models"
)
.
then
(
res
=>
res
.
json
())
.
then
(
data
=>
{
console
.
log
(
data
.
models
.
data
)
...
...
@@ -48,7 +48,7 @@ function App() {
// fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post
const
messages
=
chatLogNew
.
map
((
message
)
=>
message
.
message
).
join
(
"\n"
)
const
response
=
await
fetch
(
process
.
env
.
SERVER_URL
,
{
const
response
=
await
fetch
(
process
.
env
.
SERVER_URL
+
"api"
,
{
method
:
"POST"
,
headers
:
{
"Content-Type"
:
"application/json"
...
...
index.js
View file @
5743212
...
...
@@ -2,8 +2,10 @@ const { Configuration, OpenAIApi } = require("openai");
const
express
=
require
(
'express'
)
const
bodyParser
=
require
(
'body-parser'
)
const
cors
=
require
(
'cors'
)
require
(
'dotenv'
).
config
()
// Open AI Configuration
console
.
log
(
process
.
env
.
OPENAI_API_ORG
)
const
configuration
=
new
Configuration
({
organization
:
process
.
env
.
OPENAI_API_ORG
,
apiKey
:
process
.
env
.
OPENAI_API_KEY
,
...
...
package-lock.json
View file @
5743212
...
...
@@ -142,6 +142,11 @@
"resolved"
:
"https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz"
,
"integrity"
:
"sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="
},
"dotenv"
:
{
"version"
:
"16.0.3"
,
"resolved"
:
"https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz"
,
"integrity"
:
"sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
},
"ee-first"
:
{
"version"
:
"1.1.1"
,
"resolved"
:
"https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
,
...
...
package.json
View file @
5743212
...
...
@@ -11,6 +11,7 @@
"dependencies"
:
{
"body-parser"
:
"^1.20.1"
,
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^16.0.3"
,
"express"
:
"^4.18.2"
,
"morgan"
:
"^1.10.0"
,
"openai"
:
"^3.1.0"
...
...
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