PaddlePaddle/ERNIE-SDK

流式返回时无法判定是否触发函数调用

AFAN-LIFE opened this issue · 0 comments

我在使用进行流式返回的时候,设置stream=True,但是之后调用is_function_response会报错:AttributeError: 'generator' object has no attribute 'is_function_response',而在在设置stream=False的时候是可以的,也是官方在文心一言社区提供的使用方式。请问流式返回的时候如何调用呢?

        response_stream = erniebot.ChatCompletion.create(
            model='ernie-3.5',
            messages=messages,
            stream=True,
            functions=functions
        )
        if response_stream.is_function_response: