Files
skill-template/scripts/service/example_adapter/mock.py

25 lines
705 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""离线 mock 档位纯内存仿真CI / 单测必跑。"""
from __future__ import annotations
from .base import AdapterBase, ExampleItem, ExampleResult
class MockAdapter(AdapterBase):
name = "mock"
def do_batch(self, target: str, items: list[ExampleItem]) -> ExampleResult:
if not items:
return ExampleResult(
ok=False,
serial_no=None,
error_msg="empty batch",
artifacts={},
)
return ExampleResult(
ok=True,
serial_no=f"MOCK-{len(items)}",
error_msg=None,
artifacts={"mode": "mock", "target": target, "count": len(items)},
)