Skip to content

Commit c287994

Browse files
committed
fix
1 parent 652e302 commit c287994

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changeset/easy-rivers-build.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@openai/agents-realtime': patch
3+
'@openai/agents-core': patch
4+
---
5+
6+
feat: Fix #412 add optional details data to function tool execution

packages/agents-core/src/tool.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export type FunctionTool<
6868
invoke: (
6969
runContext: RunContext<Context>,
7070
input: string,
71-
details: { toolCall: protocol.FunctionCallItem },
71+
details?: { toolCall: protocol.FunctionCallItem },
7272
) => Promise<string | Result>;
7373

7474
/**
@@ -594,7 +594,7 @@ export function tool<
594594
async function _invoke(
595595
runContext: RunContext<Context>,
596596
input: string,
597-
details: { toolCall: protocol.FunctionCallItem },
597+
details?: { toolCall: protocol.FunctionCallItem },
598598
): Promise<Result> {
599599
const [error, parsed] = await safeExecute(() => parser(input));
600600
if (error !== null) {
@@ -627,7 +627,7 @@ export function tool<
627627
async function invoke(
628628
runContext: RunContext<Context>,
629629
input: string,
630-
details: { toolCall: protocol.FunctionCallItem },
630+
details?: { toolCall: protocol.FunctionCallItem },
631631
): Promise<string | Result> {
632632
return _invoke(runContext, input, details).catch<string>((error) => {
633633
if (toolErrorFunction) {

0 commit comments

Comments
 (0)