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
94162ec9
authored
2023-02-02 18:59:12 +0800
by
RSA
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
e03bc109
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
.env
client/src/App.js
index.js
.env
0 → 100644
View file @
94162ec
API_KEY="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"
API_ORG="org-2OIAoj4fSwE4RCzgvglUM55T"
LOCALHOST="http://localhost:3080/"
\ No newline at end of file
client/src/App.js
View file @
94162ec
...
...
@@ -26,7 +26,7 @@ function App() {
}
function
getEngines
(){
fetch
(
"http://localhost:3080
/models"
)
fetch
(
process
.
env
.
LOCALHOST
+
"
/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
(
"http://localhost:3080/"
,
{
const
response
=
await
fetch
(
process
.
env
.
LOCALHOST
,
{
method
:
"POST"
,
headers
:
{
"Content-Type"
:
"application/json"
...
...
index.js
View file @
94162ec
...
...
@@ -5,8 +5,8 @@ const cors = require('cors')
// Open AI Configuration
const
configuration
=
new
Configuration
({
organization
:
"org-organization"
,
apiKey
:
"sk-apiKey"
,
organization
:
process
.
env
.
API_ORG
,
apiKey
:
process
.
env
.
API_KEY
,
});
const
openai
=
new
OpenAIApi
(
configuration
);
...
...
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