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
a5e1e93a
authored
2024-08-15 16:06:29 +0800
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
31675_chatbotplus_llm
1 parent
26bb74be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
index.js
index.js
View file @
a5e1e93
...
...
@@ -288,14 +288,23 @@ async function runOpensource(req, res) {
const
response
=
await
axios
.
post
(
endpoint_api_url
+
'/chat/completions'
,
{
model
:
currentModel
,
messages
:
JSON
.
parse
(
message
),
temperature
max_tokens
:
2048
,
temperature
,
top_p
:
0.7
,
top_k
:
50
,
repetition_penalty
:
1
},
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Authorization'
:
'Bearer '
+
api_key
},
}).
catch
(
error
=>
{
error_msg
=
error
.
response
.
statusText
?
error
.
response
.
statusText
:
''
;
if
(
error
.
response
?.
data
?.
error
?.
param
===
'max_tokens'
)
{
input
=
"The output for your prompt is too long for us to process. Please reduce your prompt and try again."
;
}
else
{
error_msg
=
error
.
response
.
statusText
?
error
.
response
.
statusText
:
''
;
}
console
.
log
(
"err"
,
error
.
response
.
data
.
error
);
});
if
(
error_msg
!==
''
)
{
...
...
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