Skip to content

Commit d00f02e

Browse files
committed
Merge branch 'whoisthey/language-model-input-modalities' into whoisthey/text-file-attachments
2 parents c52e1cf + de291cc commit d00f02e

15 files changed

Lines changed: 322 additions & 2590 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Added per-step token cost tracking and estimated tool call token usage to Ask Sourcebot chat history. [#1353](https://github.com/sourcebot-dev/sourcebot/pull/1353)
1616
- [EE] Added mermaid diagram rendering to Ask Sourcebot answers, with pan/zoom, copy/export, in-thread deep links, and an interleaved right-panel view. [#1369](https://github.com/sourcebot-dev/sourcebot/pull/1369)
1717
- [EE] Added a context-window usage gauge to the Ask Sourcebot chat details, showing how much of the selected model's context window each turn occupies. Window sizes are resolved from the models.dev catalog. [#1370](https://github.com/sourcebot-dev/sourcebot/pull/1370)
18-
- Added optional `inputModalities` and `supportedDocumentTypes` configuration for language models, exposing model input-modality and document capabilities (defaults to text-only, no documents). [#1372](https://github.com/sourcebot-dev/sourcebot/pull/1372)
18+
- Added language model input-modality and document capability resolution, automatically resolved from the models.dev catalog (falls back to text-only for uncatalogued/self-hosted models). [#1372](https://github.com/sourcebot-dev/sourcebot/pull/1372)
1919

2020
### Fixed
2121
- Send anonymous server-side PostHog events as personless so unauthenticated requests don't inflate person counts. [#1367](https://github.com/sourcebot-dev/sourcebot/pull/1367)

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

Lines changed: 0 additions & 504 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 504 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 504 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,6 @@ export interface AmazonBedrockLanguageModel {
762762
*/
763763
temperature?: number;
764764
headers?: LanguageModelHeaders;
765-
/**
766-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
767-
*/
768-
inputModalities?: ("text" | "image" | "audio" | "video")[];
769-
/**
770-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
771-
*/
772-
supportedDocumentTypes?: "pdf"[];
773765
}
774766
/**
775767
* Optional headers to use with the model.
@@ -850,14 +842,6 @@ export interface AnthropicLanguageModel {
850842
*/
851843
temperature?: number;
852844
headers?: LanguageModelHeaders;
853-
/**
854-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
855-
*/
856-
inputModalities?: ("text" | "image" | "audio" | "video")[];
857-
/**
858-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
859-
*/
860-
supportedDocumentTypes?: "pdf"[];
861845
}
862846
export interface AzureLanguageModel {
863847
/**
@@ -913,14 +897,6 @@ export interface AzureLanguageModel {
913897
*/
914898
temperature?: number;
915899
headers?: LanguageModelHeaders;
916-
/**
917-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
918-
*/
919-
inputModalities?: ("text" | "image" | "audio" | "video")[];
920-
/**
921-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
922-
*/
923-
supportedDocumentTypes?: "pdf"[];
924900
}
925901
export interface DeepSeekLanguageModel {
926902
/**
@@ -960,14 +936,6 @@ export interface DeepSeekLanguageModel {
960936
*/
961937
temperature?: number;
962938
headers?: LanguageModelHeaders;
963-
/**
964-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
965-
*/
966-
inputModalities?: ("text" | "image" | "audio" | "video")[];
967-
/**
968-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
969-
*/
970-
supportedDocumentTypes?: "pdf"[];
971939
}
972940
export interface GoogleGenerativeAILanguageModel {
973941
/**
@@ -1015,14 +983,6 @@ export interface GoogleGenerativeAILanguageModel {
1015983
*/
1016984
temperature?: number;
1017985
headers?: LanguageModelHeaders;
1018-
/**
1019-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1020-
*/
1021-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1022-
/**
1023-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1024-
*/
1025-
supportedDocumentTypes?: "pdf"[];
1026986
}
1027987
export interface GoogleVertexAnthropicLanguageModel {
1028988
/**
@@ -1070,14 +1030,6 @@ export interface GoogleVertexAnthropicLanguageModel {
10701030
*/
10711031
temperature?: number;
10721032
headers?: LanguageModelHeaders;
1073-
/**
1074-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1075-
*/
1076-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1077-
/**
1078-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1079-
*/
1080-
supportedDocumentTypes?: "pdf"[];
10811033
}
10821034
export interface GoogleVertexLanguageModel {
10831035
/**
@@ -1133,14 +1085,6 @@ export interface GoogleVertexLanguageModel {
11331085
*/
11341086
temperature?: number;
11351087
headers?: LanguageModelHeaders;
1136-
/**
1137-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1138-
*/
1139-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1140-
/**
1141-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1142-
*/
1143-
supportedDocumentTypes?: "pdf"[];
11441088
}
11451089
export interface MistralLanguageModel {
11461090
/**
@@ -1180,14 +1124,6 @@ export interface MistralLanguageModel {
11801124
*/
11811125
temperature?: number;
11821126
headers?: LanguageModelHeaders;
1183-
/**
1184-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1185-
*/
1186-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1187-
/**
1188-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1189-
*/
1190-
supportedDocumentTypes?: "pdf"[];
11911127
}
11921128
export interface OpenAILanguageModel {
11931129
/**
@@ -1235,14 +1171,6 @@ export interface OpenAILanguageModel {
12351171
*/
12361172
temperature?: number;
12371173
headers?: LanguageModelHeaders;
1238-
/**
1239-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1240-
*/
1241-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1242-
/**
1243-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1244-
*/
1245-
supportedDocumentTypes?: "pdf"[];
12461174
}
12471175
export interface OpenAICompatibleLanguageModel {
12481176
/**
@@ -1287,14 +1215,6 @@ export interface OpenAICompatibleLanguageModel {
12871215
* Optional temperature setting to use with the model.
12881216
*/
12891217
temperature?: number;
1290-
/**
1291-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1292-
*/
1293-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1294-
/**
1295-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1296-
*/
1297-
supportedDocumentTypes?: "pdf"[];
12981218
}
12991219
/**
13001220
* Optional query parameters to include in the request url.
@@ -1359,14 +1279,6 @@ export interface OpenRouterLanguageModel {
13591279
*/
13601280
temperature?: number;
13611281
headers?: LanguageModelHeaders;
1362-
/**
1363-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1364-
*/
1365-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1366-
/**
1367-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1368-
*/
1369-
supportedDocumentTypes?: "pdf"[];
13701282
}
13711283
export interface XaiLanguageModel {
13721284
/**
@@ -1406,14 +1318,6 @@ export interface XaiLanguageModel {
14061318
*/
14071319
temperature?: number;
14081320
headers?: LanguageModelHeaders;
1409-
/**
1410-
* Optional list of input modalities (perceptual channels the model ingests natively) this model can accept. Governs single-medium attachments by their content: images require `image`, audio requires `audio`, video requires `video`, and plain-text files (.txt, .md, source code) count as `text`. Rich container documents like PDF are gated separately via `supportedDocumentTypes`. When omitted, the model is treated as text-only (fail-closed).
1411-
*/
1412-
inputModalities?: ("text" | "image" | "audio" | "video")[];
1413-
/**
1414-
* Optional list of rich document formats (e.g. PDF) the model can ingest natively. A document here means a compound container format that bundles text with embedded images and layout, which the provider parses server-side — NOT plain-text files (.txt, .md, which count as `text`) and NOT single-medium files (images/audio/video, which are governed by `inputModalities`). When omitted, no document formats are accepted (fail-closed); this does not restrict `text` or the modalities declared in `inputModalities`.
1415-
*/
1416-
supportedDocumentTypes?: "pdf"[];
14171321
}
14181322
export interface GitHubAppConfig {
14191323
/**

0 commit comments

Comments
 (0)