microsoft / microsoft/Agent365-python

[python/agent-framework/sample-agent] Sample dependencies are inconsistent on PyPI — cannot run

Aperta
#262 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
41
Fork
23
Merge medio
7h 43m
PR unite (30g)
3

Descrizione

Description

Repo: https://github.com/microsoft/Agent365-Samples (visible from your local path Agent365-Samples)

Title: [python/agent-framework/sample-agent] Sample dependencies are inconsistent on PyPI — cannot run

Body template:

Following the sample at python/agent-framework/sample-agent.

Environment:

  • Python 3.12 (also tested 3.14)
  • Fresh venv
  • pip 25.0.1

Issue:

  • agent-framework (latest 1.8.1) renamed ChatAgentAgent, breaking agent.py line 40
  • agent_framework.azure (latest) does NOT export AzureOpenAIChatClient — only AI Search/Cosmos/Durable classes
  • agent_framework_azure_ai 1.0.0rc6 (the only published version) imports BaseContextProvider
    which doesn't exist in agent-framework-core 1.8.x
  • agent_framework_azure_ai 1.0.0rc6._client.py imports OpenAIResponsesOptions
    which doesn't exist in agent-framework-openai 1.8.x
  • agent-framework-azure-ai 1.0.0rc6 cannot coexist with agent-framework-foundry which pins
    agent-framework-core >= 1.0.0 (PEP 440 ordering excludes rc6)

Request:

  1. Pinned requirements.txt with exact tested versions
  2. Target Python version in the README
  3. Confirmation whether this sample requires an internal pre-release build
Expected behavior

No response

SDK Version

agent-framework-core 1.8.x

Python Version

3.12

OS

Windows 11

How to Reproduce

cd c:\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent
..venva365_py312\Scripts\Activate.ps1

1) The key test — does this import without ImportError now (at rc6)?

python -c "import agent_framework_azure_ai as az; print('OK:', sorted(x for x in dir(az) if not x.startswith('_')))"

2) Find the chat client / Azure OpenAI class specifically

python -c "import agent_framework_azure_ai as az; print([x for x in dir(az) if 'hatClient' in x or 'zureOpenAI' in x or 'penAI' in x])"

3) Get the constructor signature of whatever class exists

@'
import agent_framework_azure_ai as az
import inspect
for n in ["AzureOpenAIChatClient","AzureOpenAIClient","AzureAIChatClient","AzureAIClient","AzureOpenAIChatCompletionClient"]:
if hasattr(az, n):
print(n + ":", inspect.signature(getattr(az, n).init))
'@ | Set-Content -Path ._check_aiclient.py -Encoding UTF8
python ._check_aiclient.py
Remove-Item ._check_aiclient.py

being on agent-framework-core==1.0.0rc6 (consistent with agent-framework-azure-ai==1.0.0rc6), the import should succeed. Step 2 should reveal AzureOpenAIChatClient (or similar). Step 3 gives the exact kwargs.

agent-framework-core==1.0.0rc6 is installed. But the import chain still fails on BaseContextProvider. Two possibilities:

agent-framework-core 1.0.0rc6 itself never exported BaseContextProvider — it was a name used by agent-framework-azure-ai 1.0.0rc6 but never actually published in core. (Mismatch between sibling packages even at the SAME release tag.)
The agent_framework package being imported is shadowed by a stale install from elsewhere — Python might be loading from a different path than the rc6 install.

Output

1) The key test — does this import without ImportError now (at rc6)?

(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent> python -c "import agent_framework_azure_ai as az; print('OK:', sorted(x for x in dir(az) if not x.startswith('_')))"
C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_skills.py:121: ExperimentalWarning: [SKILLS] SkillResource is experimental and may change or be removed in future versions without notice.
C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_harness_memory.py:651: ExperimentalWarning: [HARNESS] MemoryStore is experimental and may change or be removed in future versions without notice.
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_azure_ai_init_.py", line 5, in
from .agent_provider import AzureAIAgentsProvider # pyright: ignore[reportDeprecated]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_azure_ai_agent_provider.py", line 10, in
from agent_framework import (
ImportError: cannot import name 'BaseContextProvider' from 'agent_framework' (C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_init
.py). Did you mean: 'ContextProvider'?
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent>
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent> # 2) Find the chat client / Azure OpenAI class specifically
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent> python -c "import agent_framework_azure_ai as az; print([x for x in dir(az) if 'hatClient' in x or 'zureOpenAI' in x or 'penAI' in x])"
C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_skills.py:121: ExperimentalWarning: [SKILLS] SkillResource is experimental and may change or be removed in future versions without notice.
C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_harness_memory.py:651: ExperimentalWarning: [HARNESS] MemoryStore is experimental and may change or be removed in future versions without notice.
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_azure_ai_init_.py", line 5, in
from .agent_provider import AzureAIAgentsProvider # pyright: ignore[reportDeprecated]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_azure_ai_agent_provider.py", line 10, in
from agent_framework import (
ImportError: cannot import name 'BaseContextProvider' from 'agent_framework' (C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_init
.py). Did you mean: 'ContextProvider'?
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent>
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent> # 3) Get the constructor signature of whatever class exists
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent> @'

import agent_framework_azure_ai as az
import inspect
for n in ["AzureOpenAIChatClient","AzureOpenAIClient","AzureAIChatClient","AzureAIClient","AzureOpenAIChatCompletionClient"]:
if hasattr(az, n):
print(n + ":", inspect.signature(getattr(az, n).init))
'@ | Set-Content -Path ._check_aiclient.py -Encoding UTF8
(.venva365_py312) PS C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent> python ._check_aiclient.py
C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_skills.py:121: ExperimentalWarning: [SKILLS] SkillResource is experimental and may change or be removed in future versions without notice.
C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_harness_memory.py:651: ExperimentalWarning: [HARNESS] MemoryStore is experimental and may change or be removed in future versions without notice.
Traceback (most recent call last):
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent_check_aiclient.py", line 1, in
import agent_framework_azure_ai as az
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_azure_ai_init_.py", line 5, in
from .agent_provider import AzureAIAgentsProvider # pyright: ignore[reportDeprecated]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_azure_ai_agent_provider.py", line 10, in
from agent_framework import (
ImportError: cannot import name 'BaseContextProvider' from 'agent_framework' (C:\Users\ob\Documents\GIT\Agent365-Samples\python\agent-framework\sample-agent.venva365_py312\Lib\site-packages\agent_framework_init
.py). Did you mean: 'ContextProvider'?

Screenshots

No response

Code of Conduct

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da python/agent-framework/sample-agent/agent.py alla riga 40 e riproduci gli errori di importazione con i comandi indicati nell’issue. Confronta i metadati delle dipendenze del sample con i pacchetti agent-framework pubblicati ed esamina la README. Il lavoro è completo quando il sample dispone di dependency pin compatibili e testati, di un target Python corretto e di indicazioni chiare su qualsiasi build pre-release necessario.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, python
Ambito
build-system, developer-experience
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.