mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Clean up imports (#2318)
* chore: tidy imports * Update python/packages/azurefunctions/agent_framework_azurefunctions/_errors.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update python/packages/azurefunctions/agent_framework_azurefunctions/_callbacks.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: revert stub file change * chore: trigger pre-commit hook, re-add `annotations` import --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
b3e96b80ae
commit
79bb87061b
@@ -16,7 +16,7 @@ pip install agent-framework-ag-ui
|
||||
from fastapi import FastAPI
|
||||
from agent_framework import ChatAgent
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
|
||||
|
||||
# Create your agent
|
||||
agent = ChatAgent(
|
||||
@@ -41,7 +41,7 @@ add_agent_framework_fastapi_endpoint(app, agent, "/")
|
||||
```python
|
||||
import asyncio
|
||||
from agent_framework import TextContent
|
||||
from agent_framework_ag_ui import AGUIChatClient
|
||||
from agent_framework.ag_ui import AGUIChatClient
|
||||
|
||||
async def main():
|
||||
async with AGUIChatClient(endpoint="http://localhost:8000/") as client:
|
||||
|
||||
@@ -18,7 +18,7 @@ All example agents are factory functions that accept any `ChatClientProtocol`-co
|
||||
from fastapi import FastAPI
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework_ag_ui_examples.agents import simple_agent, weather_agent
|
||||
|
||||
app = FastAPI()
|
||||
@@ -40,7 +40,7 @@ add_agent_framework_fastapi_endpoint(app, weather_agent(openai_client), "/weathe
|
||||
from fastapi import FastAPI
|
||||
from agent_framework import ChatAgent
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
|
||||
|
||||
# Create your agent
|
||||
agent = ChatAgent(
|
||||
@@ -136,7 +136,7 @@ The server exposes endpoints at:
|
||||
```python
|
||||
from fastapi import FastAPI
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework_ag_ui_examples.agents import (
|
||||
simple_agent,
|
||||
weather_agent,
|
||||
@@ -188,8 +188,8 @@ You can create your own agent factories following the same pattern as the exampl
|
||||
|
||||
```python
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework import ChatClientProtocol
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
@ai_function
|
||||
def my_tool(param: str) -> str:
|
||||
|
||||
+2
-4
@@ -2,10 +2,8 @@
|
||||
|
||||
"""Example agent demonstrating predictive state updates with document writing."""
|
||||
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent, DocumentWriterConfirmationStrategy
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent, DocumentWriterConfirmationStrategy
|
||||
|
||||
|
||||
@ai_function
|
||||
|
||||
+1
-2
@@ -4,8 +4,7 @@
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent, RecipeConfirmationStrategy
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent, RecipeConfirmationStrategy
|
||||
|
||||
|
||||
class SkillLevel(str, Enum):
|
||||
"""The skill level required for the recipe."""
|
||||
|
||||
+2
-4
@@ -4,10 +4,8 @@
|
||||
|
||||
import asyncio
|
||||
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
|
||||
@ai_function
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
"""Simple agentic chat example (Feature 1: Agentic Chat)."""
|
||||
|
||||
from agent_framework import ChatAgent
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatAgent, ChatClientProtocol
|
||||
|
||||
|
||||
def simple_agent(chat_client: ChatClientProtocol) -> ChatAgent:
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
"""Example agent demonstrating human-in-the-loop with function approvals."""
|
||||
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent, TaskPlannerConfirmationStrategy
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent, TaskPlannerConfirmationStrategy
|
||||
|
||||
|
||||
@ai_function(approval_mode="always_require")
|
||||
|
||||
@@ -18,12 +18,10 @@ from ag_ui.core import (
|
||||
TextMessageStartEvent,
|
||||
ToolCallStartEvent,
|
||||
)
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
|
||||
|
||||
class StepStatus(str, Enum):
|
||||
"""Status of a task step."""
|
||||
|
||||
@@ -4,10 +4,8 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from agent_framework import AIFunction, ChatAgent
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework import AIFunction, ChatAgent, ChatClientProtocol
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
# Declaration-only tools (func=None) - actual rendering happens on the client side
|
||||
generate_haiku = AIFunction[Any, str](
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
|
||||
from typing import Any
|
||||
|
||||
from agent_framework import ChatAgent, ai_function
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatAgent, ChatClientProtocol, ai_function
|
||||
|
||||
|
||||
@ai_function
|
||||
|
||||
+1
-2
@@ -2,11 +2,10 @@
|
||||
|
||||
"""Backend tool rendering endpoint."""
|
||||
|
||||
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from fastapi import FastAPI
|
||||
|
||||
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
|
||||
|
||||
from ...agents.weather_agent import weather_agent
|
||||
|
||||
|
||||
|
||||
@@ -6,12 +6,11 @@ import logging
|
||||
import os
|
||||
|
||||
import uvicorn
|
||||
from agent_framework.ag_ui import add_agent_framework_fastapi_endpoint
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from agent_framework_ag_ui import add_agent_framework_fastapi_endpoint
|
||||
|
||||
from ..agents.document_writer_agent import document_writer_agent
|
||||
from ..agents.human_in_the_loop_agent import human_in_the_loop_agent
|
||||
from ..agents.recipe_agent import recipe_agent
|
||||
|
||||
@@ -10,7 +10,7 @@ standard chat interface.
|
||||
import asyncio
|
||||
import os
|
||||
|
||||
from agent_framework_ag_ui import AGUIChatClient
|
||||
from agent_framework.ag_ui import AGUIChatClient
|
||||
|
||||
|
||||
async def main():
|
||||
|
||||
@@ -13,8 +13,7 @@ import asyncio
|
||||
import os
|
||||
|
||||
from agent_framework import ai_function
|
||||
|
||||
from agent_framework_ag_ui import AGUIChatClient
|
||||
from agent_framework.ag_ui import AGUIChatClient
|
||||
|
||||
|
||||
@ai_function
|
||||
|
||||
@@ -23,8 +23,7 @@ import logging
|
||||
import os
|
||||
|
||||
from agent_framework import ChatAgent, FunctionCallContent, FunctionResultContent, TextContent, ai_function
|
||||
|
||||
from agent_framework_ag_ui import AGUIChatClient
|
||||
from agent_framework.ag_ui import AGUIChatClient
|
||||
|
||||
# Enable debug logging
|
||||
logging.basicConfig(
|
||||
|
||||
@@ -11,7 +11,7 @@ from agent_framework._types import ChatResponseUpdate
|
||||
|
||||
async def test_agent_initialization_basic():
|
||||
"""Test basic agent initialization without state schema."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -28,7 +28,7 @@ async def test_agent_initialization_basic():
|
||||
|
||||
async def test_agent_initialization_with_state_schema():
|
||||
"""Test agent initialization with state_schema."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -43,7 +43,7 @@ async def test_agent_initialization_with_state_schema():
|
||||
|
||||
async def test_agent_initialization_with_predict_state_config():
|
||||
"""Test agent initialization with predict_state_config."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -58,7 +58,7 @@ async def test_agent_initialization_with_predict_state_config():
|
||||
|
||||
async def test_run_started_event_emission():
|
||||
"""Test RunStartedEvent is emitted at start of run."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -81,7 +81,7 @@ async def test_run_started_event_emission():
|
||||
|
||||
async def test_predict_state_custom_event_emission():
|
||||
"""Test PredictState CustomEvent is emitted when predict_state_config is present."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -112,7 +112,7 @@ async def test_predict_state_custom_event_emission():
|
||||
|
||||
async def test_initial_state_snapshot_with_schema():
|
||||
"""Test initial StateSnapshotEvent emission when state_schema present."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -141,7 +141,7 @@ async def test_initial_state_snapshot_with_schema():
|
||||
|
||||
async def test_state_initialization_object_type():
|
||||
"""Test state initialization with object type in schema."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -167,7 +167,7 @@ async def test_state_initialization_object_type():
|
||||
|
||||
async def test_state_initialization_array_type():
|
||||
"""Test state initialization with array type in schema."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -193,7 +193,7 @@ async def test_state_initialization_array_type():
|
||||
|
||||
async def test_run_finished_event_emission():
|
||||
"""Test RunFinishedEvent is emitted at end of run."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -214,7 +214,7 @@ async def test_run_finished_event_emission():
|
||||
|
||||
async def test_tool_result_confirm_changes_accepted():
|
||||
"""Test confirm_changes tool result handling when accepted."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -260,7 +260,7 @@ async def test_tool_result_confirm_changes_accepted():
|
||||
|
||||
async def test_tool_result_confirm_changes_rejected():
|
||||
"""Test confirm_changes tool result handling when rejected."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -293,7 +293,7 @@ async def test_tool_result_confirm_changes_rejected():
|
||||
|
||||
async def test_tool_result_function_approval_accepted():
|
||||
"""Test function approval tool result when steps are accepted."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -338,7 +338,7 @@ async def test_tool_result_function_approval_accepted():
|
||||
|
||||
async def test_tool_result_function_approval_rejected():
|
||||
"""Test function approval tool result when rejected."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -374,7 +374,7 @@ async def test_tool_result_function_approval_rejected():
|
||||
|
||||
async def test_thread_metadata_tracking():
|
||||
"""Test that thread metadata includes ag_ui_thread_id and ag_ui_run_id."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
thread_metadata = {}
|
||||
|
||||
@@ -405,7 +405,7 @@ async def test_thread_metadata_tracking():
|
||||
|
||||
async def test_state_context_injection():
|
||||
"""Test that current state is injected into thread metadata."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
thread_metadata = {}
|
||||
|
||||
@@ -436,7 +436,7 @@ async def test_state_context_injection():
|
||||
|
||||
async def test_no_messages_provided():
|
||||
"""Test handling when no messages are provided."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -459,7 +459,7 @@ async def test_no_messages_provided():
|
||||
|
||||
async def test_message_end_event_emission():
|
||||
"""Test TextMessageEndEvent is emitted for assistant messages."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -486,7 +486,7 @@ async def test_message_end_event_emission():
|
||||
|
||||
async def test_error_handling_with_exception():
|
||||
"""Test that exceptions during agent execution are re-raised."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class FailingChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -506,7 +506,7 @@ async def test_error_handling_with_exception():
|
||||
|
||||
async def test_json_decode_error_in_tool_result():
|
||||
"""Test handling of orphaned tool result - should be sanitized out."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -543,7 +543,7 @@ async def test_json_decode_error_in_tool_result():
|
||||
|
||||
async def test_suppressed_summary_with_document_state():
|
||||
"""Test suppressed summary uses document state for confirmation message."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent, DocumentWriterConfirmationStrategy
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent, DocumentWriterConfirmationStrategy
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
|
||||
@@ -32,7 +32,7 @@ class GenericOutput(BaseModel):
|
||||
|
||||
async def test_structured_output_with_recipe():
|
||||
"""Test structured output processing with recipe state."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -70,7 +70,7 @@ async def test_structured_output_with_recipe():
|
||||
|
||||
async def test_structured_output_with_steps():
|
||||
"""Test structured output processing with steps state."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -109,7 +109,7 @@ async def test_structured_output_with_steps():
|
||||
|
||||
async def test_structured_output_with_no_schema_match():
|
||||
"""Test structured output when response fields don't match state_schema keys."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -138,7 +138,7 @@ async def test_structured_output_with_no_schema_match():
|
||||
|
||||
async def test_structured_output_without_schema():
|
||||
"""Test structured output without state_schema treats all fields as state."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class DataOutput(BaseModel):
|
||||
"""Output with data and info fields."""
|
||||
@@ -175,7 +175,7 @@ async def test_structured_output_without_schema():
|
||||
|
||||
async def test_no_structured_output_when_no_response_format():
|
||||
"""Test that structured output path is skipped when no response_format."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -200,7 +200,7 @@ async def test_no_structured_output_when_no_response_format():
|
||||
|
||||
async def test_structured_output_with_message_field():
|
||||
"""Test structured output that includes a message field."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
@@ -234,7 +234,7 @@ async def test_structured_output_with_message_field():
|
||||
|
||||
async def test_empty_updates_no_structured_processing():
|
||||
"""Test that empty updates don't trigger structured output processing."""
|
||||
from agent_framework_ag_ui import AgentFrameworkAgent
|
||||
from agent_framework.ag_ui import AgentFrameworkAgent
|
||||
|
||||
class MockChatClient:
|
||||
async def get_streaming_response(self, messages, chat_options, **kwargs):
|
||||
|
||||
@@ -6,8 +6,6 @@ This module enables callers of AgentFunctionApp to supply streaming and final-re
|
||||
invoked during durable entity execution.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
"""Custom exception types for the durable agent framework."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
class IncomingRequestError(ValueError):
|
||||
"""Raised when an incoming HTTP request cannot be parsed or validated."""
|
||||
|
||||
@@ -1021,7 +1021,7 @@ def use_observability(
|
||||
.. code-block:: python
|
||||
|
||||
from agent_framework import use_observability, setup_observability
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatClientProtocol
|
||||
|
||||
|
||||
# Decorate a custom chat client class
|
||||
|
||||
@@ -1693,7 +1693,7 @@ def mock_function() -> AIFunction[Any, Any]:
|
||||
@pytest.fixture
|
||||
def mock_chat_client() -> Any:
|
||||
"""Mock chat client for testing."""
|
||||
from agent_framework._clients import ChatClientProtocol
|
||||
from agent_framework import ChatClientProtocol
|
||||
|
||||
client = MagicMock(spec=ChatClientProtocol)
|
||||
client.service_url = MagicMock(return_value="mock://test")
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
"""Agent Framework entity discovery implementation."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
import importlib
|
||||
import importlib.util
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
"""Discovery API models for entity information."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
"""Cache provider for Purview data."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import heapq
|
||||
import json
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
from __future__ import annotations
|
||||
|
||||
import base64
|
||||
import inspect
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
"""Purview specific exceptions (minimal error shaping)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from agent_framework.exceptions import ServiceResponseException
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Awaitable, Callable
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import uuid
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from agent_framework._pydantic import AFBaseSettings
|
||||
|
||||
@@ -250,7 +250,7 @@ class WeatherChatKitServer(ChatKitServer[dict[str, Any]]):
|
||||
context: The context dictionary.
|
||||
"""
|
||||
logger.info(f"Attempting to update thread title for thread: {thread.id}")
|
||||
|
||||
|
||||
if not thread_items:
|
||||
logger.debug("No thread items available for title generation")
|
||||
return
|
||||
|
||||
@@ -33,7 +33,7 @@ async def non_streaming_example() -> None:
|
||||
print("=== Non-streaming Response Example ===")
|
||||
|
||||
agent = OpenAIChatClient(
|
||||
api_key="ollama", # Just a placeholder, Ollama doesn't require API key
|
||||
api_key="ollama", # Just a placeholder, Ollama doesn't require API key
|
||||
base_url=os.getenv("OLLAMA_ENDPOINT"),
|
||||
model_id=os.getenv("OLLAMA_MODEL"),
|
||||
).create_agent(
|
||||
@@ -53,7 +53,7 @@ async def streaming_example() -> None:
|
||||
print("=== Streaming Response Example ===")
|
||||
|
||||
agent = OpenAIChatClient(
|
||||
api_key="ollama", # Just a placeholder, Ollama doesn't require API key
|
||||
api_key="ollama", # Just a placeholder, Ollama doesn't require API key
|
||||
base_url=os.getenv("OLLAMA_ENDPOINT"),
|
||||
model_id=os.getenv("OLLAMA_MODEL"),
|
||||
).create_agent(
|
||||
|
||||
@@ -10,6 +10,8 @@ from typing import Any
|
||||
|
||||
from agent_framework.azure import AgentFunctionApp, AzureOpenAIChatClient
|
||||
from azure.identity import AzureCliCredential
|
||||
|
||||
|
||||
# 1. Instantiate the agent with the chosen deployment and instructions.
|
||||
def _create_agent() -> Any:
|
||||
"""Create the Joker agent."""
|
||||
|
||||
+1
@@ -40,6 +40,7 @@ class EmailPayload(BaseModel):
|
||||
email_id: str
|
||||
email_content: str
|
||||
|
||||
|
||||
# 2. Instantiate both agents so they can be registered with AgentFunctionApp.
|
||||
def _create_agents() -> list[Any]:
|
||||
chat_client = AzureOpenAIChatClient(credential=AzureCliCredential())
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ async def get_orchestration_status(
|
||||
show_history_output=False,
|
||||
show_input=True,
|
||||
)
|
||||
|
||||
|
||||
# Check if status is None or if the instance doesn't exist (runtime_status is None)
|
||||
if status is None or getattr(status, "runtime_status", None) is None:
|
||||
return func.HttpResponse(
|
||||
|
||||
@@ -15,9 +15,9 @@ from agent_framework import (
|
||||
FunctionInvocationContext,
|
||||
Role,
|
||||
TextContent,
|
||||
ai_function,
|
||||
chat_middleware,
|
||||
function_middleware,
|
||||
ai_function
|
||||
)
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from agent_framework_devui import register_cleanup
|
||||
@@ -122,6 +122,7 @@ def get_forecast(
|
||||
|
||||
return f"Weather forecast for {location}:\n" + "\n".join(forecast)
|
||||
|
||||
|
||||
@ai_function(approval_mode="always_require")
|
||||
def send_email(
|
||||
recipient: Annotated[str, "The email address of the recipient."],
|
||||
@@ -131,6 +132,7 @@ def send_email(
|
||||
"""Simulate sending an email."""
|
||||
return f"Email sent to {recipient} with subject '{subject}'."
|
||||
|
||||
|
||||
# Agent instance following Agent Framework conventions
|
||||
agent = ChatAgent(
|
||||
name="AzureWeatherAgent",
|
||||
|
||||
@@ -13,6 +13,7 @@ def create_sample_image() -> str:
|
||||
png_data = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
|
||||
return f"data:image/png;base64,{png_data}"
|
||||
|
||||
|
||||
async def test_image() -> None:
|
||||
"""Test image analysis with Azure OpenAI."""
|
||||
# For authentication, run `az login` command in terminal or replace AzureCliCredential with preferred
|
||||
@@ -37,5 +38,6 @@ async def main() -> None:
|
||||
print("Testing image analysis (supported by Chat Completions API)")
|
||||
await test_image()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
|
||||
@@ -20,7 +20,6 @@ Environment variables:
|
||||
- PURVIEW_CERT_PASSWORD (optional)
|
||||
- PURVIEW_DEFAULT_USER_ID (optional, user ID for Purview evaluation)
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
@@ -28,18 +27,17 @@ from typing import Any
|
||||
|
||||
from agent_framework import AgentRunResponse, ChatAgent, ChatMessage, Role
|
||||
from agent_framework.azure import AzureOpenAIChatClient
|
||||
from agent_framework.microsoft import (
|
||||
PurviewChatPolicyMiddleware,
|
||||
PurviewPolicyMiddleware,
|
||||
PurviewSettings,
|
||||
)
|
||||
from azure.identity import (
|
||||
AzureCliCredential,
|
||||
CertificateCredential,
|
||||
InteractiveBrowserCredential,
|
||||
)
|
||||
|
||||
from agent_framework.microsoft import (
|
||||
PurviewPolicyMiddleware,
|
||||
PurviewChatPolicyMiddleware,
|
||||
PurviewSettings,
|
||||
)
|
||||
|
||||
JOKER_NAME = "Joker"
|
||||
JOKER_INSTRUCTIONS = "You are good at telling jokes. Keep responses concise."
|
||||
|
||||
@@ -96,7 +94,6 @@ class SimpleDictCacheProvider:
|
||||
print(f"[CustomCache] Removed key: {key[:50]}...")
|
||||
|
||||
|
||||
|
||||
def _get_env(name: str, *, required: bool = True, default: str | None = None) -> str:
|
||||
val = os.environ.get(name, default)
|
||||
if required and not val:
|
||||
@@ -176,7 +173,7 @@ async def run_with_chat_middleware() -> None:
|
||||
|
||||
deployment = os.environ.get("AZURE_OPENAI_DEPLOYMENT_NAME", default="gpt-4o-mini")
|
||||
user_id = os.environ.get("PURVIEW_DEFAULT_USER_ID")
|
||||
|
||||
|
||||
chat_client = AzureOpenAIChatClient(
|
||||
deployment_name=deployment,
|
||||
endpoint=endpoint,
|
||||
@@ -216,6 +213,7 @@ async def run_with_chat_middleware() -> None:
|
||||
)
|
||||
print("Second response (chat middleware):\n", second)
|
||||
|
||||
|
||||
async def run_with_custom_cache_provider() -> None:
|
||||
"""Demonstrate implementing and using a custom cache provider."""
|
||||
endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT")
|
||||
@@ -246,7 +244,7 @@ async def run_with_custom_cache_provider() -> None:
|
||||
|
||||
print("-- Custom Cache Provider Path --")
|
||||
print("Using SimpleDictCacheProvider")
|
||||
|
||||
|
||||
first: AgentRunResponse = await agent.run(
|
||||
ChatMessage(role=Role.USER, text="Tell me a joke about a programmer.", additional_properties={"user_id": user_id})
|
||||
)
|
||||
@@ -256,7 +254,7 @@ async def run_with_custom_cache_provider() -> None:
|
||||
ChatMessage(role=Role.USER, text="That's hilarious! One more?", additional_properties={"user_id": user_id})
|
||||
)
|
||||
print("Second response (custom provider):\n", second)
|
||||
|
||||
|
||||
"""Demonstrate using the default built-in cache."""
|
||||
endpoint = os.environ.get("AZURE_OPENAI_ENDPOINT")
|
||||
if not endpoint:
|
||||
@@ -286,7 +284,7 @@ async def run_with_custom_cache_provider() -> None:
|
||||
|
||||
print("-- Default Cache Path --")
|
||||
print("Using default InMemoryCacheProvider with settings-based configuration")
|
||||
|
||||
|
||||
first: AgentRunResponse = await agent.run(
|
||||
ChatMessage(role=Role.USER, text="Tell me a joke about AI.", additional_properties={"user_id": user_id})
|
||||
)
|
||||
@@ -300,7 +298,7 @@ async def run_with_custom_cache_provider() -> None:
|
||||
|
||||
async def main() -> None:
|
||||
print("== Purview Agent Sample (Middleware with Automatic Caching) ==")
|
||||
|
||||
|
||||
try:
|
||||
await run_with_agent_middleware()
|
||||
except Exception as ex: # pragma: no cover - demo resilience
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ async def main() -> None:
|
||||
# Create the AIFunction tool using dependency injection
|
||||
# The 'definition' dictionary contains the serialized tool configuration,
|
||||
# while the actual function implementation is provided via dependencies.
|
||||
#
|
||||
#
|
||||
# Dependency structure: {"ai_function": {"name:add_numbers": {"func": func}}}
|
||||
# - "ai_function": matches the tool type identifier
|
||||
# - "name:add_numbers": instance-specific injection targeting tools with name="add_numbers"
|
||||
|
||||
@@ -45,7 +45,7 @@ async def approval_example() -> None:
|
||||
# Check for approval requests
|
||||
if result.user_input_requests:
|
||||
for request in result.user_input_requests:
|
||||
print(f"\nApproval needed:")
|
||||
print("\nApproval needed:")
|
||||
print(f" Function: {request.function_call.name}")
|
||||
print(f" Arguments: {request.function_call.arguments}")
|
||||
|
||||
@@ -79,12 +79,12 @@ async def rejection_example() -> None:
|
||||
|
||||
if result.user_input_requests:
|
||||
for request in result.user_input_requests:
|
||||
print(f"\nApproval needed:")
|
||||
print("\nApproval needed:")
|
||||
print(f" Function: {request.function_call.name}")
|
||||
print(f" Arguments: {request.function_call.arguments}")
|
||||
|
||||
# User rejects
|
||||
print(f" Decision: Rejected")
|
||||
print(" Decision: Rejected")
|
||||
|
||||
# Send rejection response
|
||||
rejection_response = request.create_response(approved=False)
|
||||
|
||||
+19
-21
@@ -13,32 +13,30 @@ async def run_semantic_kernel() -> None:
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings
|
||||
|
||||
async with AzureCliCredential() as credential:
|
||||
async with AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings() # Reads env vars for region/deployment.
|
||||
# SK builds the remote agent definition then wraps it with AzureAIAgent.
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Support",
|
||||
instructions="Answer customer questions in one paragraph.",
|
||||
)
|
||||
agent = AzureAIAgent(client=client, definition=definition)
|
||||
response = await agent.get_response("How do I upgrade my plan?")
|
||||
print("[SK]", response.message.content)
|
||||
async with AzureCliCredential() as credential, AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings() # Reads env vars for region/deployment.
|
||||
# SK builds the remote agent definition then wraps it with AzureAIAgent.
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Support",
|
||||
instructions="Answer customer questions in one paragraph.",
|
||||
)
|
||||
agent = AzureAIAgent(client=client, definition=definition)
|
||||
response = await agent.get_response("How do I upgrade my plan?")
|
||||
print("[SK]", response.message.content)
|
||||
|
||||
|
||||
async def run_agent_framework() -> None:
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from agent_framework.azure import AzureAIAgentClient
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
|
||||
async with AzureCliCredential() as credential:
|
||||
async with AzureAIAgentClient(async_credential=credential).create_agent(
|
||||
name="Support",
|
||||
instructions="Answer customer questions in one paragraph.",
|
||||
) as agent:
|
||||
# AF client returns an asynchronous context manager for remote agents.
|
||||
reply = await agent.run("How do I upgrade my plan?")
|
||||
print("[AF]", reply.text)
|
||||
async with AzureCliCredential() as credential, AzureAIAgentClient(async_credential=credential).create_agent(
|
||||
name="Support",
|
||||
instructions="Answer customer questions in one paragraph.",
|
||||
) as agent:
|
||||
# AF client returns an asynchronous context manager for remote agents.
|
||||
reply = await agent.run("How do I upgrade my plan?")
|
||||
print("[AF]", reply.text)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
|
||||
+26
-28
@@ -13,39 +13,37 @@ async def run_semantic_kernel() -> None:
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings
|
||||
|
||||
async with AzureCliCredential() as credential:
|
||||
async with AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings()
|
||||
# Register the hosted code interpreter tool with the remote agent.
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Analyst",
|
||||
instructions="Use the code interpreter for numeric work.",
|
||||
tools=[{"type": "code_interpreter"}],
|
||||
)
|
||||
agent = AzureAIAgent(client=client, definition=definition)
|
||||
response = await agent.get_response(
|
||||
"Use Python to compute 42 ** 2 and explain the result.",
|
||||
)
|
||||
print("[SK]", response.message.content)
|
||||
async with AzureCliCredential() as credential, AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings()
|
||||
# Register the hosted code interpreter tool with the remote agent.
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Analyst",
|
||||
instructions="Use the code interpreter for numeric work.",
|
||||
tools=[{"type": "code_interpreter"}],
|
||||
)
|
||||
agent = AzureAIAgent(client=client, definition=definition)
|
||||
response = await agent.get_response(
|
||||
"Use Python to compute 42 ** 2 and explain the result.",
|
||||
)
|
||||
print("[SK]", response.message.content)
|
||||
|
||||
|
||||
async def run_agent_framework() -> None:
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from agent_framework.azure import AzureAIAgentClient, HostedCodeInterpreterTool
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
|
||||
async with AzureCliCredential() as credential:
|
||||
async with AzureAIAgentClient(async_credential=credential).create_agent(
|
||||
name="Analyst",
|
||||
instructions="Use the code interpreter for numeric work.",
|
||||
tools=[HostedCodeInterpreterTool()],
|
||||
) as agent:
|
||||
# HostedCodeInterpreterTool mirrors the built-in Azure AI capability.
|
||||
reply = await agent.run(
|
||||
"Use Python to compute 42 ** 2 and explain the result.",
|
||||
tool_choice="auto",
|
||||
)
|
||||
print("[AF]", reply.text)
|
||||
async with AzureCliCredential() as credential, AzureAIAgentClient(async_credential=credential).create_agent(
|
||||
name="Analyst",
|
||||
instructions="Use the code interpreter for numeric work.",
|
||||
tools=[HostedCodeInterpreterTool()],
|
||||
) as agent:
|
||||
# HostedCodeInterpreterTool mirrors the built-in Azure AI capability.
|
||||
reply = await agent.run(
|
||||
"Use Python to compute 42 ** 2 and explain the result.",
|
||||
tool_choice="auto",
|
||||
)
|
||||
print("[AF]", reply.text)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
|
||||
+36
-38
@@ -8,53 +8,51 @@ async def run_semantic_kernel() -> None:
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from semantic_kernel.agents import AzureAIAgent, AzureAIAgentSettings, AzureAIAgentThread
|
||||
|
||||
async with AzureCliCredential() as credential:
|
||||
async with AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings()
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Planner",
|
||||
instructions="Track follow-up questions within the same thread.",
|
||||
)
|
||||
agent = AzureAIAgent(client=client, definition=definition)
|
||||
async with AzureCliCredential() as credential, AzureAIAgent.create_client(credential=credential) as client:
|
||||
settings = AzureAIAgentSettings()
|
||||
definition = await client.agents.create_agent(
|
||||
model=settings.model_deployment_name,
|
||||
name="Planner",
|
||||
instructions="Track follow-up questions within the same thread.",
|
||||
)
|
||||
agent = AzureAIAgent(client=client, definition=definition)
|
||||
|
||||
thread: AzureAIAgentThread | None = None
|
||||
# SK returns the updated AzureAIAgentThread on each response.
|
||||
first = await agent.get_response("Outline the onboarding checklist.", thread=thread)
|
||||
thread = first.thread
|
||||
print("[SK][turn1]", first.message.content)
|
||||
thread: AzureAIAgentThread | None = None
|
||||
# SK returns the updated AzureAIAgentThread on each response.
|
||||
first = await agent.get_response("Outline the onboarding checklist.", thread=thread)
|
||||
thread = first.thread
|
||||
print("[SK][turn1]", first.message.content)
|
||||
|
||||
second = await agent.get_response(
|
||||
"Highlight the items that require legal review.",
|
||||
thread=thread,
|
||||
)
|
||||
print("[SK][turn2]", second.message.content)
|
||||
if thread is not None:
|
||||
print("[SK][thread-id]", thread.id)
|
||||
second = await agent.get_response(
|
||||
"Highlight the items that require legal review.",
|
||||
thread=thread,
|
||||
)
|
||||
print("[SK][turn2]", second.message.content)
|
||||
if thread is not None:
|
||||
print("[SK][thread-id]", thread.id)
|
||||
|
||||
|
||||
async def run_agent_framework() -> None:
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
from agent_framework.azure import AzureAIAgentClient
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
|
||||
async with AzureCliCredential() as credential:
|
||||
async with AzureAIAgentClient(async_credential=credential).create_agent(
|
||||
name="Planner",
|
||||
instructions="Track follow-up questions within the same thread.",
|
||||
) as agent:
|
||||
thread = agent.get_new_thread()
|
||||
# AF threads are explicit and can be serialized for external storage.
|
||||
first = await agent.run("Outline the onboarding checklist.", thread=thread)
|
||||
print("[AF][turn1]", first.text)
|
||||
async with AzureCliCredential() as credential, AzureAIAgentClient(async_credential=credential).create_agent(
|
||||
name="Planner",
|
||||
instructions="Track follow-up questions within the same thread.",
|
||||
) as agent:
|
||||
thread = agent.get_new_thread()
|
||||
# AF threads are explicit and can be serialized for external storage.
|
||||
first = await agent.run("Outline the onboarding checklist.", thread=thread)
|
||||
print("[AF][turn1]", first.text)
|
||||
|
||||
second = await agent.run(
|
||||
"Highlight the items that require legal review.",
|
||||
thread=thread,
|
||||
)
|
||||
print("[AF][turn2]", second.text)
|
||||
second = await agent.run(
|
||||
"Highlight the items that require legal review.",
|
||||
thread=thread,
|
||||
)
|
||||
print("[AF][turn2]", second.text)
|
||||
|
||||
serialized = await thread.serialize()
|
||||
print("[AF][thread-json]", serialized)
|
||||
serialized = await thread.serialize()
|
||||
print("[AF][thread-json]", serialized)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
|
||||
@@ -7,6 +7,18 @@ from typing import Any
|
||||
|
||||
import pytest
|
||||
from pytest import MonkeyPatch, mark, param
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_function_tools import (
|
||||
mixed_tools_example as azure_ai_with_function_tools_mixed,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_function_tools import (
|
||||
tools_on_agent_level as azure_ai_with_function_tools_agent,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_function_tools import (
|
||||
tools_on_run_level as azure_ai_with_function_tools_run,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_local_mcp import (
|
||||
main as azure_ai_with_local_mcp,
|
||||
)
|
||||
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_basic import (
|
||||
main as azure_ai_basic,
|
||||
@@ -20,18 +32,6 @@ from samples.getting_started.agents.azure_ai.azure_ai_with_existing_agent import
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_explicit_settings import (
|
||||
main as azure_ai_with_explicit_settings,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_function_tools import (
|
||||
mixed_tools_example as azure_ai_with_function_tools_mixed,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_function_tools import (
|
||||
tools_on_agent_level as azure_ai_with_function_tools_agent,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_function_tools import (
|
||||
tools_on_run_level as azure_ai_with_function_tools_run,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_local_mcp import (
|
||||
main as azure_ai_with_local_mcp,
|
||||
)
|
||||
from samples.getting_started.agents.azure_ai.azure_ai_with_thread import (
|
||||
main as azure_ai_with_thread,
|
||||
)
|
||||
|
||||
Generated
+15
-15
@@ -3144,31 +3144,31 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "microsoft-agents-activity"
|
||||
version = "0.5.3"
|
||||
version = "0.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pydantic", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7e/51/2698980f425cda122f5b755a957c3c2db604c0b9a787c6add5aa4649c237/microsoft_agents_activity-0.5.3.tar.gz", hash = "sha256:d80b055591df561df8cebda9e1712012352581a396b36459133a951982b3a760", size = 55892, upload-time = "2025-10-31T15:40:49.332Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/cb/c5/ec0b5786257b88a21245d9485e864088cbdc60442e21b637cc1433f6061b/microsoft_agents_activity-0.6.0.tar.gz", hash = "sha256:9b23a44def700d1d18670e28e2e7e66e8679dfb902dadcd94902d5591cda65a4", size = 57481, upload-time = "2025-11-18T18:12:33.351Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/75/3d/9618243e7b6f1f6295642c4e2dfca65b3a37794efbe1bdec15f0a93827d9/microsoft_agents_activity-0.5.3-py3-none-any.whl", hash = "sha256:5ae2447ac47c32f03c614694f520817cd225c9c502ec08b90d448311fb5bf3b4", size = 127861, upload-time = "2025-10-31T15:40:57.628Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fe/6b/e07cbd310881eda75def2d13220f27648f8c2632b16244536d33069e6bd5/microsoft_agents_activity-0.6.0-py3-none-any.whl", hash = "sha256:bfcd0f55ac332320ca927f829f6fb200acff1bd61fb6aba9945906130fec7d06", size = 131093, upload-time = "2025-11-18T18:12:41.796Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "microsoft-agents-copilotstudio-client"
|
||||
version = "0.5.3"
|
||||
version = "0.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "microsoft-agents-hosting-core", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7e/22/109164fb585c4baee40d2372c5d76254ec4a28219908f11cd27ac92aa6c1/microsoft_agents_copilotstudio_client-0.5.3.tar.gz", hash = "sha256:a57ea6b3cb47dbb5ad22e59c986208ace6479e35da3f644e6346f4dfd85db57c", size = 11161, upload-time = "2025-10-31T15:40:51.444Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/88/23/67833eac41963a7a0110b8fe3b9329c65388ccf50f6b1f694e92e0cb3918/microsoft_agents_copilotstudio_client-0.6.0.tar.gz", hash = "sha256:2964e164cc0175614aa356aaab01fda48153961304f11cdaef2a45710d922805", size = 11756, upload-time = "2025-11-18T18:12:35.842Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/65/984e139c85657ff0c8df0ed98a167c8b9434f4fd4f32862b4a6490b8c714/microsoft_agents_copilotstudio_client-0.5.3-py3-none-any.whl", hash = "sha256:6a36fce5c8c1a2df6f5142e35b12c69be80959ecff6d60cc309661018c40f00a", size = 11091, upload-time = "2025-10-31T15:40:59.718Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/1f/75e8618bed71da736104d5d4c41137fdb28672660e0257d59ea6d6fd4029/microsoft_agents_copilotstudio_client-0.6.0-py3-none-any.whl", hash = "sha256:733affebee8b4e7d204e66ff91e3162d4f498f2944b45a19eec0a8234eea67b5", size = 12340, upload-time = "2025-11-18T18:12:43.572Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "microsoft-agents-hosting-core"
|
||||
version = "0.5.3"
|
||||
version = "0.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "azure-core", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
@@ -3177,9 +3177,9 @@ dependencies = [
|
||||
{ name = "pyjwt", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
{ name = "python-dotenv", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b1/98/7755c07b2ae5faf3e4dc14b17e44680a600c8b840b3003fb326d5720dea1/microsoft_agents_hosting_core-0.5.3.tar.gz", hash = "sha256:b113d4ea5c9e555bbf61037bb2a1a7a3ce7e5e4a7a0f681a3bd4719ba72ff821", size = 81672, upload-time = "2025-10-31T15:40:53.557Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ea/02/893e4a2f789b3c91550e6aefd53a9b88d3bea8f4f15ae1fee141691fb5fb/microsoft_agents_hosting_core-0.6.0.tar.gz", hash = "sha256:0331573dbc2ae8f4339658ed600676c3a4a76ade403b4adc49c4d38afd3fdc36", size = 82802, upload-time = "2025-11-18T18:12:37.518Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/95/57/c9e98475971c9da9cc9ff88195bbfcfae90dba511ebe14610be79f23ab3f/microsoft_agents_hosting_core-0.5.3-py3-none-any.whl", hash = "sha256:8c228a8814dcf1a86dd60e4c7574a2e86078962695fabd693a118097e703e982", size = 120668, upload-time = "2025-10-31T15:41:01.691Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/46/01d12043fc6e31c3cd894ef6d17d4586ea2a0a918c83842e2db5b8728f1c/microsoft_agents_hosting_core-0.6.0-py3-none-any.whl", hash = "sha256:9f07df7835a4c0f527b66e64e57dbfcbd9ec7c6140cc829f6e99f061b4084783", size = 122494, upload-time = "2025-11-18T18:12:45.639Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3662,7 +3662,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "openai-agents"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "griffe", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
@@ -3673,14 +3673,14 @@ dependencies = [
|
||||
{ name = "types-requests", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
{ name = "typing-extensions", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b8/1f/322595f9a7ffd48afe2449bb92090eb893ba6ae4475e3ee549f64566a3a1/openai_agents-0.5.1.tar.gz", hash = "sha256:e193cd3a1b0d4f9a3f3fa9c4011c0b1f8876fa5f38bde4ae41d6a834a5791124", size = 1990900, upload-time = "2025-11-13T17:59:36.173Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f8/83/5004ab65dc5fdcf96c53b5a5f18de774897c70ee661320e366c64768f6ca/openai_agents-0.6.0.tar.gz", hash = "sha256:355d365a93c6d2457f2226ff7e9082db439d7776531d8a8d7635e45c59e3cc9a", size = 2009045, upload-time = "2025-11-18T19:06:55.988Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/10/ca/352a7167ac040f9e7d6765081f4021811914724303d1417525d50942e15e/openai_agents-0.5.1-py3-none-any.whl", hash = "sha256:7077c47d8e4230d788a18922df7cd69f13c3328a57744156195da4921c08c835", size = 231786, upload-time = "2025-11-13T17:59:32.691Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/f4/6418293ef0a1f9e57c261885a86ea2815d5ba385f1b4af5fa48608c1a0c2/openai_agents-0.6.0-py3-none-any.whl", hash = "sha256:a9928e5bea6938141de679ed7f6db9e9595aae05cd9de11b67ed3893a2c1ee07", size = 237412, upload-time = "2025-11-18T19:06:54.162Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "openai-chatkit"
|
||||
version = "1.2.0"
|
||||
version = "1.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "openai", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
@@ -3688,9 +3688,9 @@ dependencies = [
|
||||
{ name = "pydantic", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
{ name = "uvicorn", marker = "sys_platform == 'darwin' or sys_platform == 'linux' or sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/11/e1/c247260aa9b319109e88b9aef69d6497d881b1d8e1b464c502a3173f0482/openai_chatkit-1.2.0.tar.gz", hash = "sha256:4aa8b3ab5f525fd6e4b9e88d6bb6fab7d5a12a5e51e22d0753fa8835f79ce3c5", size = 50160, upload-time = "2025-11-13T20:46:05.775Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/2c/d9/4ceafc66c2cb6da308fdb6277d2d8cd52b5414cb9d45295e379ec7d7f1db/openai_chatkit-1.3.0.tar.gz", hash = "sha256:b09349f149dcc213edc1496a1b8c634689e1c38e17ad5bdba4a4f7962ac6f02e", size = 50130, upload-time = "2025-11-18T18:18:32.663Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/b8/7f8c54db201dc73867ab83cd5781035845cb474dfe8e9760be69c19c337d/openai_chatkit-1.2.0-py3-none-any.whl", hash = "sha256:4a8b40a160cf7c32b48dd813e3977567a124bb851ba27c01098a7cb249b453ec", size = 35577, upload-time = "2025-11-13T20:46:04.17Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/40/ea/c69e12cd2fe38841b39f5157db5851d1a3ac2a33d309d73e98bb8d7cd86b/openai_chatkit-1.3.0-py3-none-any.whl", hash = "sha256:a0c017dfa2ea4447cd2cc818215d16718fa9fa853a972bead2fa8102d4e85076", size = 35576, upload-time = "2025-11-18T18:18:31.285Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in New Issue
Block a user