Azure / Azure/azure-sdk-for-python
azure-ai-agentserver-agentframework: Cannot import name 'AgentRunResponse' from 'agent_framework' since agent-framework 1.0.0b260114
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 3.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 193
Description
- **Package Name**: azure-ai-agentserver-agentframework
- **Package Version**: 1.0.0b7
- **Operating System**: Windows and reproduced on Linux
- **Python Version**: 3.11.2
**Describe the bug**
Hosted agent fails to start since version `agent-framework==1.0.0b260114`. Error on startup due to missing AgentResponse field.
Downgrading agent-framework to 1.0.0b260107 works successfully.
**To Reproduce**
Steps to reproduce the behavior:
1. Install these packages
```
--pre
agent-framework-azure-ai==1.0.0b260114
agent-framework==1.0.0b260114
agent-framework-core==1.0.0b260114
azure-ai-agentserver-agentframework==1.0.0b7
```
2. Create a hosted agent from the sample below
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/agentserver/azure-ai-agentserver-agentframework/samples/basic_simple/minimal_example.py
3. Run with python and observe error
4. Downgrade packages
```
--pre
agent-framework-azure-ai==1.0.0b260107
agent-framework==1.0.0b260107
agent-framework-core==1.0.0b260107
```
5. Run with python and it will work as expected.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
Error below when running `python main.py`
```
Traceback (most recent call last):
File "C:\Users\dev\agent\main.py", line 5, in
from azure.ai.agentserver.agentframework import from_agent_framework
File "C:\Users\dev\.venv\Lib\site-packages\azure\ai\agentserver\agentframework\__init__.py", line 8, in
from .agent_framework import AgentFrameworkCBAgent
File "C:\Users\dev\.venv\Lib\site-packages\azure\ai\agentserver\agentframework\agent_framework.py", line 26, in
from .models.agent_framework_output_non_streaming_converter import (
File "C:\Users\dev\.venv\Lib\site-packages\azure\ai\agentserver\agentframework\models\agent_framework_output_non_streaming_converter.py", line 10, in
from agent_framework import AgentRunResponse, FunctionCallContent, FunctionResultContent, ErrorContent, TextContent
ImportError: cannot import name 'AgentRunResponse' from 'agent_framework' (C:\Users\dev\.venv\Lib\site-packages\agent_framework\__init__.py)
```
**Additional context**
Cannot find `AgentRunResponse` without code just in the python venv
``` 1.0.0b260114
python -c "import agent_framework; print('AgentRunResponse' in dir(agent_framework))"
>>
False
```
``` 1.0.0b260107
python -c "import agent_framework; print('AgentRunResponse' in dir(agent_framework))"
>>
True
```
Contributor guide
Assessment
This issue has not been assessed yet.