diff --git a/docs.json b/docs.json
index cd8f22bc94..37af980ed6 100644
--- a/docs.json
+++ b/docs.json
@@ -1231,6 +1231,7 @@
"weave/reference/typescript-sdk/functions/endllm",
"weave/reference/typescript-sdk/functions/endsession",
"weave/reference/typescript-sdk/functions/endturn",
+ "weave/reference/typescript-sdk/functions/flush",
"weave/reference/typescript-sdk/functions/flushotel",
"weave/reference/typescript-sdk/functions/getcurrentconversation",
"weave/reference/typescript-sdk/functions/getcurrentllm",
@@ -1263,6 +1264,7 @@
"weave/reference/typescript-sdk/interfaces/callschema",
"weave/reference/typescript-sdk/interfaces/callsfilter",
"weave/reference/typescript-sdk/interfaces/conversationinit",
+ "weave/reference/typescript-sdk/interfaces/customruntimeid",
"weave/reference/typescript-sdk/interfaces/getagentsoptions",
"weave/reference/typescript-sdk/interfaces/getagentspansoptions",
"weave/reference/typescript-sdk/interfaces/getagentturnoptions",
@@ -1275,6 +1277,7 @@
"weave/reference/typescript-sdk/interfaces/message",
"weave/reference/typescript-sdk/interfaces/query",
"weave/reference/typescript-sdk/interfaces/reasoning",
+ "weave/reference/typescript-sdk/interfaces/registercustomruntimeoptions",
"weave/reference/typescript-sdk/interfaces/sortby",
"weave/reference/typescript-sdk/interfaces/subagentinit",
"weave/reference/typescript-sdk/interfaces/toolinit",
@@ -1301,6 +1304,7 @@
"weave/reference/typescript-sdk/type-aliases/modality",
"weave/reference/typescript-sdk/type-aliases/op",
"weave/reference/typescript-sdk/type-aliases/opdecorator",
+ "weave/reference/typescript-sdk/type-aliases/registercustomruntimeresult",
"weave/reference/typescript-sdk/type-aliases/response",
"weave/reference/typescript-sdk/type-aliases/role",
"weave/reference/typescript-sdk/type-aliases/session",
diff --git a/weave/guides/evaluation/evaluation_logger.mdx b/weave/guides/evaluation/evaluation_logger.mdx
index 30e69dfdce..9879e37dc3 100644
--- a/weave/guides/evaluation/evaluation_logger.mdx
+++ b/weave/guides/evaluation/evaluation_logger.mdx
@@ -447,11 +447,11 @@ Send the span to the same Weave project as the evaluation through the `/agents/o
For more information about the endpoint:
- To send spans from an existing OTel pipeline, see [Send OpenTelemetry spans to the Agents view](/weave/guides/tracking/trace-agents-otel).
-- For the endpoint specification, see [Export a GenAI trace](/weave/reference/service-api/agents/export-genai-trace).
+- For the endpoint specification, see [Export a GenAI trace](https://docs.wandb.ai/weave/reference/service-api/agents/export-genai-trace).
Only `weave.eval.run_id` and `weave.eval.predict_and_score_call_id` establish the evaluation and result links. The row digest, example ID, trial index, kind, and evaluation name add context and support filtering, but don't create a link by themselves. Use Weave Call IDs for the two linking attributes, not OTel trace or span IDs.
-You can obtain both IDs from the [evaluation results query API](/weave/reference/service-api/eval-results/eval-results-query). Each evaluation in the response has an `evaluation_call_id`, and each trial has a `predict_and_score_call_id`.
+You can obtain both IDs from the [evaluation results query API](https://docs.wandb.ai/weave/reference/service-api/eval-results/eval-results-query). Each evaluation in the response has an `evaluation_call_id`, and each trial has a `predict_and_score_call_id`.
The following examples assume that `span` is the OTel span for the agent operation. Replace each bracketed value with metadata from the evaluation run and result that the span belongs to.
diff --git a/weave/reference/python-sdk.mdx b/weave/reference/python-sdk.mdx
index 094f5e8088..1163253ecb 100644
--- a/weave/reference/python-sdk.mdx
+++ b/weave/reference/python-sdk.mdx
@@ -10,7 +10,7 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx';
---
-
+
## class `Agent`
@@ -24,7 +24,7 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx';
- `system_message`: ``
- `tools`: `list[typing.Any]`
-
+
### method `step`
@@ -44,7 +44,7 @@ Run a step of the agent.
---
-
+
## class `AgentState`
@@ -57,7 +57,7 @@ Run a step of the agent.
---
-
+
## class `AnnotationSpec`
@@ -69,7 +69,7 @@ Run a step of the agent.
- `unique_among_creators`: ``
- `op_scope`: `list[str] | None`
-
+
### classmethod `preprocess_field_schema`
@@ -79,7 +79,7 @@ preprocess_field_schema(data: Any) → Any
---
-
+
### classmethod `validate_field_schema`
@@ -89,7 +89,7 @@ validate_field_schema(schema: dict[str, Any]) → dict[str, Any]
---
-
+
### method `value_is_valid`
@@ -109,7 +109,7 @@ Validates a payload against this annotation spec's schema.
---
-
+
## class `Audio`
A class representing audio data in a supported format (wav or mp3).
@@ -131,7 +131,7 @@ This class handles audio data storage and provides methods for loading from diff
- `ValueError`: If audio data is empty or format is not supported
-
+
### method `__init__`
@@ -145,7 +145,7 @@ __init__(
---
-
+
### method `export`
@@ -160,7 +160,7 @@ Export audio data to a file.
---
-
+
### classmethod `from_data`
@@ -186,7 +186,7 @@ Create an Audio object from raw data and specified format.
---
-
+
### classmethod `from_path`
@@ -210,7 +210,7 @@ Create an Audio object from a file path.
---
-
+
## class `ClassifierMonitor`
A monitor that merges multiple scorers into a single classifier.
@@ -232,7 +232,7 @@ Classifier monitors combine prompts from multiple LLMAsAJudgeScorers targeting t
- `prompt_header`: `str | None`
- `prompt_footer`: `str | None`
-
+
### method `activate`
@@ -247,7 +247,7 @@ Activates the monitor.
---
-
+
### method `deactivate`
@@ -262,7 +262,7 @@ Deactivates the monitor.
---
-
+
### classmethod `from_obj`
@@ -272,7 +272,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
### method `get_prompt_footer`
@@ -284,7 +284,7 @@ Text to append after the merged classifier prompts.
---
-
+
### method `get_prompt_header`
@@ -296,7 +296,7 @@ Text to prepend before the merged classifier prompts.
---
-
+
### method `model_post_init`
@@ -314,7 +314,7 @@ There is an edge case where a monitor can be created using the SDK without norma
---
-
+
## class `Content`
A class to represent content from various sources, resolving them to a unified byte-oriented representation with associated metadata.
@@ -327,7 +327,7 @@ This class must be instantiated using one of its classmethods:
- from_base64()
- from_data_url()
-
+
### method `__init__`
@@ -358,7 +358,7 @@ Direct initialization is disabled. Please use a classmethod like `Content.from_p
---
-
+
### method `as_string`
@@ -373,7 +373,7 @@ Display the data as a string. Bytes are decoded using the `encoding` attribute I
---
-
+
### classmethod `from_base64`
@@ -390,7 +390,7 @@ Initializes Content from a base64 encoded string or bytes.
---
-
+
### classmethod `from_bytes`
@@ -408,7 +408,7 @@ Initializes Content from raw bytes.
---
-
+
### classmethod `from_data_url`
@@ -420,7 +420,7 @@ Initializes Content from a data URL.
---
-
+
### classmethod `from_path`
@@ -437,7 +437,7 @@ Initializes Content from a local file path.
---
-
+
### classmethod `from_text`
@@ -455,7 +455,7 @@ Initializes Content from a string of text.
---
-
+
### classmethod `from_url`
@@ -474,7 +474,7 @@ Downloads the content, infers mimetype/extension from headers, URL path, and dat
---
-
+
### classmethod `model_validate`
@@ -494,7 +494,7 @@ Override model_validate to handle Content reconstruction from dict.
---
-
+
### classmethod `model_validate_json`
@@ -513,7 +513,7 @@ Override model_validate_json to handle Content reconstruction from JSON.
---
-
+
### method `open`
@@ -531,7 +531,7 @@ This method uses the platform-specific mechanism to open the file with the defau
---
-
+
### method `save`
@@ -546,7 +546,7 @@ Copy the file to the specified destination path. Updates the filename and the pa
---
-
+
### method `serialize_data`
@@ -558,7 +558,7 @@ When dumping model in json mode
---
-
+
### method `to_data_url`
@@ -578,7 +578,7 @@ Constructs a data URL from the content.
---
-
+
## class `Conversation`
A conversation. Groups turns by conversation_id (no span).
@@ -598,7 +598,7 @@ A conversation. Groups turns by conversation_id (no span).
- `continue_parent_trace`: ``
- `attributes`: `dict[str, typing.Any]`
-
+
### method `end`
@@ -608,7 +608,7 @@ end() → None
---
-
+
### method `model_post_init`
@@ -618,7 +618,7 @@ model_post_init(context: 'Any') → None
---
-
+
### method `start_turn`
@@ -642,7 +642,18 @@ Sets the ``_current_turn`` contextvar so the turn is visible via ``get_current_t
---
-
+
+
+## class `CustomRuntimeID`
+
+**Pydantic Fields:**
+
+- `id`: ``
+- `max_tokens`: ``
+
+---
+
+
## class `Dataset`
Dataset object with easy saving and automatic versioning.
@@ -673,7 +684,7 @@ example_label = dataset_ref.rows[2]['sentence']
- `ref`: `trace.refs.ObjectRef | None`
- `rows`: `trace.table.Table | trace.vals.WeaveTable`
-
+
### method `add_rows`
@@ -694,7 +705,7 @@ This is useful for adding examples to large datasets without having to load the
---
-
+
### classmethod `convert_to_table`
@@ -704,7 +715,7 @@ convert_to_table(rows: Any) → Table | WeaveTable
---
-
+
### classmethod `from_calls`
@@ -714,7 +725,7 @@ from_calls(calls: Iterable[Call]) → Self
---
-
+
### classmethod `from_hf`
@@ -724,7 +735,7 @@ from_hf(hf_dataset: 'HFDataset | HFDatasetDict') → Self
---
-
+
### classmethod `from_obj`
@@ -734,7 +745,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
### classmethod `from_pandas`
@@ -744,7 +755,7 @@ from_pandas(df: 'DataFrame') → Self
---
-
+
### method `select`
@@ -763,7 +774,7 @@ Select rows from the dataset based on the provided indices.
---
-
+
### method `to_hf`
@@ -773,7 +784,7 @@ to_hf() → HFDataset
---
-
+
### method `to_pandas`
@@ -783,11 +794,11 @@ to_pandas() → DataFrame
---
-
+
## class `EasyPrompt`
-
+
### method `__init__`
@@ -843,7 +854,7 @@ Join all messages into a system prompt object.
---
-
+
### method `append`
@@ -853,7 +864,7 @@ append(item: Any, role: str | None = None, dedent: bool = False) → None
---
-
+
### method `as_dict`
@@ -863,7 +874,7 @@ as_dict() → dict[str, Any]
---
-
+
### method `as_pydantic_dict`
@@ -873,7 +884,7 @@ as_pydantic_dict() → dict[str, Any]
---
-
+
### method `bind`
@@ -883,7 +894,7 @@ bind(*args: Any, **kwargs: Any) → Prompt
---
-
+
### method `bind_rows`
@@ -893,7 +904,7 @@ bind_rows(dataset: list[dict] | Any) → list['Prompt']
---
-
+
### method `config_table`
@@ -903,7 +914,7 @@ config_table(title: str | None = None) → Table
---
-
+
### method `configure`
@@ -913,7 +924,7 @@ configure(config: dict | None = None, **kwargs: Any) → Prompt
---
-
+
### method `dump`
@@ -923,7 +934,7 @@ dump(fp: ) → None
---
-
+
### method `dump_file`
@@ -933,7 +944,7 @@ dump_file(filepath: str | Path) → None
---
-
+
### method `format`
@@ -943,7 +954,7 @@ format(**kwargs: Any) → Any
---
-
+
### classmethod `from_obj`
@@ -953,7 +964,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
### classmethod `load`
@@ -963,7 +974,7 @@ load(fp: ) → Self
---
-
+
### classmethod `load_file`
@@ -973,7 +984,7 @@ load_file(filepath: str | Path) → Self
---
-
+
### method `messages_table`
@@ -983,7 +994,7 @@ messages_table(title: str | None = None) → Table
---
-
+
### method `print`
@@ -993,7 +1004,7 @@ print() → str
---
-
+
### method `publish`
@@ -1007,7 +1018,7 @@ publish(
---
-
+
### method `require`
@@ -1017,7 +1028,7 @@ require(param_name: str, **kwargs: Any) → Prompt
---
-
+
### method `run`
@@ -1027,7 +1038,7 @@ run() → Any
---
-
+
### method `validate_requirement`
@@ -1037,7 +1048,7 @@ validate_requirement(key: str, value: Any) → list
---
-
+
### method `validate_requirements`
@@ -1047,7 +1058,7 @@ validate_requirements(values: dict[str, Any]) → list
---
-
+
### method `values_table`
@@ -1057,7 +1068,7 @@ values_table(title: str | None = None) → Table
---
-
+
## class `Evaluation`
Sets up an evaluation which includes a set of scorers and a dataset.
@@ -1105,13 +1116,13 @@ asyncio.run(evaluation.evaluate(function_to_evaluate))
- `description`: `str | None`
- `ref`: `trace.refs.ObjectRef | None`
- `dataset`: ``
-- `scorers`: `list[typing.Annotated[trace.op_protocol.Op | flow.scorer.Scorer, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)]] | None`
+- `scorers`: `list[typing.Annotated[trace.op_protocol.Op | flow.scorer.Scorer, BeforeValidator(func=, json_schema_input_type=PydanticUndefined)]] | None`
- `preprocess_model_input`: `collections.abc.Callable[[dict], dict] | None`
- `trials`: ``
- `metadata`: `dict[str, typing.Any] | None`
- `evaluation_name`: `str | collections.abc.Callable[trace.call.Call, str] | None`
-
+
### method `evaluate`
@@ -1121,7 +1132,7 @@ evaluate(model: Op | Model) → dict
---
-
+
### classmethod `from_obj`
@@ -1131,7 +1142,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
### method `get_eval_results`
@@ -1141,7 +1152,7 @@ get_eval_results(model: Op | Model) → EvaluationResults
---
-
+
### method `get_evaluate_calls`
@@ -1172,7 +1183,7 @@ for call in calls:
---
-
+
### method `get_score_calls`
@@ -1200,7 +1211,7 @@ for trace_id, calls in score_calls.items():
---
-
+
### method `get_scores`
@@ -1242,7 +1253,7 @@ Expected output:
---
-
+
### method `model_post_init`
@@ -1252,7 +1263,7 @@ model_post_init(context: Any) → None
---
-
+
### method `predict_and_score`
@@ -1262,7 +1273,7 @@ predict_and_score(model: Op | Model, example: dict) → dict
---
-
+
### method `summarize`
@@ -1272,7 +1283,7 @@ summarize(eval_table: EvaluationResults) → dict
---
-
+
## class `EvaluationLogger`
This class provides an imperative interface for logging evaluations.
@@ -1311,7 +1322,7 @@ with ev.log_prediction(inputs={'q': 'Hello'}) as pred:
ev.log_summary({"avg_score": 0.9})
```
-
+
### method `__init__`
@@ -1335,7 +1346,7 @@ __init__(
---
-
+
### method `fail`
@@ -1347,7 +1358,7 @@ Convenience method to fail the evaluation with an exception.
---
-
+
### method `finish`
@@ -1361,7 +1372,7 @@ Ensures all prediction calls and the main evaluation call are finalized. This is
---
-
+
### method `log_example`
@@ -1395,12 +1406,19 @@ ev.log_example(
---
-
+
### method `log_prediction`
```python
-log_prediction(inputs: 'dict[str, Any]', output: 'Any' = None) → ScoreLogger
+log_prediction(
+ inputs: 'dict[str, Any]',
+ output: 'Any' = None,
+ example_id: 'str | None' = None,
+ row_digest: 'str | None' = None,
+ trial_index: 'int | None' = None,
+ eval_kind: 'str | None' = 'agent'
+) → ScoreLogger
```
Log a prediction to the Evaluation.
@@ -1412,6 +1430,10 @@ Returns a ScoreLogger that can be used directly or as a context manager.
- `inputs`: The input data for the prediction
- `output`: The output value. Defaults to None. Can be set later using pred.output.
+ - `example_id`: Optional caller-provided example identifier for OTel spans.
+ - `row_digest`: Optional stable row identity. Defaults to a digest of inputs.
+ - `trial_index`: Optional zero-based trial index for this row digest.
+ - `eval_kind`: Optional eval kind for OTel spans. Defaults to "agent".
**Returns:**
ScoreLogger for logging scores and optionally finishing the prediction.
@@ -1423,7 +1445,7 @@ Example (context manager):
---
-
+
### method `log_summary`
@@ -1437,7 +1459,7 @@ This will calculate the summary, call the summarize op, and then finalize the ev
---
-
+
### method `set_view`
@@ -1475,12 +1497,12 @@ Saves the provided content as an object in the project and writes its reference
---
-
+
## class `File`
A class representing a file with path, mimetype, and size information.
-
+
### method `__init__`
@@ -1507,7 +1529,7 @@ Get the filename of the file.
---
-
+
### method `open`
@@ -1525,7 +1547,7 @@ This method uses the platform-specific mechanism to open the file with the defau
---
-
+
### method `save`
@@ -1540,7 +1562,7 @@ Copy the file to the specified destination path.
---
-
+
## class `LLM`
One LLM API call. Maps to a chat OTel span.
@@ -1571,7 +1593,7 @@ One LLM API call. Maps to a chat OTel span.
- `started_at`: `datetime.datetime | None`
- `ended_at`: `datetime.datetime | None`
-
+
### method `add_event`
@@ -1595,7 +1617,7 @@ Must be called between span start and span end (inside ``with``). Outside that w
---
-
+
### method `attach_media`
@@ -1617,7 +1639,7 @@ The publish (which uploads the media) runs on a dedicated background thread so t
---
-
+
### method `attach_media_url`
@@ -1631,7 +1653,7 @@ Convenience over ``attach_media`` for the common case where the caller has a URL
---
-
+
### method `end`
@@ -1641,7 +1663,7 @@ end() → None
---
-
+
### method `model_post_init`
@@ -1651,7 +1673,7 @@ model_post_init(context: 'Any') → None
---
-
+
### method `output`
@@ -1663,7 +1685,7 @@ Append an assistant message to output_messages.
---
-
+
### method `record`
@@ -1689,7 +1711,7 @@ Only fields explicitly passed (non-``None``) are applied — existing values are
---
-
+
### method `set_attributes`
@@ -1705,7 +1727,7 @@ Must be called between span start and span end — i.e. inside a ``with`` block.
---
-
+
### method `think`
@@ -1717,7 +1739,7 @@ Set reasoning/chain-of-thought content.
---
-
+
## class `LogResult`
Result of a batch log_* call.
@@ -1731,7 +1753,7 @@ Result of a batch log_* call.
---
-
+
## class `Markdown`
A Markdown renderable.
@@ -1744,7 +1766,7 @@ A Markdown renderable.
- `style` (Union[str, Style], optional): Optional style to apply to markdown.
- `hyperlinks` (bool, optional): Enable hyperlinks. Defaults to ``True``.
-
+
### method `__init__`
@@ -1762,7 +1784,7 @@ __init__(
---
-
+
## class `MediaAttachment`
A media attachment on an LLM call.
@@ -1779,7 +1801,7 @@ Always holds a ``weave://`` content ref URI. Raw bytes, data-URLs, and plain HT
---
-
+
## class `Message`
A single message in a conversation.
@@ -1800,7 +1822,7 @@ When ``parts`` is non-empty it is the canonical representation. When empty, the
- `tool_name`: ``
- `parts`: `list[typing.Annotated[conversation.types.TextPart | conversation.types.ReasoningPart | conversation.types.ToolCallPart | conversation.types.ToolCallResponsePart | conversation.types.BlobPart | conversation.types.UriPart | conversation.types.FilePart, FieldInfo(annotation=NoneType, required=True, discriminator='type')]]`
-
+
### classmethod `assistant`
@@ -1817,7 +1839,7 @@ Use plain text for simple replies; pass ``tool_calls`` when the assistant reques
---
-
+
### classmethod `system`
@@ -1829,7 +1851,7 @@ Build a system message from plain text.
---
-
+
### classmethod `tool_result`
@@ -1843,7 +1865,7 @@ Build a tool-result message for a previously-requested tool call.
---
-
+
### classmethod `user`
@@ -1855,11 +1877,11 @@ Build a user message from plain text.
---
-
+
## class `MessagesPrompt`
-
+
### method `__init__`
@@ -1874,7 +1896,7 @@ __init__(messages: list[dict])
- `ref`: `trace.refs.ObjectRef | None`
- `messages`: `list[dict]`
-
+
### method `format`
@@ -1884,7 +1906,7 @@ format(**kwargs: Any) → list
---
-
+
### method `format_message`
@@ -1898,7 +1920,7 @@ This method delegates to the standalone format_message_with_template_vars functi
---
-
+
### classmethod `from_obj`
@@ -1908,7 +1930,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
## class `Model`
Intended to capture a combination of code and data the operates on an input. For example it might call an LLM with a prompt to make a prediction or generate text.
@@ -1934,7 +1956,7 @@ class YourModel(Model):
- `description`: `str | None`
- `ref`: `trace.refs.ObjectRef | None`
-
+
### method `get_infer_method`
@@ -1944,7 +1966,7 @@ get_infer_method() → Callable
---
-
+
## class `Monitor`
Sets up a monitor to score incoming calls automatically.
@@ -1995,7 +2017,7 @@ my_monitor.activate()
- `active`: ``
- `scorer_debounce_config`: `flow.monitor.ScorerDebounceConfig | None`
-
+
### method `activate`
@@ -2010,7 +2032,7 @@ Activates the monitor.
---
-
+
### method `deactivate`
@@ -2025,7 +2047,7 @@ Deactivates the monitor.
---
-
+
### classmethod `from_obj`
@@ -2035,7 +2057,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
### method `model_post_init`
@@ -2053,7 +2075,7 @@ There is an edge case where a monitor can be created using the SDK without norma
---
-
+
## class `Object`
Base class for Weave objects that can be tracked and versioned.
@@ -2081,7 +2103,7 @@ obj = Object.from_uri("weave:///entity/project/object:digest")
- `description`: `str | None`
- `ref`: `trace.refs.ObjectRef | None`
-
+
### classmethod `from_uri`
@@ -2111,7 +2133,7 @@ obj = MyObject.from_uri("weave:///entity/project/object:digest")
---
-
+
### classmethod `handle_relocatable_object`
@@ -2148,7 +2170,7 @@ This validator handles special cases where the input is an ObjectRef or WeaveObj
---
-
+
### classmethod `strip_weave_serialization_metadata`
@@ -2162,12 +2184,12 @@ Weave's serialization adds _type, _class_name, and _bases to dicts for type reco
---
-
+
## class `ObjectRef`
ObjectRef(entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ())
-
+
### method `__init__`
@@ -2195,7 +2217,7 @@ __init__(
---
-
+
### method `as_param_dict`
@@ -2205,7 +2227,7 @@ as_param_dict() → dict
---
-
+
### method `delete`
@@ -2215,7 +2237,7 @@ delete() → None
---
-
+
### method `get`
@@ -2225,7 +2247,7 @@ get(objectify: 'bool' = True) → Any
---
-
+
### method `is_descended_from`
@@ -2235,7 +2257,7 @@ is_descended_from(potential_ancestor: 'ObjectRef') → bool
---
-
+
### method `maybe_parse_uri`
@@ -2245,7 +2267,7 @@ maybe_parse_uri(s: 'str') → AnyRef | None
---
-
+
### method `parse_uri`
@@ -2255,7 +2277,7 @@ parse_uri(uri: 'str') → ObjectRef
---
-
+
### method `with_attr`
@@ -2265,7 +2287,7 @@ with_attr(attr: 'str') → Self
---
-
+
### method `with_extra`
@@ -2275,7 +2297,7 @@ with_extra(extra: 'tuple[str | Future[str], ]') → Self
---
-
+
### method `with_index`
@@ -2285,7 +2307,7 @@ with_index(index: 'int') → Self
---
-
+
### method `with_item`
@@ -2295,7 +2317,7 @@ with_item(item_digest: 'str | Future[str]') → Self
---
-
+
### method `with_key`
@@ -2305,7 +2327,7 @@ with_key(key: 'str') → Self
---
-
+
## class `Prompt`
@@ -2315,7 +2337,7 @@ with_key(key: 'str') → Self
- `description`: `str | None`
- `ref`: `trace.refs.ObjectRef | None`
-
+
### method `format`
@@ -2325,12 +2347,12 @@ format(**kwargs: Any) → Any
---
-
+
## class `SavedView`
A fluent-style class for working with SavedView objects.
-
+
### method `__init__`
@@ -2356,7 +2378,7 @@ __init__(view_type: 'str' = 'traces', label: 'str' = 'SavedView') → None
---
-
+
### method `add_column`
@@ -2366,7 +2388,7 @@ add_column(path: 'str | ObjectPath', label: 'str | None' = None) → SavedView
---
-
+
### method `add_columns`
@@ -2378,7 +2400,7 @@ Convenience method for adding multiple columns to the grid.
---
-
+
### method `add_filter`
@@ -2392,7 +2414,7 @@ add_filter(
---
-
+
### method `add_sort`
@@ -2402,7 +2424,7 @@ add_sort(field: 'str', direction: 'SortDirection') → SavedView
---
-
+
### method `column_index`
@@ -2412,7 +2434,7 @@ column_index(path: 'int | str | ObjectPath') → int
---
-
+
### method `filter_op`
@@ -2422,7 +2444,7 @@ filter_op(op_name: 'str | None') → SavedView
---
-
+
### method `get_calls`
@@ -2440,7 +2462,7 @@ Get calls matching this saved view's filters and settings.
---
-
+
### method `get_known_columns`
@@ -2452,7 +2474,7 @@ Get the set of columns that are known to exist.
---
-
+
### method `get_table_columns`
@@ -2462,7 +2484,7 @@ get_table_columns() → list[TableColumn]
---
-
+
### method `hide_column`
@@ -2472,7 +2494,7 @@ hide_column(col_name: 'str') → SavedView
---
-
+
### method `insert_column`
@@ -2486,7 +2508,7 @@ insert_column(
---
-
+
### classmethod `load`
@@ -2496,7 +2518,7 @@ load(ref: 'str') → Self
---
-
+
### method `page_size`
@@ -2506,7 +2528,7 @@ page_size(page_size: 'int') → SavedView
---
-
+
### method `pin_column_left`
@@ -2516,7 +2538,7 @@ pin_column_left(col_name: 'str') → SavedView
---
-
+
### method `pin_column_right`
@@ -2526,7 +2548,7 @@ pin_column_right(col_name: 'str') → SavedView
---
-
+
### method `remove_column`
@@ -2536,7 +2558,7 @@ remove_column(path: 'int | str | ObjectPath') → SavedView
---
-
+
### method `remove_columns`
@@ -2548,7 +2570,7 @@ Remove columns from the saved view.
---
-
+
### method `remove_filter`
@@ -2558,7 +2580,7 @@ remove_filter(index_or_field: 'int | str') → SavedView
---
-
+
### method `remove_filters`
@@ -2570,7 +2592,7 @@ Remove all filters from the saved view.
---
-
+
### method `rename`
@@ -2580,7 +2602,7 @@ rename(label: 'str') → SavedView
---
-
+
### method `rename_column`
@@ -2590,7 +2612,7 @@ rename_column(path: 'int | str | ObjectPath', label: 'str') → SavedView
---
-
+
### method `save`
@@ -2602,7 +2624,7 @@ Publish the saved view to the server.
---
-
+
### method `set_columns`
@@ -2614,7 +2636,7 @@ Set the columns to be displayed in the grid.
---
-
+
### method `show_column`
@@ -2624,7 +2646,7 @@ show_column(col_name: 'str') → SavedView
---
-
+
### method `sort_by`
@@ -2634,7 +2656,7 @@ sort_by(field: 'str', direction: 'SortDirection') → SavedView
---
-
+
### method `to_grid`
@@ -2644,7 +2666,7 @@ to_grid(limit: 'int | None' = None) → Grid
---
-
+
### method `to_rich_table_str`
@@ -2654,7 +2676,7 @@ to_rich_table_str() → str
---
-
+
### method `ui_url`
@@ -2668,7 +2690,7 @@ Note this is the "result" page with traces etc, not the URL for the view object.
---
-
+
### method `unpin_column`
@@ -2678,7 +2700,7 @@ unpin_column(col_name: 'str') → SavedView
---
-
+
## class `Scorer`
@@ -2693,7 +2715,7 @@ unpin_column(col_name: 'str') → SavedView
#### property display_name
-
+
### classmethod `from_obj`
@@ -2703,7 +2725,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
### method `model_post_init`
@@ -2713,7 +2735,7 @@ model_post_init(context: Any) → None
---
-
+
### method `score`
@@ -2723,7 +2745,7 @@ score(output: Any, **kwargs: Any) → Any
---
-
+
### method `summarize`
@@ -2733,14 +2755,14 @@ summarize(score_rows: list) → dict | None
---
-
+
## class `Session`
Deprecated alias of :class:`weave.Conversation`.
Accepts the old ``session_id`` / ``session_name`` constructor fields and also exposes them as read/write properties that proxy to ``conversation_id`` / ``conversation_name``. The original ``Session`` had these as model fields, so old code that reads or assigns ``s.session_id`` keeps working.
-
+
### method `__init__`
@@ -2773,11 +2795,21 @@ Deprecated alias of :attr:`conversation_name`.
---
-
+
## class `StringPrompt`
+A prompt template for plain text prompts.
+
+Add variables in braces, then pass values for those variables to `format` to produce the final prompt text.
+
+**Example:**
+ prompt = StringPrompt("Hello {name}") prompt.format(name="Ada") 'Hello Ada'
+
+**Raises:**
+
+ - `KeyError`: If you call `format` without a required template variable.
-
+
### method `__init__`
@@ -2792,7 +2824,7 @@ __init__(content: str)
- `ref`: `trace.refs.ObjectRef | None`
- `content`: ``
-
+
### method `format`
@@ -2802,7 +2834,7 @@ format(**kwargs: Any) → str
---
-
+
### classmethod `from_obj`
@@ -2812,7 +2844,7 @@ from_obj(obj: WeaveObject) → Self
---
-
+
## class `SubAgent`
A delegated agent invocation within a turn.
@@ -2830,7 +2862,7 @@ Maps to a nested invoke_agent OTel span in the same trace.
- `started_at`: `datetime.datetime | None`
- `ended_at`: `datetime.datetime | None`
-
+
### method `add_event`
@@ -2854,7 +2886,7 @@ Must be called between span start and span end (inside ``with``). Outside that w
---
-
+
### method `end`
@@ -2864,7 +2896,7 @@ end() → None
---
-
+
### method `llm`
@@ -2876,13 +2908,11 @@ llm(
) → LLM
```
-Start an LLM call within this sub-agent.
-
-Sets the ``_current_llm`` contextvar so the LLM is visible via ``get_current_llm()`` regardless of whether a context manager is used.
+Deprecated alias for :meth:`start_llm`.
---
-
+
### method `record`
@@ -2905,7 +2935,7 @@ Note: on the streaming (``with``) path the sub-agent span is named from ``name``
---
-
+
### method `set_attributes`
@@ -2921,7 +2951,53 @@ Must be called between span start and span end — i.e. inside a ``with`` block.
---
-
+
+
+### method `start_llm`
+
+```python
+start_llm(
+ model: 'str' = '',
+ provider_name: 'str' = '',
+ system_instructions: 'list[str] | None' = None
+) → LLM
+```
+
+Start an LLM call within this sub-agent.
+
+Sets the ``_current_llm`` contextvar so the LLM is visible via ``get_current_llm()`` regardless of whether a context manager is used. Pins the LLM's OTel parent to this SubAgent's span when the SubAgent has been entered.
+
+---
+
+
+
+### method `start_subagent`
+
+```python
+start_subagent(name: 'str', model: 'str' = '') → SubAgent
+```
+
+Start a nested sub-agent under this one.
+
+Pins the nested SubAgent's OTel parent to this SubAgent's span when this SubAgent has been entered.
+
+---
+
+
+
+### method `start_tool`
+
+```python
+start_tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool
+```
+
+Start a tool execution within this sub-agent.
+
+Pins the Tool's OTel parent to this SubAgent's span when the SubAgent has been entered.
+
+---
+
+
### method `tool`
@@ -2929,15 +3005,15 @@ Must be called between span start and span end — i.e. inside a ``with`` block.
tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool
```
-Start a tool execution within this sub-agent.
+Deprecated alias for :meth:`start_tool`.
---
-
+
## class `Table`
-
+
### method `__init__`
@@ -2951,7 +3027,7 @@ __init__(rows: 'list[dict]') → None
---
-
+
### method `append`
@@ -2963,7 +3039,7 @@ Add a row to the table.
---
-
+
### method `pop`
@@ -2975,7 +3051,7 @@ Remove a row at the given index from the table.
---
-
+
## class `ContextAwareThread`
A Thread that runs functions with the context of the caller.
@@ -2995,7 +3071,7 @@ thread = threading.Thread(target=run_with_context(your_func, *args, **kwargs))
thread.start()
```
-
+
### method `__init__`
@@ -3039,7 +3115,7 @@ This is a non-negative integer. See the get_native_id() function. This represent
---
-
+
### method `run`
@@ -3049,12 +3125,12 @@ run() → None
---
-
+
## class `ThreadContext`
Context object providing access to current thread and turn information.
-
+
### method `__init__`
@@ -3088,7 +3164,7 @@ Get the current turn_id from the active context.
---
-
+
## class `ContextAwareThreadPoolExecutor`
A ThreadPoolExecutor that runs functions with the context of the caller.
@@ -3107,7 +3183,7 @@ with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(_wrapped_fn, vals)
```
-
+
### method `__init__`
@@ -3117,7 +3193,7 @@ __init__(*args: 'Any', **kwargs: 'Any') → None
---
-
+
### method `map`
@@ -3132,7 +3208,7 @@ map(
---
-
+
### method `submit`
@@ -3142,7 +3218,7 @@ submit(fn: 'Callable', *args: 'Any', **kwargs: 'Any') → Any
---
-
+
## class `Tool`
One tool execution. Maps to an execute_tool OTel span.
@@ -3162,7 +3238,7 @@ One tool execution. Maps to an execute_tool OTel span.
- `started_at`: `datetime.datetime | None`
- `ended_at`: `datetime.datetime | None`
-
+
### method `add_event`
@@ -3186,7 +3262,7 @@ Must be called between span start and span end (inside ``with``). Outside that w
---
-
+
### method `end`
@@ -3196,7 +3272,7 @@ end() → None
---
-
+
### method `set_attributes`
@@ -3212,7 +3288,7 @@ Must be called between span start and span end — i.e. inside a ``with`` block.
---
-
+
## class `Turn`
One user-agent exchange. Maps to an invoke_agent OTel span.
@@ -3228,12 +3304,13 @@ By default each turn starts its own OTel trace (``continue_parent_trace=False``)
- `agent_version`: ``
- `system_instructions`: `list[str]`
- `messages`: `list[conversation.types.Message]`
+- `output_messages`: `list[conversation.types.Message]`
- `spans`: `list[conversation.conversation.LLM | conversation.conversation.Tool | conversation.conversation.SubAgent]`
- `continue_parent_trace`: ``
- `started_at`: `datetime.datetime | None`
- `ended_at`: `datetime.datetime | None`
-
+
### method `add_event`
@@ -3257,7 +3334,7 @@ Must be called between span start and span end (inside ``with``). Outside that w
---
-
+
### method `end`
@@ -3267,7 +3344,7 @@ end() → None
---
-
+
### method `llm`
@@ -3279,13 +3356,11 @@ llm(
) → LLM
```
-Start an LLM call (chat span, child of this turn).
-
-Sets the ``_current_llm`` contextvar so the LLM is visible via ``get_current_llm()`` regardless of whether a context manager is used.
+Deprecated alias for :meth:`start_llm`.
---
-
+
### method `model_post_init`
@@ -3295,13 +3370,14 @@ model_post_init(context: 'Any') → None
---
-
+
### method `record`
```python
record(
messages: 'list[Message] | None' = None,
+ output_messages: 'list[Message] | None' = None,
system_instructions: 'list[str] | None' = None,
agent_name: 'str | None' = None,
model: 'str | None' = None,
@@ -3313,13 +3389,13 @@ record(
Set multiple turn fields in one call.
-Collapses the per-field assignments a manually-instrumented agent otherwise makes on a turn (``system_instructions``, ``agent_id``, ...) into a single keyword call. Only fields explicitly passed (non-``None``) are applied — existing values are preserved. ``messages`` **replaces** the turn's existing messages (unlike ``Turn.user(...)``, which appends a single message). Returns ``self`` for chaining. Mirrors ``LLM.record``.
+Collapses the per-field assignments a manually-instrumented agent otherwise makes on a turn (``system_instructions``, ``agent_id``, ...) into a single keyword call. Only fields explicitly passed (non-``None``) are applied — existing values are preserved. ``messages`` and ``output_messages`` independently replace the turn's existing input and output messages. This differs from ``Turn.user(...)``, which appends a single input message. Returns ``self`` for chaining. Mirrors ``LLM.record``.
Note: on the streaming (``with``) path the turn span is named from ``agent_name`` at ``__enter__``, so set ``agent_name`` via ``start_turn`` rather than ``record`` if you need the span name to reflect it; ``record`` still updates the ``gen_ai.agent.name`` attribute.
---
-
+
### method `set_attributes`
@@ -3335,7 +3411,53 @@ Must be called between span start and span end — i.e. inside a ``with`` block.
---
-
+
+
+### method `start_llm`
+
+```python
+start_llm(
+ model: 'str' = '',
+ provider_name: 'str' = '',
+ system_instructions: 'list[str] | None' = None
+) → LLM
+```
+
+Start an LLM call (chat span, child of this turn).
+
+Sets the ``_current_llm`` contextvar so the LLM is visible via ``get_current_llm()`` regardless of whether a context manager is used.
+
+---
+
+
+
+### method `start_subagent`
+
+```python
+start_subagent(
+ name: 'str',
+ model: 'str' = '',
+ system_instructions: 'list[str] | None' = None
+) → SubAgent
+```
+
+Start a sub-agent invocation (nested invoke_agent span, same trace).
+
+---
+
+
+
+### method `start_tool`
+
+```python
+start_tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool
+```
+
+Start a tool execution (execute_tool span, child of this turn).
+
+---
+
+
### method `subagent`
@@ -3347,11 +3469,11 @@ subagent(
) → SubAgent
```
-Start a sub-agent invocation (nested invoke_agent span, same trace).
+Deprecated alias for :meth:`start_subagent`.
---
-
+
### method `tool`
@@ -3359,11 +3481,11 @@ Start a sub-agent invocation (nested invoke_agent span, same trace).
tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool
```
-Start a tool execution (execute_tool span, child of this turn).
+Deprecated alias for :meth:`start_tool`.
---
-
+
### method `user`
@@ -3375,7 +3497,7 @@ Append a user message mid-turn.
---
-
+
## class `Usage`
Token usage for an LLM call.
@@ -3390,7 +3512,7 @@ Token usage for an LLM call.
---
-
+
### function `add_tags`
@@ -3405,7 +3527,7 @@ Add tags to an object version.
---
-
+
### function `as_op`
@@ -3428,7 +3550,7 @@ Given a @weave.op decorated function, return its Op.
---
-
+
### function `attributes`
@@ -3446,7 +3568,7 @@ with weave.attributes({'env': 'production'}):
---
-
+
### function `end_conversation`
@@ -3458,7 +3580,7 @@ End the current conversation (from contextvar).
---
-
+
### function `end_llm`
@@ -3470,7 +3592,7 @@ End the current LLM call (from contextvar).
---
-
+
### function `end_session`
@@ -3482,7 +3604,7 @@ Deprecated alias of :func:`weave.end_conversation`.
---
-
+
### function `end_turn`
@@ -3494,7 +3616,7 @@ End the current turn (from contextvar).
---
-
+
### function `finish`
@@ -3508,7 +3630,7 @@ Following finish, calls of weave.op decorated functions will no longer be logged
---
-
+
### function `get`
@@ -3538,7 +3660,7 @@ dataset2 = weave.get(ref) # same as dataset!
---
-
+
### function `get_aliases`
@@ -3557,7 +3679,7 @@ Get aliases for an object version.
---
-
+
### function `get_client`
@@ -3567,7 +3689,7 @@ get_client() → WeaveClient | None
---
-
+
### function `get_current_call`
@@ -3586,7 +3708,7 @@ Get the Call object for the currently executing Op, within that Op.
---
-
+
### function `get_current_conversation`
@@ -3598,7 +3720,7 @@ Return the active conversation from contextvar, or None.
---
-
+
### function `get_current_llm`
@@ -3610,7 +3732,7 @@ Return the active LLM call from contextvar, or None.
---
-
+
### function `get_current_session`
@@ -3622,7 +3744,7 @@ Deprecated alias of :func:`weave.get_current_conversation`.
---
-
+
### function `get_current_turn`
@@ -3634,7 +3756,7 @@ Return the active turn from contextvar, or None.
---
-
+
### function `get_tags`
@@ -3653,7 +3775,7 @@ Get tags for an object version.
---
-
+
### function `get_tags_and_aliases`
@@ -3672,7 +3794,7 @@ Get both tags and aliases for an object version in a single call.
---
-
+
### function `init`
@@ -3719,7 +3841,7 @@ NOTE: Client-level postprocessing runs after each op's own postprocessing. The o
---
-
+
### function `link_prompt_to_registry`
@@ -3745,7 +3867,7 @@ Link a published prompt version into the registry.
---
-
+
### function `list_aliases`
@@ -3760,7 +3882,7 @@ List all distinct aliases in the project.
---
-
+
### function `list_tags`
@@ -3775,7 +3897,7 @@ List all distinct tags in the project.
---
-
+
### function `log_call`
@@ -3862,7 +3984,7 @@ import weave
---
-
+
### function `log_conversation`
@@ -3890,7 +4012,7 @@ Each Turn's ``.spans`` attribute provides its children. Auto-generates ``convers
---
-
+
### function `log_session`
@@ -3913,7 +4035,7 @@ Deprecated alias of :func:`weave.log_conversation`.
---
-
+
### function `log_turn`
@@ -3927,6 +4049,7 @@ log_turn(
agent_description: 'str' = '',
agent_version: 'str' = '',
messages: 'list[Message] | None' = None,
+ output_messages: 'list[Message] | None' = None,
system_instructions: 'list[str] | None' = None,
spans: 'list[LLM | Tool | SubAgent] | None' = None,
started_at: 'datetime | None' = None,
@@ -3943,9 +4066,11 @@ Use when context managers aren't viable (stateless containers, callbacks, queue
``attributes`` are stamped on every emitted span; the streaming path reads these from the active conversation instead. Use custom, non-semconv keys: a key that collides with a span's own ``gen_ai.*`` / ``weave.*`` attribute is unsupported (which value wins is path-dependent).
+``messages`` records the turn input and ``output_messages`` records the terminal agent response on the same ``invoke_agent`` span.
+
---
-
+
### function `op`
@@ -3973,7 +4098,7 @@ A decorator to weave op-ify a function or method. Works for both sync and async.
---
-
+
### function `otel_traces_endpoint`
@@ -4000,7 +4125,7 @@ External callers (e.g. boot-time probes that want to verify the ingest endpoint
---
-
+
### function `publish`
@@ -4030,7 +4155,7 @@ Weave creates a new version of the object if the object's name already exists an
---
-
+
### function `ref`
@@ -4049,7 +4174,7 @@ Creates a Ref to an existing Weave object. This does not directly retrieve the o
---
-
+
### function `remove_aliases`
@@ -4064,7 +4189,7 @@ Remove one or more aliases from an object.
---
-
+
### function `remove_tags`
@@ -4081,7 +4206,7 @@ Remove tags from an object version.
---
-
+
### function `require_current_call`
@@ -4132,7 +4257,7 @@ print(call.id)
---
-
+
### function `set_aliases`
@@ -4147,7 +4272,7 @@ Set one or more aliases for an object version.
---
-
+
### function `set_view`
@@ -4189,7 +4314,7 @@ Attach a custom view to the current call summary at `_weave.views.`.
---
-
+
### function `start_conversation`
@@ -4211,7 +4336,7 @@ Create and activate a conversation. Sets the contextvar for cross-module access.
---
-
+
### function `start_llm`
@@ -4231,7 +4356,7 @@ Pass ``provider_name`` explicitly. The SDK does not infer it from the model iden
---
-
+
### function `start_session`
@@ -4253,7 +4378,7 @@ Deprecated alias of :func:`weave.start_conversation`.
---
-
+
### function `start_subagent`
@@ -4271,7 +4396,7 @@ The SubAgent's OTel span automatically becomes a child of whatever span is curre
---
-
+
### function `start_tool`
@@ -4285,7 +4410,7 @@ The Tool's OTel span automatically becomes a child of whatever span is current i
---
-
+
### function `start_turn`
@@ -4304,13 +4429,13 @@ If no conversation is active, returns a disconnected Turn that is NOT set in the
---
-
+
### function `thread`
```python
thread(
- thread_id: 'str | object | None' =