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

增加SSE流式输出 #679

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

Commits on Apr 18, 2023

  1. 增加SSE流式输出

    发送请求时,stream参数为1请求流式输出。
    发送请求格式如下:
    curl -X POST "http://127.0.0.1:8000" \
         -H 'Content-Type: application/json' \
         -d '{"prompt": "你好", "history": [], "stream":1}'
    
    回复按照SSE流式输出格式
    data:{
      "response":"你好👋!我是人工智能助手 ChatGLM-6B,很高兴见到你,欢迎问我任何问题。",
      "history":[["你好","你好👋!我是人工智能助手 ChatGLM-6B,很高兴见到你,欢迎问我任何问题。"]],
      "status":200,
      "time":"2023-03-23 21:38:40"
    }
    littlestone0806 committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    35f45dc View commit details
    Browse the repository at this point in the history