Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AFAN-LIFE opened this issue Jun 21, 2024 · 0 comments
Open

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

AFAN-LIFE opened this issue Jun 21, 2024 · 0 comments
Assignees

Comments

@AFAN-LIFE
Copy link

我在使用进行流式返回的时候,设置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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants