Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/configuration/language-model-providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
Expand Down
20 changes: 20 additions & 0 deletions docs/snippets/schemas/v3/index.schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Comment thread
brendan-kellam marked this conversation as resolved.
}
},
"required": [
Expand Down Expand Up @@ -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": [
Expand Down
20 changes: 20 additions & 0 deletions docs/snippets/schemas/v3/languageModel.schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Comment thread
brendan-kellam marked this conversation as resolved.
}
},
"required": [
Expand Down Expand Up @@ -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": [
Expand Down
20 changes: 20 additions & 0 deletions packages/schemas/src/v3/index.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down
4 changes: 4 additions & 0 deletions packages/schemas/src/v3/index.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
20 changes: 20 additions & 0 deletions packages/schemas/src/v3/languageModel.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Comment thread
brendan-kellam marked this conversation as resolved.
}
},
"required": [
Expand Down Expand Up @@ -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": [
Expand Down
4 changes: 4 additions & 0 deletions packages/schemas/src/v3/languageModel.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/app/api/(server)/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ const getAISDKLanguageModelAndOptions = async (config: LanguageModel, orgId: num
model: openai(modelId),
providerOptions: {
openai: {
reasoningEffort: 'high'
reasoningEffort: config.reasoningEffort ?? 'medium'
} satisfies OpenAIResponsesProviderOptions,
},
};
Expand Down
10 changes: 10 additions & 0 deletions schemas/v3/languageModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
Comment thread
brendan-kellam marked this conversation as resolved.
},
"required": [
Expand Down