feat: align aiprovider with adapter-based compatibility

This commit is contained in:
linkong
2026-04-07 17:54:44 +08:00
parent bc90e00e25
commit f12719914d
9 changed files with 299 additions and 50 deletions

View File

@@ -165,7 +165,8 @@ async def test_ai_provider_status_with_auth(auth_headers):
class _FakeAIProviderClient:
async def get_status(self, request_id=None):
return AIProviderStatusResponse(
provider="openai_compatible",
provider="minimax",
api="anthropic-messages",
enabled=True,
configured=True,
model="test-model",
@@ -193,6 +194,7 @@ async def test_ai_provider_status_with_auth(auth_headers):
assert response.status_code == 200
data = response.json()
assert "provider" in data
assert "api" in data
assert "configured" in data
finally:
app.dependency_overrides.clear()
@@ -207,6 +209,9 @@ async def test_ai_situational_analysis_returns_503_when_disabled(auth_headers):
provider="openai_compatible",
model="test-model",
content="1) 态势摘要: 测试返回",
content_blocks=[],
text_blocks=["1) 态势摘要: 测试返回"],
thinking_blocks=[],
raw_response={"id": "mock-response"},
)
@@ -241,5 +246,8 @@ async def test_ai_situational_analysis_returns_503_when_disabled(auth_headers):
data = response.json()
assert data["provider"] == "openai_compatible"
assert data["content"]
assert "content_blocks" in data
assert "text_blocks" in data
assert "thinking_blocks" in data
finally:
app.dependency_overrides.clear()