first commit
This commit is contained in:
10
agent_dhal/agentdhal_extensions/agents/azure/__init__.py
Normal file
10
agent_dhal/agentdhal_extensions/agents/azure/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
try:
|
||||
from ._azure_ai_agent import AzureAIAgent
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"Dependencies for AzureAIAgent not found. "
|
||||
'Please install autogen-ext with the "azure" extra: '
|
||||
'pip install "agentdhal-ext[azure]"'
|
||||
) from e
|
||||
|
||||
__all__ = ["AzureAIAgent"]
|
||||
1096
agent_dhal/agentdhal_extensions/agents/azure/_azure_ai_agent.py
Normal file
1096
agent_dhal/agentdhal_extensions/agents/azure/_azure_ai_agent.py
Normal file
File diff suppressed because it is too large
Load Diff
61
agent_dhal/agentdhal_extensions/agents/azure/_types.py
Normal file
61
agent_dhal/agentdhal_extensions/agents/azure/_types.py
Normal file
@@ -0,0 +1,61 @@
|
||||
from typing import Any, Awaitable, Callable, Iterable, List, Literal, Optional, TypeGuard, Union
|
||||
|
||||
from agentdhal_core.tools import Tool
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from azure.ai.agents.models import (
|
||||
AzureAISearchToolDefinition,
|
||||
AzureFunctionToolDefinition,
|
||||
BingGroundingToolDefinition,
|
||||
CodeInterpreterToolDefinition,
|
||||
FileSearchToolDefinition,
|
||||
MessageTextUrlCitationAnnotation,
|
||||
)
|
||||
|
||||
ListToolType = Iterable[
|
||||
Union[
|
||||
Literal[
|
||||
"file_search",
|
||||
"code_interpreter",
|
||||
"bing_grounding",
|
||||
"azure_ai_search",
|
||||
"azure_function",
|
||||
],
|
||||
BingGroundingToolDefinition,
|
||||
CodeInterpreterToolDefinition,
|
||||
AzureAISearchToolDefinition,
|
||||
FileSearchToolDefinition,
|
||||
AzureFunctionToolDefinition,
|
||||
Tool,
|
||||
Callable[..., Any],
|
||||
Callable[..., Awaitable[Any]],
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
class AzureAIAgentState(BaseModel):
|
||||
"""
|
||||
Represents the state of an AzureAIAgent that can be saved and loaded.
|
||||
|
||||
This state model keeps track of persistent information about an agent session
|
||||
including agent and thread identifiers, message history, and associated resources.
|
||||
|
||||
Attributes:
|
||||
type (str): The type identifier for the state object, always "AzureAIAgentState"
|
||||
agent_id (Optional[str]): The ID of the Azure AI agent
|
||||
thread_id (Optional[str]): The ID of the conversation thread
|
||||
initial_message_ids (List[str]): List of message IDs from the initial state
|
||||
vector_store_id (Optional[str]): The ID of the associated vector store for file search
|
||||
uploaded_file_ids (List[str]): List of IDs for files uploaded to the agent
|
||||
"""
|
||||
|
||||
type: str = Field(default="AzureAIAgentState")
|
||||
agent_id: Optional[str] = None
|
||||
thread_id: Optional[str] = None
|
||||
initial_message_ids: List[str] = Field(default_factory=list)
|
||||
vector_store_id: Optional[str] = None
|
||||
uploaded_file_ids: List[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
def has_annotations(obj: Any) -> TypeGuard[list[MessageTextUrlCitationAnnotation]]:
|
||||
return obj is not None and isinstance(obj, list)
|
||||
Reference in New Issue
Block a user