()
| 389 | |
| 390 | |
| 391 | def 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 | |
| 405 | def test_function_call(): |
no test coverage detected