Evaluation.evaluate:v6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import weave
from typing import Union
from weave.trace.op_protocol import Op
from weave.flow.model import Model
import json
from weave.trace.op import op
from weave.trace.call import Call
from datetime import datetime
from weave.flow.util import make_memorable_name
def _safe_summarize_to_str(summary: dict) -> str:
summary_str = ""
try:
summary_str = json.dumps(summary, indent=2)
except Exception:
try:
summary_str = str(summary)
except Exception:
pass
return summary_str
logger = "<Logger weave.evaluation.eval (INFO)>"
def default_evaluation_display_name(call: Call) -> str:
date = datetime.now().strftime("%Y-%m-%d")