Studio: widen doc source parts past SDK SourceMessagePart type
This commit is contained in:
parent
7c1f8efe99
commit
9d5719a475
1 changed files with 8 additions and 1 deletions
|
|
@ -2115,7 +2115,14 @@ export function createOpenAIStreamAdapter(): ChatModelAdapter {
|
|||
)
|
||||
: [];
|
||||
|
||||
const sourceParts = [...urlSourceParts, ...documentSourceParts];
|
||||
// SDK's SourceMessagePart only types `sourceType: "url"` with a
|
||||
// required `url` field. SourcesGroup branches on `sourceType` at
|
||||
// runtime, so cast the doc-shaped parts through `unknown` rather
|
||||
// than weakening the helper's strict typing.
|
||||
const sourceParts = [
|
||||
...urlSourceParts,
|
||||
...(documentSourceParts as unknown as typeof urlSourceParts),
|
||||
];
|
||||
|
||||
const meta = serverMetadata;
|
||||
const finalTokenCount =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue