mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Add 'Include stream options' checkbox for OpenAI-compatible providers
This commit is contained in:
@@ -45,7 +45,7 @@ export class OpenAiHandler implements ApiHandler {
|
|||||||
stream: true,
|
stream: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.options.includeStreamOptions) {
|
if (this.options.includeStreamOptions ?? true) {
|
||||||
requestOptions.stream_options = { include_usage: true }
|
requestOptions.stream_options = { include_usage: true }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export interface ApiHandlerOptions {
|
|||||||
azureApiVersion?: string
|
azureApiVersion?: string
|
||||||
openRouterUseMiddleOutTransform?: boolean
|
openRouterUseMiddleOutTransform?: boolean
|
||||||
includeStreamOptions?: boolean
|
includeStreamOptions?: boolean
|
||||||
|
setAzureApiVersion?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ApiConfiguration = ApiHandlerOptions & {
|
export type ApiConfiguration = ApiHandlerOptions & {
|
||||||
|
|||||||
@@ -445,6 +445,24 @@ const ApiOptions = ({ showModelOptions, apiErrorMessage, modelIdErrorMessage }:
|
|||||||
placeholder={"Enter Model ID..."}>
|
placeholder={"Enter Model ID..."}>
|
||||||
<span style={{ fontWeight: 500 }}>Model ID</span>
|
<span style={{ fontWeight: 500 }}>Model ID</span>
|
||||||
</VSCodeTextField>
|
</VSCodeTextField>
|
||||||
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
|
<VSCodeCheckbox
|
||||||
|
checked={apiConfiguration?.includeStreamOptions ?? true}
|
||||||
|
onChange={(e: any) => {
|
||||||
|
const isChecked = e.target.checked
|
||||||
|
setApiConfiguration({
|
||||||
|
...apiConfiguration,
|
||||||
|
includeStreamOptions: isChecked
|
||||||
|
})
|
||||||
|
}}>
|
||||||
|
Include stream options
|
||||||
|
</VSCodeCheckbox>
|
||||||
|
<span
|
||||||
|
className="codicon codicon-info"
|
||||||
|
title="Stream options are for { include_usage: true }. Some providers may not support this option."
|
||||||
|
style={{ marginLeft: '5px', cursor: 'help' }}
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
<VSCodeCheckbox
|
<VSCodeCheckbox
|
||||||
checked={azureApiVersionSelected}
|
checked={azureApiVersionSelected}
|
||||||
onChange={(e: any) => {
|
onChange={(e: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user