MCPcopy
hub / github.com/ModelTC/LightLLM / test_echo

Function test_echo

test/test_api/test_openai_api.py:572–591  ·  view source on GitHub ↗

测试echo参数

()

Source from the content-addressed store, hash-verified

570
571
572def 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
594def test_stop_parameter():

Callers 1

mainFunction · 0.85

Calls 2

completions_with_echoMethod · 0.95
LightLLMClientClass · 0.85

Tested by

no test coverage detected