Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
c57cea1a
Unverified
Commit
c57cea1a
authored
Mar 07, 2023
by
Yunwei Xiao
Committed by
GitHub
Mar 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix the typo of openai (#1298)
parent
595dbdb0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
openai.go
server/openai.go
+3
-3
api.ts
web/src/helpers/api.ts
+3
-3
No files found.
server/openai.go
View file @
c57cea1a
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
)
)
func
(
s
*
Server
)
registerOpenAIRoutes
(
g
*
echo
.
Group
)
{
func
(
s
*
Server
)
registerOpenAIRoutes
(
g
*
echo
.
Group
)
{
g
.
POST
(
"/op
a
nai/chat-completion"
,
func
(
c
echo
.
Context
)
error
{
g
.
POST
(
"/op
e
nai/chat-completion"
,
func
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
ctx
:=
c
.
Request
()
.
Context
()
openAIApiKeySetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
openAIApiKeySetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
Name
:
api
.
SystemSettingOpenAIAPIKeyName
,
Name
:
api
.
SystemSettingOpenAIAPIKeyName
,
...
@@ -62,7 +62,7 @@ func (s *Server) registerOpenAIRoutes(g *echo.Group) {
...
@@ -62,7 +62,7 @@ func (s *Server) registerOpenAIRoutes(g *echo.Group) {
return
c
.
JSON
(
http
.
StatusOK
,
composeResponse
(
result
))
return
c
.
JSON
(
http
.
StatusOK
,
composeResponse
(
result
))
})
})
g
.
POST
(
"/op
a
nai/text-completion"
,
func
(
c
echo
.
Context
)
error
{
g
.
POST
(
"/op
e
nai/text-completion"
,
func
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
ctx
:=
c
.
Request
()
.
Context
()
openAIApiKeySetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
openAIApiKeySetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
Name
:
api
.
SystemSettingOpenAIAPIKeyName
,
Name
:
api
.
SystemSettingOpenAIAPIKeyName
,
...
@@ -113,7 +113,7 @@ func (s *Server) registerOpenAIRoutes(g *echo.Group) {
...
@@ -113,7 +113,7 @@ func (s *Server) registerOpenAIRoutes(g *echo.Group) {
return
c
.
JSON
(
http
.
StatusOK
,
composeResponse
(
result
))
return
c
.
JSON
(
http
.
StatusOK
,
composeResponse
(
result
))
})
})
g
.
GET
(
"/op
a
nai/enabled"
,
func
(
c
echo
.
Context
)
error
{
g
.
GET
(
"/op
e
nai/enabled"
,
func
(
c
echo
.
Context
)
error
{
ctx
:=
c
.
Request
()
.
Context
()
ctx
:=
c
.
Request
()
.
Context
()
openAIApiKeySetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
openAIApiKeySetting
,
err
:=
s
.
Store
.
FindSystemSetting
(
ctx
,
&
api
.
SystemSettingFind
{
Name
:
api
.
SystemSettingOpenAIAPIKeyName
,
Name
:
api
.
SystemSettingOpenAIAPIKeyName
,
...
...
web/src/helpers/api.ts
View file @
c57cea1a
...
@@ -247,19 +247,19 @@ export function deleteIdentityProvider(id: IdentityProviderId) {
...
@@ -247,19 +247,19 @@ export function deleteIdentityProvider(id: IdentityProviderId) {
}
}
export
function
postChatCompletion
(
prompt
:
string
)
{
export
function
postChatCompletion
(
prompt
:
string
)
{
return
axios
.
post
<
ResponseObject
<
string
>>
(
`/api/op
a
nai/chat-completion`
,
{
return
axios
.
post
<
ResponseObject
<
string
>>
(
`/api/op
e
nai/chat-completion`
,
{
prompt
,
prompt
,
});
});
}
}
export
function
postTextCompletion
(
prompt
:
string
)
{
export
function
postTextCompletion
(
prompt
:
string
)
{
return
axios
.
post
<
ResponseObject
<
string
>>
(
`/api/op
a
nai/text-completion`
,
{
return
axios
.
post
<
ResponseObject
<
string
>>
(
`/api/op
e
nai/text-completion`
,
{
prompt
,
prompt
,
});
});
}
}
export
function
checkOpenAIEnabled
()
{
export
function
checkOpenAIEnabled
()
{
return
axios
.
get
<
ResponseObject
<
boolean
>>
(
`/api/op
a
nai/enabled`
);
return
axios
.
get
<
ResponseObject
<
boolean
>>
(
`/api/op
e
nai/enabled`
);
}
}
export
async
function
getRepoStarCount
()
{
export
async
function
getRepoStarCount
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment