Skip to content

Commit dfa9d9e

Browse files
committed
fix item id handling in openai responses api
1 parent 1a92d38 commit dfa9d9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/ai/openai/src/OpenAiLanguageModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,10 +1309,10 @@ const getItemId = (
13091309
part:
13101310
| Prompt.TextPart
13111311
| Prompt.ToolCallPart
1312-
): string =>
1312+
): string | undefined =>
13131313
Prompt.getProviderOptions(part, ProviderOptions).pipe(
13141314
Option.flatMapNullable((options) => options.itemId),
1315-
Option.getOrThrow
1315+
Option.getOrUndefined
13161316
)
13171317

13181318
const getImageDetail = (part: Prompt.FilePart): typeof Generated.InputImageContentDetail.Encoded =>

0 commit comments

Comments
 (0)