mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
feat(ask_sb): Add reasoningEffort option to openai provider (#446)
This commit is contained in:
parent
6215a8e949
commit
0773399392
10 changed files with 102 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Added
|
||||
- Added multi-branch indexing support for Gerrit. [#433](https://github.com/sourcebot-dev/sourcebot/pull/433)
|
||||
- [ask sb] Added `reasoningEffort` option to OpenAI provider. [#446](https://github.com/sourcebot-dev/sourcebot/pull/446)
|
||||
|
||||
### Fixed
|
||||
- Removed prefix from structured log output. [#443](https://github.com/sourcebot-dev/sourcebot/pull/443)
|
||||
|
|
|
|||
|
|
@ -248,7 +248,8 @@ For a detailed description of all the providers, please refer to the [schema](ht
|
|||
"token": {
|
||||
"env": "OPENAI_API_KEY"
|
||||
},
|
||||
"baseUrl": "OPTIONAL_BASE_URL"
|
||||
"baseUrl": "OPTIONAL_BASE_URL",
|
||||
"reasoningEffort": "OPTIONAL_REASONING_EFFORT" // defaults to "medium"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1818,6 +1818,16 @@
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
@ -2624,6 +2634,16 @@
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -615,6 +615,16 @@
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
@ -1421,6 +1431,16 @@
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -1817,6 +1817,16 @@ const schema = {
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
@ -2623,6 +2633,16 @@ const schema = {
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -792,6 +792,10 @@ export interface OpenAILanguageModel {
|
|||
* Optional base URL.
|
||||
*/
|
||||
baseUrl?: string;
|
||||
/**
|
||||
* The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings
|
||||
*/
|
||||
reasoningEffort?: string;
|
||||
}
|
||||
export interface OpenAICompatibleLanguageModel {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -614,6 +614,16 @@ const schema = {
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
@ -1420,6 +1430,16 @@ const schema = {
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
|
|
@ -363,6 +363,10 @@ export interface OpenAILanguageModel {
|
|||
* Optional base URL.
|
||||
*/
|
||||
baseUrl?: string;
|
||||
/**
|
||||
* The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings
|
||||
*/
|
||||
reasoningEffort?: string;
|
||||
}
|
||||
export interface OpenAICompatibleLanguageModel {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ const getAISDKLanguageModelAndOptions = async (config: LanguageModel, orgId: num
|
|||
model: openai(modelId),
|
||||
providerOptions: {
|
||||
openai: {
|
||||
reasoningEffort: 'high'
|
||||
reasoningEffort: config.reasoningEffort ?? 'medium'
|
||||
} satisfies OpenAIResponsesProviderOptions,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -343,6 +343,16 @@
|
|||
"format": "url",
|
||||
"pattern": "^https?:\\/\\/[^\\s/$.?#].[^\\s]*$",
|
||||
"description": "Optional base URL."
|
||||
},
|
||||
"reasoningEffort": {
|
||||
"type": "string",
|
||||
"description": "The reasoning effort to use with the model. Defaults to `medium`. See https://platform.openai.com/docs/guides/reasoning#get-started-with-reasonings",
|
||||
"examples": [
|
||||
"minimal",
|
||||
"low",
|
||||
"medium",
|
||||
"high"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
|||
Loading…
Reference in a new issue