mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: add error handling wrapper to SambaNova createStream method
This commit is contained in:
parent
c649bd2d32
commit
a95783fb9f
1 changed files with 6 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ import { convertToOpenAiMessages } from "../transform/openai-format"
|
|||
import type { ApiHandlerCreateMessageMetadata } from "../index"
|
||||
|
||||
import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider"
|
||||
import { handleOpenAIError } from "./utils/openai-error-handler"
|
||||
|
||||
export class SambaNovaHandler extends BaseOpenAiCompatibleProvider<SambaNovaModelId> {
|
||||
constructor(options: ApiHandlerOptions) {
|
||||
|
|
@ -64,6 +65,10 @@ export class SambaNovaHandler extends BaseOpenAiCompatibleProvider<SambaNovaMode
|
|||
;(params as any).thinking = { type: "enabled" }
|
||||
}
|
||||
|
||||
return this.client.chat.completions.create(params, requestOptions)
|
||||
try {
|
||||
return this.client.chat.completions.create(params, requestOptions)
|
||||
} catch (error) {
|
||||
throw handleOpenAIError(error, this.providerName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue