Skip to content

Python SDK 无错误提示异常退出 #424

@ZiyiTsang

Description

@ZiyiTsang

What happened?

您好,我按照官方的示例代码,运行python程序。
`
import asyncio
from iflow_sdk import IFlowClient, AssistantMessage, TaskFinishMessage

async def main():
# SDK 自动处理:
# 1. 检测 iFlow 是否已安装
# 2. 启动 iFlow 进程(如果未运行)
# 3. 查找可用端口并建立连接
# 4. 退出时自动清理资源
async with IFlowClient() as client:
await client.send_message("你好,iFlow!")
async for message in client.receive_messages():
if isinstance(message, AssistantMessage):
print(message.chunk.text, end="\n", flush=True)
elif isinstance(message, TaskFinishMessage):
break

asyncio.run(main())
`

在终端无任何报错的异常退出了。终端没有任何报错信息,甚至不知道从哪儿排查起。

Image

What did you expect to happen?

正常运行

Client information

Details
$ iflow /about
# paste output here

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions