Skip to content

Commit

Permalink
Add logging for OpenAI request and fix locale/logic issues (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho authored Dec 14, 2024
1 parent bb88eaa commit 566e6ae
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/chat_main_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ func (h *ChatHandler) chatStream(w http.ResponseWriter, chatSession sqlc_queries
RespondWithError(w, http.StatusInternalServerError, "error.system_message_notice", err)
return "", "", true
}
log.Printf("%+v", openai_req)
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
defer cancel()

Expand Down
2 changes: 1 addition & 1 deletion web/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"isEnable": "Is Enabled",
"label": "Model name",
"maxToken": "Maximum token number",
"name": "ID",
"name": "Model ID",
"orderNumber": "Order number",
"url": "Request full URL"
},
Expand Down
2 changes: 1 addition & 1 deletion web/src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"chat_model": {
"deleteModel": "删除",
"deleteModelConfirm": "确认删除",
"name": "模型名称(ID)",
"name": "模型名称(model ID in api)",
"label": "模型标签",
"isDefault": "默认?",
"apiAuthHeader": "Auth Header key",
Expand Down
2 changes: 1 addition & 1 deletion web/src/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"enablePerModelRateLimit": "是否單獨流控",
"isDefault": "默認?",
"isEnable": "是否啟用",
"label": "模型名稱",
"label": "模型名稱(ID)",
"maxToken": "最大token數量",
"name": "身分識別號",
"orderNumber": "次序",
Expand Down
4 changes: 2 additions & 2 deletions web/src/store/modules/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const useChatStore = defineStore('chat-store', {
const chatData = this.chat[keys[0]]
const chat = chatData[index]
chatData.splice(index, 1)
if (chat)
if (chat && chat.uuid)
await deleteChatData(chat)
}
return
Expand All @@ -250,7 +250,7 @@ export const useChatStore = defineStore('chat-store', {
const chatData = this.chat[uuid]
const chat = chatData[index]
chatData.splice(index, 1)
if (chat)
if (chat && chat.uuid)
await deleteChatData(chat)
}
},
Expand Down

0 comments on commit 566e6ae

Please sign in to comment.