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
c6f407df
authored
2023-03-30 06:03:56 +0000
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch '27034_spacing' into '1DEVT'
27034 spacing See merge request
!48
2 parents
7c7a4c1c
f9fcdbe6
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 @
c6f407d
...
...
@@ -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)
...
...
@@ -65,8 +66,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 @
c6f407d
...
...
@@ -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