Tools¶
LLM tool factories that expose TAC Memory and Knowledge to each connector.
Agent Framework tools¶
tac_microsoft.agent_framework_tools ¶
TAC tools for the Agent Framework connector.
Each factory returns a plain async callable that Agent Framework auto-discovers from function name, docstring, and type annotations.
Usage::
from tac_microsoft.agent_framework_tools import (
create_memory_tool,
create_knowledge_tool,
)
tools = [
create_memory_tool(tac, session),
await create_knowledge_tool(tac, kb_id),
]
agent = client.as_agent(name="Agent", tools=[t for t in tools if t])
KnowledgeBaseInfo
dataclass
¶
KnowledgeBaseInfo(name: str, description: str)
Metadata fetched from a knowledge base.
fetch_knowledge_base_info
async
¶
fetch_knowledge_base_info(
tac: TAC, knowledge_base_id: str
) -> KnowledgeBaseInfo
Fetch name and description from a knowledge base.
Useful when you want the LLM tool name/description to match the knowledge base configuration without hardcoding them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tac
|
TAC
|
TAC instance. |
required |
knowledge_base_id
|
str
|
The knowledge base ID
(format: |
required |
Returns:
| Type | Description |
|---|---|
KnowledgeBaseInfo
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
create_memory_tool ¶
create_memory_tool(
tac: TAC,
session: ConversationSession,
*,
name: str | None = None,
description: str | None = None,
) -> Any | None
Create a memory tool for Agent Framework.
Returns a plain async function, or None if prerequisites are
not met (no memory client or profile_id).
create_knowledge_tool
async
¶
create_knowledge_tool(
tac: TAC,
knowledge_base_id: str,
*,
name: str | None = None,
description: str | None = None,
top_k: int = 5,
) -> Any
Create a knowledge base search tool for Agent Framework.
If name or description is omitted, fetches the knowledge base
metadata to derive defaults. Returns a plain async function.
create_handoff_tool ¶
create_handoff_tool(
tac: TAC,
session: ConversationSession,
attributes: dict[str, Any] | None = None,
) -> Any
Create a Studio handoff tool for Agent Framework.
Returns a plain async function. Requires
tac.config.studio_handoff_flow_sid to be set.
interstitial_filler
async
¶
interstitial_filler(
filler_words: str,
) -> AsyncGenerator[dict[str, Any], None]
Provide a short, conversational filler sentence to fill dead air latency.
Use this tool to speak brief filler words while waiting for other tool results to keep the conversation flowing naturally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filler_words
|
str
|
The creative, context-aware filler sentence to speak while waiting for tool results. |
required |
Voice Live tools¶
tac_microsoft.voice_live_tools ¶
TAC tools for the Voice Live connector.
Each factory returns a TACTool instance that can be passed directly
to :class:VoiceLiveConfig — no conversion step needed.
Usage::
from tac_microsoft.voice_live_tools import (
create_memory_tool,
create_knowledge_tool,
)
tools = [
create_memory_tool(tac, session),
await create_knowledge_tool(tac, kb_id),
my_custom_tac_tool, # TACTool from @function_tool
]
config = VoiceLiveConfig(..., tools=[t for t in tools if t])
KnowledgeBaseInfo
dataclass
¶
KnowledgeBaseInfo(name: str, description: str)
Metadata fetched from a knowledge base.
fetch_knowledge_base_info
async
¶
fetch_knowledge_base_info(
tac: TAC, knowledge_base_id: str
) -> KnowledgeBaseInfo
Fetch name and description from a knowledge base.
Useful when you want the LLM tool name/description to match the knowledge base configuration without hardcoding them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tac
|
TAC
|
TAC instance. |
required |
knowledge_base_id
|
str
|
The knowledge base ID
(format: |
required |
Returns:
| Type | Description |
|---|---|
KnowledgeBaseInfo
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
create_memory_tool ¶
create_memory_tool(
tac: TAC,
session: ConversationSession,
*,
name: str | None = None,
description: str | None = None,
) -> TACTool | None
Create a memory TACTool for Voice Live.
Returns None if prerequisites are not met.
create_knowledge_tool
async
¶
create_knowledge_tool(
tac: TAC,
knowledge_base_id: str,
*,
name: str | None = None,
description: str | None = None,
top_k: int = 5,
) -> TACTool
Create a knowledge base search TACTool for Voice Live.
If name or description is omitted, fetches the knowledge base
metadata to derive defaults.
create_handoff_tool ¶
create_handoff_tool(
tac: TAC,
session: ConversationSession,
attributes: dict[str, Any] | None = None,
) -> TACTool
Create a Studio handoff TACTool for Voice Live.
Requires tac.config.studio_handoff_flow_sid to be set.