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
f9fcdbe6
authored
2023-03-30 14:02:46 +0800
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update
1 parent
931a4681
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletions
index.js
package.json
index.js
View file @
f9fcdbe
...
...
@@ -4,6 +4,7 @@ const bodyParser = require('body-parser')
const
cors
=
require
(
'cors'
)
require
(
'dotenv'
).
config
()
const
rateLimit
=
require
(
'express-rate-limit'
)
const
anchorme
=
require
(
"anchorme"
).
default
;
// Open AI Configuration
// console.log(process.env.OPENAI_API_ORG)
...
...
@@ -63,8 +64,17 @@ app.post('/api', async (req, res) => {
max_tokens
:
3000
,
temperature
,
});
let
input
=
response
.
data
.
choices
[
0
].
text
;
res
.
json
({
message
:
response
.
data
.
choices
[
0
].
text
,
input
:
input
,
message
:
anchorme
({
input
,
options
:
{
attributes
:
{
target
:
"_blank"
},
}
})
})
}
catch
(
e
)
{
let
error_msg
=
e
.
response
.
data
.
error
.
message
?
e
.
response
.
data
.
error
.
message
:
''
;
...
...
package.json
View file @
f9fcdbe
...
...
@@ -9,6 +9,7 @@
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"anchorme"
:
"^2.1.2"
,
"body-parser"
:
"^1.20.1"
,
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^16.0.3"
,
...
...
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