Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from agent_framework._settings import SecretString, load_settings
from agent_framework._telemetry import get_user_agent
from agent_framework.observability import ChatTelemetryLayer
from anthropic import AsyncAnthropicBedrock
from anthropic.lib.bedrock import AsyncAnthropicBedrock

from ._chat_client import AnthropicOptionsT, RawAnthropicClient

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
from agent_framework._tools import SHELL_TOOL_KIND_VALUE
from agent_framework._types import _get_data_bytes_as_str # type: ignore
from agent_framework.observability import ChatTelemetryLayer
from anthropic import AsyncAnthropic, AsyncAnthropicBedrock, AsyncAnthropicFoundry, AsyncAnthropicVertex
from anthropic import AsyncAnthropic, AsyncAnthropicFoundry
from anthropic.lib.bedrock import AsyncAnthropicBedrock
from anthropic.lib.vertex import AsyncAnthropicVertex
from anthropic.types.beta import (
BetaContentBlock,
BetaMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from agent_framework._settings import load_settings
from agent_framework._telemetry import get_user_agent
from agent_framework.observability import ChatTelemetryLayer
from anthropic import NOT_GIVEN, AsyncAnthropicVertex
from anthropic import NOT_GIVEN
from anthropic.lib.vertex import AsyncAnthropicVertex

from ._chat_client import AnthropicOptionsT, RawAnthropicClient

Expand Down
2 changes: 1 addition & 1 deletion python/packages/core/agent_framework/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3130,7 +3130,7 @@ async def __anext__(self) -> UpdateT:
if isawaitable(hooked):
hooked = await hooked
if hooked is not None:
update = hooked
update = cast(UpdateT, hooked)
return update

async def _resolve_stream_with_pull_contexts(self) -> AsyncIterable[UpdateT]:
Expand Down
4 changes: 2 additions & 2 deletions python/packages/core/agent_framework/_workflows/_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import traceback as _traceback
import warnings
from collections.abc import Iterator
from collections.abc import Generator
from contextlib import contextmanager
from contextvars import ContextVar
from dataclasses import dataclass
Expand Down Expand Up @@ -46,7 +46,7 @@ def _current_event_origin() -> WorkflowEventSource:


@contextmanager
def _framework_event_origin() -> Iterator[None]: # pyright: ignore[reportUnusedFunction]
def _framework_event_origin() -> Generator[None, None, None]: # pyright: ignore[reportUnusedFunction]
"""Temporarily mark subsequently created events as originating from the framework (internal)."""
token = _event_origin_context.set(WorkflowEventSource.FRAMEWORK)
try:
Expand Down
2 changes: 1 addition & 1 deletion python/packages/lab/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dev = [
"ruff==0.15.15",
"pytest==9.0.3",
"mypy==1.20.0",
"pyright==1.1.408",
"pyright==1.1.410",
#tasks
"poethepoet==0.46.0",
"rich>=13.7.1,<15.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ def __init__(
task_ledger_plan_update_prompt: str | None = None,
progress_ledger_prompt: str | None = None,
final_answer_prompt: str | None = None,
max_stall_count: int | Sentinel = UNSET,
max_stall_count: int | Sentinel = cast(Any, UNSET),
max_reset_count: int | None = None,
max_round_count: int | None = None,
# Existing params
Expand Down Expand Up @@ -1621,7 +1621,7 @@ def _set_manager(
progress_ledger_prompt: str | None = None,
final_answer_prompt: str | None = None,
# Limits
max_stall_count: int | Sentinel = UNSET,
max_stall_count: int | Sentinel = cast(Any, UNSET),
max_reset_count: int | None = None,
max_round_count: int | None = None,
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

import json
import sys
from functools import reduce
from operator import and_
from typing import TYPE_CHECKING, Any, ClassVar, Literal

import numpy as np
Expand Down Expand Up @@ -191,7 +189,12 @@ def schema_dict(self) -> dict[str, Any]:
def _build_filter_from_dict(self, filters: dict[str, str | None]) -> Any | None:
"""Builds a combined filter expression from simple equality tags."""
parts: list[FilterExpression] = [Tag(k) == v for k, v in filters.items() if v]
return reduce(and_, parts) if parts else None
if not parts:
return None
combined = parts[0]
for part in parts[1:]:
combined = combined & part
return combined

def _build_schema_dict(
self,
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dev = [
"pytest-timeout==2.4.0",
"pytest-retry==1.7.0",
"mypy==1.20.0",
"pyright==1.1.408",
"pyright==1.1.410",
"mcp[ws]==1.27.2",
"opentelemetry-sdk==1.40.0",
"azure-monitor-opentelemetry==1.8.8",
Expand Down
10 changes: 5 additions & 5 deletions python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.