fix: fix the typo of openai (#1298)

pull/1299/head
Yunwei Xiao 2 years ago committed by GitHub
parent 595dbdb0ec
commit c57cea1aaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,7 +11,7 @@ import (
) )
func (s *Server) registerOpenAIRoutes(g *echo.Group) { func (s *Server) registerOpenAIRoutes(g *echo.Group) {
g.POST("/opanai/chat-completion", func(c echo.Context) error { g.POST("/openai/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) {
return c.JSON(http.StatusOK, composeResponse(result)) return c.JSON(http.StatusOK, composeResponse(result))
}) })
g.POST("/opanai/text-completion", func(c echo.Context) error { g.POST("/openai/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) {
return c.JSON(http.StatusOK, composeResponse(result)) return c.JSON(http.StatusOK, composeResponse(result))
}) })
g.GET("/opanai/enabled", func(c echo.Context) error { g.GET("/openai/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,

@ -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/opanai/chat-completion`, { return axios.post<ResponseObject<string>>(`/api/openai/chat-completion`, {
prompt, prompt,
}); });
} }
export function postTextCompletion(prompt: string) { export function postTextCompletion(prompt: string) {
return axios.post<ResponseObject<string>>(`/api/opanai/text-completion`, { return axios.post<ResponseObject<string>>(`/api/openai/text-completion`, {
prompt, prompt,
}); });
} }
export function checkOpenAIEnabled() { export function checkOpenAIEnabled() {
return axios.get<ResponseObject<boolean>>(`/api/opanai/enabled`); return axios.get<ResponseObject<boolean>>(`/api/openai/enabled`);
} }
export async function getRepoStarCount() { export async function getRepoStarCount() {

Loading…
Cancel
Save