Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/export-anon-function-tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/agents': patch
---

Export the `AnonFunctionTool` type so callers can annotate return types for name-less `tool()` factories used in object-map tool registration.
1 change: 1 addition & 0 deletions agents/src/llm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export {
Toolset,
toToolContext,
type AgentHandoff,
type AnonFunctionTool,
type DuplicateMode,
type FunctionTool,
type Tool,
Expand Down
4 changes: 4 additions & 0 deletions agents/src/llm/tool_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ export interface FunctionTool<
[FUNCTION_TOOL_SYMBOL]: true;
}

/**
* A function tool without `id`/`name`. Returned by {@link tool} when `name` is omitted; the
* containing object key supplies the name when registered via an object-map tool definition.
*/
export type AnonFunctionTool<
Parameters extends JSONObject = JSONObject,
UserData = UnknownUserData,
Expand Down
Loading