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

更新: zhipu-api 支持ModelWorker实现流式输出方式 #3955

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShAw7ock
Copy link

@ShAw7ock ShAw7ock commented May 7, 2024

使用response.iter_lines()的访问方式来读取清华智谱ChatGLM API返回的流式信息如下:

User the method of response.iter_lines() to deal with the Server-Sent Event (SSE) response from Zhipu ChatGLM as follows:

with client.stream("POST", url, headers=headers, json=data) as response:
    for line in response.iter_lines():

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant