Skip to content

Commit a74d070

Browse files
feat(ask_sb): Add support for queryParams to OpenAI compatible language model providers (#490)
1 parent c451a7c commit a74d070

File tree

14 files changed

+567
-24
lines changed

14 files changed

+567
-24
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [4.6.6] - 2025-09-04
1111

12+
### Added
13+
- Added support for specifying query params for openai compatible language models. [#490](https://github.com/sourcebot-dev/sourcebot/pull/490)
14+
1215
### Fixed
1316
- Fix issue where zoekt was failing to index repositories due to `HEAD` pointing to a branch that does not exist. [#488](https://github.com/sourcebot-dev/sourcebot/pull/488)
1417

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ The OpenAI compatible provider allows you to use any model that is compatible wi
275275
"displayName": "OPTIONAL_DISPLAY_NAME",
276276
"token": {
277277
"env": "OPTIONAL_API_KEY"
278+
},
279+
// Optional query parameters can be passed in the request url as:
280+
"queryParams": {
281+
// raw string values
282+
"optional-query-param": "foo",
283+
// or as environment variables
284+
"optional-query-param-secret": {
285+
"env": "MY_SECRET_ENV_VAR"
286+
}
278287
}
279288
}
280289
]

docs/snippets/schemas/v3/index.schema.mdx

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,50 @@
23612361
}
23622362
},
23632363
"additionalProperties": false
2364+
},
2365+
"queryParams": {
2366+
"type": "object",
2367+
"description": "Optional query parameters to include in the request url.",
2368+
"patternProperties": {
2369+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
2370+
"anyOf": [
2371+
{
2372+
"type": "string"
2373+
},
2374+
{
2375+
"anyOf": [
2376+
{
2377+
"type": "object",
2378+
"properties": {
2379+
"secret": {
2380+
"type": "string",
2381+
"description": "The name of the secret that contains the token."
2382+
}
2383+
},
2384+
"required": [
2385+
"secret"
2386+
],
2387+
"additionalProperties": false
2388+
},
2389+
{
2390+
"type": "object",
2391+
"properties": {
2392+
"env": {
2393+
"type": "string",
2394+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
2395+
}
2396+
},
2397+
"required": [
2398+
"env"
2399+
],
2400+
"additionalProperties": false
2401+
}
2402+
]
2403+
}
2404+
]
2405+
}
2406+
},
2407+
"additionalProperties": false
23642408
}
23652409
},
23662410
"required": [
@@ -3736,6 +3780,50 @@
37363780
}
37373781
},
37383782
"additionalProperties": false
3783+
},
3784+
"queryParams": {
3785+
"type": "object",
3786+
"description": "Optional query parameters to include in the request url.",
3787+
"patternProperties": {
3788+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
3789+
"anyOf": [
3790+
{
3791+
"type": "string"
3792+
},
3793+
{
3794+
"anyOf": [
3795+
{
3796+
"type": "object",
3797+
"properties": {
3798+
"secret": {
3799+
"type": "string",
3800+
"description": "The name of the secret that contains the token."
3801+
}
3802+
},
3803+
"required": [
3804+
"secret"
3805+
],
3806+
"additionalProperties": false
3807+
},
3808+
{
3809+
"type": "object",
3810+
"properties": {
3811+
"env": {
3812+
"type": "string",
3813+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
3814+
}
3815+
},
3816+
"required": [
3817+
"env"
3818+
],
3819+
"additionalProperties": false
3820+
}
3821+
]
3822+
}
3823+
]
3824+
}
3825+
},
3826+
"additionalProperties": false
37393827
}
37403828
},
37413829
"required": [

docs/snippets/schemas/v3/languageModel.schema.mdx

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,50 @@
11581158
}
11591159
},
11601160
"additionalProperties": false
1161+
},
1162+
"queryParams": {
1163+
"type": "object",
1164+
"description": "Optional query parameters to include in the request url.",
1165+
"patternProperties": {
1166+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
1167+
"anyOf": [
1168+
{
1169+
"type": "string"
1170+
},
1171+
{
1172+
"anyOf": [
1173+
{
1174+
"type": "object",
1175+
"properties": {
1176+
"secret": {
1177+
"type": "string",
1178+
"description": "The name of the secret that contains the token."
1179+
}
1180+
},
1181+
"required": [
1182+
"secret"
1183+
],
1184+
"additionalProperties": false
1185+
},
1186+
{
1187+
"type": "object",
1188+
"properties": {
1189+
"env": {
1190+
"type": "string",
1191+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
1192+
}
1193+
},
1194+
"required": [
1195+
"env"
1196+
],
1197+
"additionalProperties": false
1198+
}
1199+
]
1200+
}
1201+
]
1202+
}
1203+
},
1204+
"additionalProperties": false
11611205
}
11621206
},
11631207
"required": [
@@ -2533,6 +2577,50 @@
25332577
}
25342578
},
25352579
"additionalProperties": false
2580+
},
2581+
"queryParams": {
2582+
"type": "object",
2583+
"description": "Optional query parameters to include in the request url.",
2584+
"patternProperties": {
2585+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
2586+
"anyOf": [
2587+
{
2588+
"type": "string"
2589+
},
2590+
{
2591+
"anyOf": [
2592+
{
2593+
"type": "object",
2594+
"properties": {
2595+
"secret": {
2596+
"type": "string",
2597+
"description": "The name of the secret that contains the token."
2598+
}
2599+
},
2600+
"required": [
2601+
"secret"
2602+
],
2603+
"additionalProperties": false
2604+
},
2605+
{
2606+
"type": "object",
2607+
"properties": {
2608+
"env": {
2609+
"type": "string",
2610+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
2611+
}
2612+
},
2613+
"required": [
2614+
"env"
2615+
],
2616+
"additionalProperties": false
2617+
}
2618+
]
2619+
}
2620+
]
2621+
}
2622+
},
2623+
"additionalProperties": false
25362624
}
25372625
},
25382626
"required": [

docs/snippets/schemas/v3/shared.schema.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,50 @@
118118
}
119119
},
120120
"additionalProperties": false
121+
},
122+
"LanguageModelQueryParams": {
123+
"type": "object",
124+
"description": "Optional query parameters to include in the request url.",
125+
"patternProperties": {
126+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
127+
"anyOf": [
128+
{
129+
"type": "string"
130+
},
131+
{
132+
"anyOf": [
133+
{
134+
"type": "object",
135+
"properties": {
136+
"secret": {
137+
"type": "string",
138+
"description": "The name of the secret that contains the token."
139+
}
140+
},
141+
"required": [
142+
"secret"
143+
],
144+
"additionalProperties": false
145+
},
146+
{
147+
"type": "object",
148+
"properties": {
149+
"env": {
150+
"type": "string",
151+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
152+
}
153+
},
154+
"required": [
155+
"env"
156+
],
157+
"additionalProperties": false
158+
}
159+
]
160+
}
161+
]
162+
}
163+
},
164+
"additionalProperties": false
121165
}
122166
}
123167
}

