invoke returns no values with invocations API and streaming data of raw text
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
When an agent returns raw text in a streaming response, no `data:` prefix, invoke silently fails and displays nothing as a result.
invoke should handle raw text streamed back, even when the response does not follow SSE conventions.
Example:
```
test15 git:(main) 20:32 azd ai agent invoke '{\"message\": \"Hi\", \"stream\": true}'
Agent: agent-framework-agent-basic-invocations (remote, invocations protocol)
Input: "{\"message\": \"Hi\", \"stream\": true}"
Session: 6ac564eeafe52a1300xWAbDyVA8dQtJ7lgH3YrdLbz76DVC1WM
Trace ID: ade71725-f5ef-4f42-964c-f6bed3c71820
```
```
async def stream_response() -> AsyncGenerator[str]:
async for update in agent.run(user_message, session=session, stream=True):
yield update.text
```
Like in this sample: https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/agent-framework/invocations/01-basic/main.py
Contributor guide
Assessment
This issue has not been assessed yet.