@ai-sdk/openai 4.0.17 → 4.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "4.0.17",
3
+ "version": "4.0.18",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -581,12 +581,16 @@ export async function convertToOpenAIResponsesInput({
581
581
  );
582
582
 
583
583
  if (resolvedResultToolName === 'tool_search') {
584
- const itemId =
584
+ const itemId = (part.providerOptions?.[providerOptionsName]
585
+ ?.itemId ??
585
586
  (
586
- part.providerOptions?.[providerOptionsName] as
587
- | { itemId?: string }
588
- | undefined
589
- )?.itemId ?? part.toolCallId;
587
+ part as {
588
+ providerMetadata?: {
589
+ [providerOptionsName]?: { itemId?: string };
590
+ };
591
+ }
592
+ ).providerMetadata?.[providerOptionsName]?.itemId ??
593
+ part.toolCallId) as string;
590
594
 
591
595
  if (store) {
592
596
  input.push({ type: 'item_reference', id: itemId });