MCPcopy Index your code
hub / github.com/ModelTC/LightLLM / test_stream_chat

Function test_stream_chat

test/test_api/test_openai_api.py:391–402  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

389
390
391def test_stream_chat():
392 client = LightLLMClient()
393
394 try:
395 print("用户: 请写一个关于人工智能的短文")
396 print("助手: ", end="", flush=True)
397
398 for chunk in client.stream_chat("请写一个关于人工智能的短文"):
399 print(chunk, end="", flush=True)
400 print("\n")
401 except Exception as e:
402 print(f"错误: {e}")
403
404
405def test_function_call():

Callers 1

mainFunction · 0.85

Calls 2

stream_chatMethod · 0.95
LightLLMClientClass · 0.85

Tested by

no test coverage detected