mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Back to main
This commit is contained in:
parent
2ccab1444b
commit
194b574b02
3 changed files with 1 additions and 13 deletions
|
|
@ -13,9 +13,6 @@ import { convertToR1Format } from "../transform/r1-format"
|
|||
import { convertToSimpleMessages } from "../transform/simple-format"
|
||||
import { ApiStream } from "../transform/stream"
|
||||
|
||||
export const DEEP_SEEK_DEFAULT_TEMPERATURE = 0.6
|
||||
const OPENAI_DEFAULT_TEMPERATURE = 0
|
||||
|
||||
export class OpenAiHandler implements ApiHandler, SingleCompletionHandler {
|
||||
protected options: ApiHandlerOptions
|
||||
private client: OpenAI
|
||||
|
|
@ -73,9 +70,7 @@ export class OpenAiHandler implements ApiHandler, SingleCompletionHandler {
|
|||
|
||||
const requestOptions: OpenAI.Chat.Completions.ChatCompletionCreateParamsStreaming = {
|
||||
model: modelId,
|
||||
temperature:
|
||||
this.options.modelTemperature ??
|
||||
(deepseekReasoner ? DEEP_SEEK_DEFAULT_TEMPERATURE : OPENAI_DEFAULT_TEMPERATURE),
|
||||
temperature: 0,
|
||||
messages: convertedMessages,
|
||||
stream: true as const,
|
||||
stream_options: { include_usage: true },
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ type GlobalStateKey =
|
|||
| "customModes" // Array of custom modes
|
||||
| "unboundModelId"
|
||||
| "unboundModelInfo"
|
||||
| "modelTemperature"
|
||||
|
||||
export const GlobalFileNames = {
|
||||
apiConversationHistory: "api_conversation_history.json",
|
||||
|
|
@ -1588,7 +1587,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
unboundApiKey,
|
||||
unboundModelId,
|
||||
unboundModelInfo,
|
||||
modelTemperature,
|
||||
} = apiConfiguration
|
||||
await this.updateGlobalState("apiProvider", apiProvider)
|
||||
await this.updateGlobalState("apiModelId", apiModelId)
|
||||
|
|
@ -1630,7 +1628,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
await this.storeSecret("unboundApiKey", unboundApiKey)
|
||||
await this.updateGlobalState("unboundModelId", unboundModelId)
|
||||
await this.updateGlobalState("unboundModelInfo", unboundModelInfo)
|
||||
await this.updateGlobalState("modelTemperature", modelTemperature)
|
||||
if (this.cline) {
|
||||
this.cline.api = buildApiHandler(apiConfiguration)
|
||||
}
|
||||
|
|
@ -2391,7 +2388,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
unboundApiKey,
|
||||
unboundModelId,
|
||||
unboundModelInfo,
|
||||
modelTemperature,
|
||||
] = await Promise.all([
|
||||
this.getGlobalState("apiProvider") as Promise<ApiProvider | undefined>,
|
||||
this.getGlobalState("apiModelId") as Promise<string | undefined>,
|
||||
|
|
@ -2468,7 +2464,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
this.getSecret("unboundApiKey") as Promise<string | undefined>,
|
||||
this.getGlobalState("unboundModelId") as Promise<string | undefined>,
|
||||
this.getGlobalState("unboundModelInfo") as Promise<ModelInfo | undefined>,
|
||||
this.getGlobalState("modelTemperature") as Promise<number | undefined>,
|
||||
])
|
||||
|
||||
let apiProvider: ApiProvider
|
||||
|
|
@ -2527,7 +2522,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||
unboundApiKey,
|
||||
unboundModelId,
|
||||
unboundModelInfo,
|
||||
modelTemperature,
|
||||
},
|
||||
lastShownAnnouncementId,
|
||||
customInstructions,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ export interface ApiHandlerOptions {
|
|||
unboundApiKey?: string
|
||||
unboundModelId?: string
|
||||
unboundModelInfo?: ModelInfo
|
||||
modelTemperature?: number
|
||||
}
|
||||
|
||||
export type ApiConfiguration = ApiHandlerOptions & {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue