Skip to content

Commit

Permalink
fix: miss error alert when openai endpoint is emtpy
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Sep 3, 2024
1 parent 2823003 commit 7621e9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Easydict/Swift/Service/OpenAI/BaseOpenAIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class BaseOpenAIService: LLMStreamService {
completion: @escaping (EZQueryResult, Error?) -> ()
) {
Task {
result.isStreamFinished = false

var resultText = ""
let queryType = self.queryType(text: text, from: from, to: to)

Expand Down
1 change: 0 additions & 1 deletion Easydict/Swift/Service/OpenAI/LLMStreamService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ extension LLMStreamService {
) {
if result.isStreamFinished {
cancelStream()
completion(result, error)
return
}

Expand Down

0 comments on commit 7621e9e

Please sign in to comment.