Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,5 @@ agentlightning/dashboard/**/*.svg

# Docker data
docker/data/
.cache_xdg/
.cache_uv/
21 changes: 18 additions & 3 deletions agentlightning/instrumentation/weave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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()

Expand Down