agentscope-ai / agentscope-ai/agentscope-runtime

[Bug] There is a bug in enabling non-stream mode when creating agent.

未關閉
#439 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
863
分支
168
PR 合併指標
30 天內沒有已合併 PR

描述

## Bug Description
I hope to use non-stream mode, but when creating `AgentApp`, if set `stream=True`, it will throw an error.

## Reproduction Steps
```
from agentscope_runtime.engine import AgentApp
# Create the AgentApp instance
agent_app = AgentApp(
app_name="LangGraphAgent",
app_description="A LangGraph-based research assistant",
stream=False
)

# from agent import agent_app
from dotenv import load_dotenv

load_dotenv()

if __name__ == "__main__":

agent_app.run(host="0.0.0.0", port=8090, web_ui=False)
```

## Expected vs Actual Behavior
**Expected:** The agent starts with non-stream mode.
**Actual:** The program throw an error.

## Error Messages

```
[NacosRegistry] Nacos SDK (nacos-sdk-python) is not available. Install it with: pip install nacos-sdk-python
INFO: Started server process [58540]
INFO: Waiting for application startup.
ERROR: Traceback (most recent call last):
File "D:\myagent\.venv\Lib\site-packages\starlette\routing.py", line 694, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "D:\Programs\anaconda3\Lib\contextlib.py", line 210, in __aenter__
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "D:\myagent\.venv\Lib\site-packages\agentscope_runtime\engine\deployers\utils\service_utils\fastapi_factory.py", line 171, in lifespan
await FastAPIAppFactory._handle_startup(
File "D:\myagent\.venv\Lib\site-packages\agentscope_runtime\engine\deployers\utils\service_utils\fastapi_factory.py", line 267, in _handle_startup
effective_func = app.state.runner.query
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Runner' object has no attribute 'query'

ERROR: Application startup failed. Exiting.
```

## Environment
- agentscope 1.0.14
- agentscope-runtime 1.0.5
- Python 3.11.7
- Windows 11
- Installation: uv

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。