agentscope-ai / agentscope-ai/agentscope-runtime

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

Aperta
#439 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
863
Fork
168
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.