Skip to content

Commit f64f183

Browse files
committed
update with correct type
1 parent 3738ed2 commit f64f183

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/core/src/utils/openai/streaming.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ interface StreamingState {
5353
* Accumulated function calls from Responses API streaming.
5454
* @see https://platform.openai.com/docs/guides/function-calling?api-mode=responses#streaming
5555
*/
56-
responsesApiFunctionCalls: Array<ResponseFunctionCall | unknown>;
56+
responsesApiToolCalls: Array<ResponseFunctionCall | unknown>;
5757
}
5858

5959
/**
@@ -167,9 +167,9 @@ function processResponsesApiEvent(
167167

168168
// Handle output text delta
169169
if (recordOutputs) {
170-
// Handle function call events for Responses API
170+
// Handle tool call events for Responses API
171171
if (event.type === 'response.output_item.done' && 'item' in event) {
172-
state.responsesApiFunctionCalls.push(event.item as ResponseFunctionCall | unknown);
172+
state.responsesApiToolCalls.push(event.item as ResponseFunctionCall | unknown);
173173
}
174174

175175
if (event.type === 'response.output_text.delta' && 'delta' in event && event.delta) {
@@ -231,7 +231,7 @@ export async function* instrumentStream<T>(
231231
completionTokens: undefined,
232232
totalTokens: undefined,
233233
chatCompletionToolCalls: {},
234-
responsesApiFunctionCalls: [],
234+
responsesApiToolCalls: [],
235235
};
236236

237237
try {
@@ -265,7 +265,7 @@ export async function* instrumentStream<T>(
265265

266266
// Set tool calls attribute if any were accumulated
267267
const chatCompletionToolCallsArray = Object.values(state.chatCompletionToolCalls);
268-
const allToolCalls = [...chatCompletionToolCallsArray, ...state.responsesApiFunctionCalls];
268+
const allToolCalls = [...chatCompletionToolCallsArray, ...state.responsesApiToolCalls];
269269

270270
if (allToolCalls.length > 0) {
271271
span.setAttributes({

0 commit comments

Comments
 (0)