diff --git a/.gitignore b/.gitignore index c89af90d7..fd33825f9 100644 --- a/.gitignore +++ b/.gitignore @@ -218,3 +218,5 @@ agentlightning/dashboard/**/*.svg # Docker data docker/data/ +.cache_xdg/ +.cache_uv/ diff --git a/agentlightning/instrumentation/weave.py b/agentlightning/instrumentation/weave.py index e75de0b72..11f057bfc 100644 --- a/agentlightning/instrumentation/weave.py +++ b/agentlightning/instrumentation/weave.py @@ -6,7 +6,7 @@ import threading import warnings from datetime import datetime, timezone -from typing import Any, Callable, Dict, Iterator, List +from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List import weave.trace.weave_init from pydantic import validate_call @@ -17,6 +17,12 @@ logger = logging.getLogger(__name__) +# Backward compat: OtelExportReq/Res was renamed to OTelExportReq/Res in weave 0.52.27 +if not TYPE_CHECKING: + if not hasattr(tsi, "OTelExportReq"): + tsi.OTelExportReq = tsi.OtelExportReq + tsi.OTelExportRes = tsi.OtelExportRes + __all__ = [ "instrument_weave", "uninstrument_weave", @@ -303,8 +309,8 @@ def evaluation_status(self, req: tsi.EvaluationStatusReq) -> tsi.EvaluationStatu # --- OTEL API --- - def otel_export(self, req: tsi.OtelExportReq) -> tsi.OtelExportRes: - return tsi.OtelExportRes() + def otel_export(self, req: tsi.OTelExportReq) -> tsi.OTelExportRes: + return tsi.OTelExportRes() # ========================================== # Object Interface (V2 APIs) @@ -364,6 +370,9 @@ def evaluation_list(self, req: tsi.EvaluationListReq) -> Iterator[tsi.Evaluation def evaluation_delete(self, req: tsi.EvaluationDeleteReq) -> tsi.EvaluationDeleteRes: return tsi.EvaluationDeleteRes(num_deleted=0) + def eval_results_query(self, req: tsi.EvalResultsQueryReq) -> tsi.EvalResultsQueryRes: + return tsi.EvalResultsQueryRes(rows=[], total_rows=0) + # --- Models --- def model_create(self, req: tsi.ModelCreateReq) -> tsi.ModelCreateRes: return tsi.ModelCreateRes( @@ -435,6 +444,12 @@ def annotation_queues_query_stream(self, *args: Any, **kwargs: Any) -> Any: def annotation_queue_read(self, *args: Any, **kwargs: Any) -> Any: raise NotImplementedError() + def annotation_queue_delete(self, *args: Any, **kwargs: Any) -> Any: + raise NotImplementedError() + + def annotation_queue_update(self, *args: Any, **kwargs: Any) -> Any: + raise NotImplementedError() + def annotation_queue_add_calls(self, *args: Any, **kwargs: Any) -> Any: raise NotImplementedError()