packages/schemas/src/v3/index.schema.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,6 +2360,50 @@ const schema = {
23602360
}
23612361
},
23622362
"additionalProperties": false
2363+
},
2364+
"queryParams": {
2365+
"type": "object",
2366+
"description": "Optional query parameters to include in the request url.",
2367+
"patternProperties": {
2368+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
2369+
"anyOf": [
2370+
{
2371+
"type": "string"
2372+
},
2373+
{
2374+
"anyOf": [
2375+
{
2376+
"type": "object",
2377+
"properties": {
2378+
"secret": {
2379+
"type": "string",
2380+
"description": "The name of the secret that contains the token."
2381+
}
2382+
},
2383+
"required": [
2384+
"secret"
2385+
],
2386+
"additionalProperties": false
2387+
},
2388+
{
2389+
"type": "object",
2390+
"properties": {
2391+
"env": {
2392+
"type": "string",
2393+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
2394+
}
2395+
},
2396+
"required": [
2397+
"env"
2398+
],
2399+
"additionalProperties": false
2400+
}
2401+
]
2402+
}
2403+
]
2404+
}
2405+
},
2406+
"additionalProperties": false
23632407
}
23642408
},
23652409
"required": [
@@ -3735,6 +3779,50 @@ const schema = {
37353779
}
37363780
},
37373781
"additionalProperties": false
3782+
},
3783+
"queryParams": {
3784+
"type": "object",
3785+
"description": "Optional query parameters to include in the request url.",
3786+
"patternProperties": {
3787+
"^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$": {
3788+
"anyOf": [
3789+
{
3790+
"type": "string"
3791+
},
3792+
{
3793+
"anyOf": [
3794+
{
3795+
"type": "object",
3796+
"properties": {
3797+
"secret": {
3798+
"type": "string",
3799+
"description": "The name of the secret that contains the token."
3800+
}
3801+
},
3802+
"required": [
3803+
"secret"
3804+
],
3805+
"additionalProperties": false
3806+
},
3807+
{
3808+
"type": "object",
3809+
"properties": {
3810+
"env": {
3811+
"type": "string",
3812+
"description": "The name of the environment variable that contains the token. Only supported in declarative connection configs."
3813+
}
3814+
},
3815+
"required": [
3816+
"env"
3817+
],
3818+
"additionalProperties": false
3819+
}
3820+
]
3821+
}
3822+
]
3823+
}
3824+
},
3825+
"additionalProperties": false
37383826
}
37393827
},
37403828
"required": [

0 commit comments

Comments
 (0)