Source code for langchain_azure_ai.agents.prebuilt.tools
"""Azure AI Foundry Agent Service Tools."""
from typing import Any, List
from azure.ai.agents.models import (
FunctionToolDefinition,
Tool,
ToolResources,
)
from pydantic import BaseModel, ConfigDict
class _OpenAIFunctionTool(Tool[FunctionToolDefinition]):
"""A tool that wraps OpenAI function definitions."""
def __init__(self, definitions: List[FunctionToolDefinition]):
"""Initialize the OpenAIFunctionTool with function definitions.
Args:
definitions: A list of function definitions to be used by the tool.
"""
self._definitions = definitions
@property
def definitions(self) -> List[FunctionToolDefinition]:
"""Get the function definitions.
Returns:
A list of function definitions.
"""
return self._definitions
@property
def resources(self) -> ToolResources:
"""Get the tool resources for the agent.
Returns:
The tool resources.
"""
return ToolResources()
def execute(self, tool_call: Any) -> Any:
"""Execute the tool with the provided tool call.
:param Any tool_call: The tool call to execute.
:return: The output of the tool operations.
"""
pass