Skip to content

Python: [Bug]: issue in agent_framework_anthropic import #3473

@leelakarthik

Description

@leelakarthik

Description

When i update Annotation with Annotations, issue re surfaces with Content Import, when digged again it's Contents.

Both I found in _types.py.

Later ImportError: cannot import name 'prepare_function_call_results' from 'agent_framework' (/Users/karthik/Code bases/Jan/.venv/lib/python3.14/site-packages/agent_framework/init.py)

This i could not fix locally as Iam not completely aware of the method signature.

Code Sample

from agent_framework_anthropic import AnthropicClient

Error Messages / Stack Traces

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 1
----> 1 from agent_framework_anthropic import AnthropicClient
      2 from .MAF.codebase_analyst_agent.config.settings import settings

File ~/Code bases/Jan/.venv/lib/python3.14/site-packages/agent_framework_anthropic/__init__.py:5
      1 # Copyright (c) Microsoft. All rights reserved.
      3 import importlib.metadata
----> 5 from ._chat_client import AnthropicChatOptions, AnthropicClient
      7 try:
      8     __version__ = importlib.metadata.version(__name__)

File ~/Code bases/Jan/.venv/lib/python3.14/site-packages/agent_framework_anthropic/_chat_client.py:7
      4 from collections.abc import AsyncIterable, MutableMapping, MutableSequence, Sequence
      5 from typing import Any, ClassVar, Final, Generic, Literal, TypedDict
----> 7 from agent_framework import (
      8     AGENT_FRAMEWORK_USER_AGENT,
      9     AIFunction,
     10     Annotation,
     11     BaseChatClient,
     12     ChatMessage,
     13     ChatOptions,
     14     ChatResponse,
     15     ChatResponseUpdate,
     16     Content,
     17     FinishReason,
     18     HostedCodeInterpreterTool,
     19     HostedMCPTool,
     20     HostedWebSearchTool,
     21     Role,
     22     TextSpanRegion,
     23     UsageDetails,
     24     get_logger,
     25     prepare_function_call_results,
     26     use_chat_middleware,
     27     use_function_invocation,
     28 )
     29 from agent_framework._pydantic import AFBaseSettings
     30 from agent_framework.exceptions import ServiceInitializationError

ImportError: cannot import name 'Annotation' from 'agent_framework' (/Users/karthik/Code bases/Jan/.venv/lib/python3.14/site-packages/agent_framework/__init__.py)

Package Versions

1.0.0b251120, 1.0.0b260127

Python Version

3.14

Additional Context

When i update Annotation with Annotations, issue re surfaces with Content Import, when digged again it's Contents.

Both I found in _types.py.

Later ImportError: cannot import name 'prepare_function_call_results' from 'agent_framework' (/Users/karthik/Code bases/Jan/.venv/lib/python3.14/site-packages/agent_framework/init.py)

This i could not fix locally as Iam not completely aware of the method signature.

Metadata

Metadata

Labels

bugSomething isn't workingmodel clientsIssues related to the model client implementationspython

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions