cleanup
This commit is contained in:
parent
07313a0c16
commit
8f3ee86d50
4 changed files with 4 additions and 8 deletions
|
|
@ -214,8 +214,7 @@ class Anthropic extends BaseLLM {
|
|||
});
|
||||
|
||||
if (response.status === 499) {
|
||||
// Aborted by user
|
||||
return;
|
||||
return; // Aborted by user
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
|
|
|
|||
|
|
@ -439,8 +439,7 @@ class Gemini extends BaseLLM {
|
|||
signal,
|
||||
});
|
||||
if (response.status === 499) {
|
||||
// Aborted by user
|
||||
return;
|
||||
return; // Aborted by user
|
||||
}
|
||||
const data = await response.json();
|
||||
yield { role: "assistant", content: data.candidates[0].content };
|
||||
|
|
|
|||
|
|
@ -458,8 +458,7 @@ class Ollama extends BaseLLM implements ModelInstaller {
|
|||
|
||||
if (chatOptions.stream === false) {
|
||||
if (response.status === 499) {
|
||||
// Aborted by user
|
||||
return;
|
||||
return; // Aborted by user
|
||||
}
|
||||
const json = (await response.json()) as OllamaChatResponse;
|
||||
yield convertChatMessage(json);
|
||||
|
|
|
|||
|
|
@ -353,8 +353,7 @@ class OpenAI extends BaseLLM {
|
|||
// Handle non-streaming response
|
||||
if (body.stream === false) {
|
||||
if (response.status === 499) {
|
||||
// Aborted by user
|
||||
return;
|
||||
return; // Aborted by user
|
||||
}
|
||||
const data = await response.json();
|
||||
yield data.choices[0].message;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue