Action ask 可否提供返回stream的函数
为Agent提供和用户交互的接口,如果Action ask 的结果可以以stream的形式返回,那么在用户端可以不用等所有数据就绪后才能看到结果。
I'm providing a user interaction interface for the Agent. If the result of Action ask can be returned in streaming format, users don't have to wait for all data to be ready before seeing the results.
从0.7开始, Action._aask就已经默认是stream模式了。
async def _aask(self, prompt: str, system_msgs: Optional[list[str]] = None) -> str:
"""Append default prefix"""
return await self.llm.aask(prompt, system_msgs)
async def aask(
self,
msg: str,
system_msgs: Optional[list[str]] = None,
format_msgs: Optional[list[dict[str, str]]] = None,
images: Optional[Union[str, list[str]]] = None,
timeout=3,
stream=True,
) -> str:
@redlion99 Can you confirm if the issue has been resolved?
yes, although it does not directly return a stream in chunk form, it should not be difficult to wrap one myself. Thanks for your awesome job again.
Thanks for your kind comments @binlish