feat: 推理引擎数据模型与异常层(types/exceptions)及 httpx/jinja2 依赖

This commit is contained in:
lhl
2026-08-09 05:53:55 +08:00
parent 2fbff07d3f
commit c2fad77698
6 changed files with 159 additions and 0 deletions
+21
View File
@@ -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!"