Skip to content

Commit 111e1c3

Browse files
feat(ask_sb): Add headers param to config to allow users to specify custom headers (#449)
1 parent a9a61e7 commit 111e1c3

File tree

16 files changed

+4720
-192
lines changed

16 files changed

+4720
-192
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- Added multi-branch indexing support for Gerrit. [#433](https://github.com/sourcebot-dev/sourcebot/pull/433)
1212
- [ask sb] Added `reasoningEffort` option to OpenAI provider. [#446](https://github.com/sourcebot-dev/sourcebot/pull/446)
13+
- [ask db] Added `headers` option to all providers. [#449](https://github.com/sourcebot-dev/sourcebot/pull/449)
1314

1415
### Fixed
1516
- Removed prefix from structured log output. [#443](https://github.com/sourcebot-dev/sourcebot/pull/443)

docs/docs/configuration/language-model-providers.mdx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,34 @@ The OpenAI compatible provider allows you to use any model that is compatible wi
324324
}
325325
```
326326

327+
# Custom headers
327328

328-
## Schema reference
329+
You can pass custom headers to the language model provider by using the `headers` parameter. Header values can either be a string or a environment variable. Headers are supported for all providers.
330+
331+
```json wrap icon="code" Example config with custom headers
332+
{
333+
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
334+
"models": [
335+
{
336+
// ... provider, model, displayName, etc...
337+
338+
// Key-value pairs of headers
339+
"headers": {
340+
// Header values can be passed as a environment variable...
341+
"my-secret-header": {
342+
"env": "MY_SECRET_HEADER_ENV_VAR"
343+
},
344+
345+
// ... or directly as a string.
346+
"my-non-secret-header": "plaintextvalue"
347+
}
348+
}
349+
]
350+
}
351+
```
352+
353+
354+
# Schema reference
329355

330356
<Accordion title="Reference">
331357
[schemas/v3/languageModel.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/languageModel.json)

0 commit comments

Comments
 (0)