feat: 推理引擎数据模型与异常层(types/exceptions)及 httpx/jinja2 依赖
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import pytest
|
||||
|
||||
from genesis.inference.exceptions import (
|
||||
LLMError,
|
||||
LLMNetworkError,
|
||||
LLMNotConfiguredError,
|
||||
LLMResponseError,
|
||||
LLMTimeoutError,
|
||||
)
|
||||
|
||||
|
||||
def test_error_hierarchy():
|
||||
assert issubclass(LLMNetworkError, LLMError)
|
||||
assert issubclass(LLMTimeoutError, LLMError)
|
||||
assert issubclass(LLMNotConfiguredError, LLMError)
|
||||
assert issubclass(LLMResponseError, LLMError)
|
||||
|
||||
|
||||
def test_error_message_roundtrip():
|
||||
e = LLMTimeoutError("timeout!")
|
||||
assert str(e) == "timeout!"
|
||||
Reference in New Issue
Block a user