测试echo参数
()
| 570 | |
| 571 | |
| 572 | def test_echo(): |
| 573 | """测试echo参数""" |
| 574 | client = LightLLMClient() |
| 575 | |
| 576 | try: |
| 577 | print("=== 测试echo参数 ===") |
| 578 | |
| 579 | # 测试echo=True |
| 580 | result = client.completions_with_echo("Hello world", echo=True, max_tokens=20) |
| 581 | print("提示: Hello world (echo=True)") |
| 582 | print("补全:", repr(result["choices"][0]["text"])) |
| 583 | print() |
| 584 | |
| 585 | # 测试echo=False |
| 586 | result = client.completions_with_echo("Hello world", echo=False, max_tokens=20) |
| 587 | print("提示: Hello world (echo=False)") |
| 588 | print("补全:", repr(result["choices"][0]["text"])) |
| 589 | print() |
| 590 | except Exception as e: |
| 591 | print(f"错误: {e}") |
| 592 | |
| 593 | |
| 594 | def test_stop_parameter(): |
no test coverage detected