From bcefa56eedb1d0f2629708c326d10a6542f33be5 Mon Sep 17 00:00:00 2001 From: dbrian57 <17599248+dbrian57@users.noreply.github.com> Date: Thu, 28 May 2026 15:24:45 +0000 Subject: [PATCH 1/5] chore: Update reference documentation (Weave 0.52.41) --- weave/reference/python-sdk.mdx | 1287 ++++++++++++++--- weave/reference/python-sdk/trace/feedback.mdx | 34 +- weave/reference/python-sdk/trace/op.mdx | 38 +- weave/reference/python-sdk/trace/util.mdx | 22 +- .../python-sdk/trace/weave_client.mdx | 128 +- .../trace_server/trace_server_interface.mdx | 1281 ++++++++++------ .../remote_http_trace_server.mdx | 249 ++-- weave/reference/service-api.mdx | 81 +- weave/reference/service-api/openapi.json | 52 + weave/reference/typescript-sdk.mdx | 36 + .../typescript-sdk/classes/dataset.mdx | 20 +- .../typescript-sdk/classes/evaluation.mdx | 14 +- .../classes/evaluationlogger.mdx | 8 +- .../reference/typescript-sdk/classes/llm.mdx | 333 +++++ .../typescript-sdk/classes/messagesprompt.mdx | 16 +- .../typescript-sdk/classes/objectref.mdx | 16 +- .../typescript-sdk/classes/scorelogger.mdx | 8 +- .../typescript-sdk/classes/session.mdx | 109 ++ .../typescript-sdk/classes/stringprompt.mdx | 16 +- .../typescript-sdk/classes/subagent.mdx | 102 ++ .../reference/typescript-sdk/classes/tool.mdx | 130 ++ .../reference/typescript-sdk/classes/turn.mdx | 176 +++ .../typescript-sdk/classes/weaveclient.mdx | 136 +- .../typescript-sdk/classes/weaveobject.mdx | 10 +- .../createopenaiagentstracingprocessor.mdx | 2 +- .../functions/createotelextension.mdx | 51 + .../typescript-sdk/functions/endllm.mdx | 20 + .../typescript-sdk/functions/endsession.mdx | 20 + .../typescript-sdk/functions/endturn.mdx | 20 + .../typescript-sdk/functions/flushotel.mdx | 29 + .../functions/getcurrentllm.mdx | 20 + .../functions/getcurrentsession.mdx | 20 + .../functions/getcurrentturn.mdx | 20 + .../typescript-sdk/functions/init.mdx | 4 +- .../functions/instrumentopenaiagents.mdx | 4 +- .../typescript-sdk/functions/login.mdx | 2 +- .../reference/typescript-sdk/functions/op.mdx | 10 +- .../functions/patchrealtimesession.mdx | 11 +- .../requirecurrentcallstackentry.mdx | 2 +- .../functions/requirecurrentchildsummary.mdx | 2 +- .../typescript-sdk/functions/runisolated.mdx | 45 + .../typescript-sdk/functions/startllm.mdx | 27 + .../typescript-sdk/functions/startsession.mdx | 27 + .../functions/startsubagent.mdx | 26 + .../typescript-sdk/functions/starttool.mdx | 31 + .../typescript-sdk/functions/startturn.mdx | 27 + .../typescript-sdk/functions/weaveaudio.mdx | 2 +- .../typescript-sdk/functions/weaveimage.mdx | 2 +- .../functions/withattributes.mdx | 2 +- .../functions/wrapgooglegenai.mdx | 2 +- .../typescript-sdk/functions/wrapopenai.mdx | 2 +- .../typescript-sdk/interfaces/callschema.mdx | 32 +- .../typescript-sdk/interfaces/callsfilter.mdx | 18 +- .../interfaces/getcallsoptions.mdx | 112 ++ .../typescript-sdk/interfaces/llminit.mdx | 35 + .../typescript-sdk/interfaces/message.mdx | 68 + .../typescript-sdk/interfaces/query.mdx | 28 + .../typescript-sdk/interfaces/reasoning.mdx | 24 + .../typescript-sdk/interfaces/sessioninit.mdx | 49 + .../typescript-sdk/interfaces/sortby.mdx | 41 + .../interfaces/subagentinit.mdx | 35 + .../typescript-sdk/interfaces/toolinit.mdx | 46 + .../typescript-sdk/interfaces/turninit.mdx | 35 + .../typescript-sdk/interfaces/usage.mdx | 68 + .../typescript-sdk/interfaces/weaveaudio.mdx | 6 +- .../typescript-sdk/interfaces/weaveimage.mdx | 6 +- .../type-aliases/messagepart.mdx | 14 + .../typescript-sdk/type-aliases/modality.mdx | 14 + .../typescript-sdk/type-aliases/op.mdx | 2 +- .../type-aliases/opdecorator.mdx | 17 +- .../typescript-sdk/type-aliases/role.mdx | 43 + 71 files changed, 4323 insertions(+), 1102 deletions(-) create mode 100644 weave/reference/typescript-sdk/classes/llm.mdx create mode 100644 weave/reference/typescript-sdk/classes/session.mdx create mode 100644 weave/reference/typescript-sdk/classes/subagent.mdx create mode 100644 weave/reference/typescript-sdk/classes/tool.mdx create mode 100644 weave/reference/typescript-sdk/classes/turn.mdx create mode 100644 weave/reference/typescript-sdk/functions/createotelextension.mdx create mode 100644 weave/reference/typescript-sdk/functions/endllm.mdx create mode 100644 weave/reference/typescript-sdk/functions/endsession.mdx create mode 100644 weave/reference/typescript-sdk/functions/endturn.mdx create mode 100644 weave/reference/typescript-sdk/functions/flushotel.mdx create mode 100644 weave/reference/typescript-sdk/functions/getcurrentllm.mdx create mode 100644 weave/reference/typescript-sdk/functions/getcurrentsession.mdx create mode 100644 weave/reference/typescript-sdk/functions/getcurrentturn.mdx create mode 100644 weave/reference/typescript-sdk/functions/runisolated.mdx create mode 100644 weave/reference/typescript-sdk/functions/startllm.mdx create mode 100644 weave/reference/typescript-sdk/functions/startsession.mdx create mode 100644 weave/reference/typescript-sdk/functions/startsubagent.mdx create mode 100644 weave/reference/typescript-sdk/functions/starttool.mdx create mode 100644 weave/reference/typescript-sdk/functions/startturn.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/getcallsoptions.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/llminit.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/message.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/query.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/reasoning.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/sessioninit.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/sortby.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/subagentinit.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/toolinit.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/turninit.mdx create mode 100644 weave/reference/typescript-sdk/interfaces/usage.mdx create mode 100644 weave/reference/typescript-sdk/type-aliases/messagepart.mdx create mode 100644 weave/reference/typescript-sdk/type-aliases/modality.mdx create mode 100644 weave/reference/typescript-sdk/type-aliases/role.mdx diff --git a/weave/reference/python-sdk.mdx b/weave/reference/python-sdk.mdx index 88f740f5f5..3d1961a1f5 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: dict[str, Any]) → dict[str, 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,93 @@ Create an Audio object from a file path. --- - + + +## class `ClassifierMonitor` +A monitor that merges multiple scorers into a single classifier. + +Classifier monitors combine prompts from multiple LLMAsAJudgeScorers targeting the same model into a single scoring call. + +**Pydantic Fields:** + +- `name`: `str | None` +- `description`: `str | None` +- `ref`: `trace.refs.ObjectRef | None` +- `sampling_rate`: `` +- `scorers`: `list[flow.scorer.Scorer]` +- `op_names`: `list[typing.Union[typing.Literal['genai.turn_ended'], str]]` +- `query`: `trace_server.interface.query.Query | None` +- `is_traced`: `` +- `active`: `` +- `scorer_debounce_config`: `flow.monitor.ScorerDebounceConfig | None` +- `prompt_header`: `str | None` +- `prompt_footer`: `str | None` + + + +### method `activate` + +```python +activate() → ObjectRef +``` + +Activates the monitor. + +**Returns:** + The ref to the monitor. + +--- + + + +### method `deactivate` + +```python +deactivate() → ObjectRef +``` + +Deactivates the monitor. + +**Returns:** + The ref to the monitor. + +--- + + + +### classmethod `from_obj` + +```python +from_obj(obj: WeaveObject) → Self +``` + +--- + + + +### method `get_prompt_footer` + +```python +get_prompt_footer() → str +``` + +Text to append after the merged classifier prompts. + +--- + + + +### method `get_prompt_header` + +```python +get_prompt_header(op_name: str) → str +``` + +Text to prepend before the merged classifier prompts. + +--- + + ## class `Content` A class to represent content from various sources, resolving them to a unified byte-oriented representation with associated metadata. @@ -223,7 +309,7 @@ This class must be instantiated using one of its classmethods: - from_base64() - from_data_url() - + ### method `__init__` @@ -254,7 +340,7 @@ Direct initialization is disabled. Please use a classmethod like `Content.from_p --- - + ### method `as_string` @@ -269,7 +355,7 @@ Display the data as a string. Bytes are decoded using the `encoding` attribute I --- - + ### classmethod `from_base64` @@ -286,7 +372,7 @@ Initializes Content from a base64 encoded string or bytes. --- - + ### classmethod `from_bytes` @@ -304,7 +390,7 @@ Initializes Content from raw bytes. --- - + ### classmethod `from_data_url` @@ -316,7 +402,7 @@ Initializes Content from a data URL. --- - + ### classmethod `from_path` @@ -333,7 +419,7 @@ Initializes Content from a local file path. --- - + ### classmethod `from_text` @@ -351,7 +437,7 @@ Initializes Content from a string of text. --- - + ### classmethod `from_url` @@ -370,7 +456,7 @@ Downloads the content, infers mimetype/extension from headers, URL path, and dat --- - + ### classmethod `model_validate` @@ -390,7 +476,7 @@ Override model_validate to handle Content reconstruction from dict. --- - + ### classmethod `model_validate_json` @@ -409,7 +495,7 @@ Override model_validate_json to handle Content reconstruction from JSON. --- - + ### method `open` @@ -427,7 +513,7 @@ This method uses the platform-specific mechanism to open the file with the defau --- - + ### method `save` @@ -442,7 +528,7 @@ Copy the file to the specified destination path. Updates the filename and the pa --- - + ### method `serialize_data` @@ -454,7 +540,7 @@ When dumping model in json mode --- - + ### method `to_data_url` @@ -474,7 +560,7 @@ Constructs a data URL from the content. --- - + ## class `Dataset` Dataset object with easy saving and automatic versioning. @@ -505,7 +591,7 @@ example_label = dataset_ref.rows[2]['sentence'] - `ref`: `trace.refs.ObjectRef | None` - `rows`: `trace.table.Table | trace.vals.WeaveTable` - + ### method `add_rows` @@ -526,7 +612,7 @@ This is useful for adding examples to large datasets without having to load the --- - + ### classmethod `convert_to_table` @@ -536,7 +622,7 @@ convert_to_table(rows: Any) → Table | WeaveTable --- - + ### classmethod `from_calls` @@ -546,19 +632,17 @@ from_calls(calls: Iterable[Call]) → Self --- - + ### classmethod `from_hf` ```python -from_hf( - hf_dataset: Union[ForwardRef('HFDataset'), ForwardRef('HFDatasetDict')] -) → Self +from_hf(hf_dataset: 'HFDataset | HFDatasetDict') → Self ``` --- - + ### classmethod `from_obj` @@ -568,7 +652,7 @@ from_obj(obj: WeaveObject) → Self --- - + ### classmethod `from_pandas` @@ -578,7 +662,7 @@ from_pandas(df: 'DataFrame') → Self --- - + ### method `select` @@ -597,7 +681,7 @@ Select rows from the dataset based on the provided indices. --- - + ### method `to_hf` @@ -607,7 +691,7 @@ to_hf() → HFDataset --- - + ### method `to_pandas` @@ -617,11 +701,11 @@ to_pandas() → DataFrame --- - + ## class `EasyPrompt` - + ### method `__init__` @@ -677,7 +761,7 @@ Join all messages into a system prompt object. --- - + ### method `append` @@ -687,7 +771,7 @@ append(item: Any, role: str | None = None, dedent: bool = False) → None --- - + ### method `as_dict` @@ -697,7 +781,7 @@ as_dict() → dict[str, Any] --- - + ### method `as_pydantic_dict` @@ -707,7 +791,7 @@ as_pydantic_dict() → dict[str, Any] --- - + ### method `bind` @@ -717,7 +801,7 @@ bind(*args: Any, **kwargs: Any) → Prompt --- - + ### method `bind_rows` @@ -727,7 +811,7 @@ bind_rows(dataset: list[dict] | Any) → list['Prompt'] --- - + ### method `config_table` @@ -737,7 +821,7 @@ config_table(title: str | None = None) → Table --- - + ### method `configure` @@ -747,7 +831,7 @@ configure(config: dict | None = None, **kwargs: Any) → Prompt --- - + ### method `dump` @@ -757,7 +841,7 @@ dump(fp: ) → None --- - + ### method `dump_file` @@ -767,7 +851,7 @@ dump_file(filepath: str | Path) → None --- - + ### method `format` @@ -777,7 +861,7 @@ format(**kwargs: Any) → Any --- - + ### classmethod `from_obj` @@ -787,7 +871,7 @@ from_obj(obj: WeaveObject) → Self --- - + ### classmethod `load` @@ -797,7 +881,7 @@ load(fp: ) → Self --- - + ### classmethod `load_file` @@ -807,7 +891,7 @@ load_file(filepath: str | Path) → Self --- - + ### method `messages_table` @@ -817,7 +901,7 @@ messages_table(title: str | None = None) → Table --- - + ### method `print` @@ -827,7 +911,7 @@ print() → str --- - + ### method `publish` @@ -841,7 +925,7 @@ publish( --- - + ### method `require` @@ -851,7 +935,7 @@ require(param_name: str, **kwargs: Any) → Prompt --- - + ### method `run` @@ -861,7 +945,7 @@ run() → Any --- - + ### method `validate_requirement` @@ -871,7 +955,7 @@ validate_requirement(key: str, value: Any) → list --- - + ### method `validate_requirements` @@ -881,7 +965,7 @@ validate_requirements(values: dict[str, Any]) → list --- - + ### method `values_table` @@ -891,7 +975,7 @@ values_table(title: str | None = None) → Table --- - + ## class `Evaluation` Sets up an evaluation which includes a set of scorers and a dataset. @@ -939,13 +1023,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` @@ -955,7 +1039,7 @@ evaluate(model: Op | Model) → dict --- - + ### classmethod `from_obj` @@ -965,7 +1049,7 @@ from_obj(obj: WeaveObject) → Self --- - + ### method `get_eval_results` @@ -975,7 +1059,7 @@ get_eval_results(model: Op | Model) → EvaluationResults --- - + ### method `get_evaluate_calls` @@ -1006,7 +1090,7 @@ for call in calls: --- - + ### method `get_score_calls` @@ -1034,7 +1118,7 @@ for trace_id, calls in score_calls.items(): --- - + ### method `get_scores` @@ -1076,17 +1160,17 @@ Expected output: --- - + ### method `model_post_init` ```python -model_post_init(_Evaluation__context: Any) → None +model_post_init(context: Any) → None ``` --- - + ### method `predict_and_score` @@ -1096,7 +1180,7 @@ predict_and_score(model: Op | Model, example: dict) → dict --- - + ### method `summarize` @@ -1106,7 +1190,7 @@ summarize(eval_table: EvaluationResults) → dict --- - + ## class `EvaluationLogger` This class provides an imperative interface for logging evaluations. @@ -1145,7 +1229,7 @@ with ev.log_prediction(inputs={'q': 'Hello'}) as pred: ev.log_summary({"avg_score": 0.9}) ``` - + ### method `__init__` @@ -1169,7 +1253,7 @@ __init__( --- - + ### method `fail` @@ -1181,7 +1265,7 @@ Convenience method to fail the evaluation with an exception. --- - + ### method `finish` @@ -1195,7 +1279,7 @@ Ensures all prediction calls and the main evaluation call are finalized. This is --- - + ### method `log_example` @@ -1229,7 +1313,7 @@ ev.log_example( --- - + ### method `log_prediction` @@ -1257,7 +1341,7 @@ Example (context manager): --- - + ### method `log_summary` @@ -1271,7 +1355,7 @@ This will calculate the summary, call the summarize op, and then finalize the ev --- - + ### method `set_view` @@ -1309,12 +1393,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__` @@ -1341,7 +1425,7 @@ Get the filename of the file. --- - + ### method `open` @@ -1359,7 +1443,7 @@ This method uses the platform-specific mechanism to open the file with the defau --- - + ### method `save` @@ -1374,12 +1458,160 @@ Copy the file to the specified destination path. --- - + + +## class `LLM` +One LLM API call. Maps to a chat OTel span. + + - `dest`: Destination path where the file will be copied to (string or pathlib.Path) The destination path can be a file or a directory. +**Pydantic Fields:** + +- `model`: `` +- `provider_name`: `` +- `response_id`: `` +- `response_model`: `` +- `output_type`: `` +- `system_instructions`: `list[str]` +- `usage`: `` +- `reasoning`: `` +- `finish_reasons`: `list[str]` +- `input_messages`: `list[session.types.Message]` +- `output_messages`: `list[session.types.Message]` +- `media_attachments`: `list[session.types.MediaAttachment]` +- `request_temperature`: `float | None` +- `request_max_tokens`: `int | None` +- `request_top_p`: `float | None` +- `request_frequency_penalty`: `float | None` +- `request_presence_penalty`: `float | None` +- `request_seed`: `int | None` +- `request_stop_sequences`: `list[str]` +- `request_choice_count`: `int | None` +- `started_at`: `datetime.datetime | None` +- `ended_at`: `datetime.datetime | None` + + + +### method `attach_media` + +```python +attach_media( + content: 'bytes | str' = '', + uri: 'str' = '', + file_id: 'str' = '', + mime_type: 'str' = '', + modality: 'str' = '' +) → LLM +``` + +Attach media to this LLM call. + +Exactly one of content, uri, or file_id must be provided. Modality is inferred from mime_type when not set explicitly. + +--- + + + +### method `attach_media_url` + +```python +attach_media_url(url: 'str', modality: 'str' = '') → LLM +``` + +Attach a media URL to this LLM call. + +Convenience over ``attach_media`` for the common case where the caller has a URL string from an upstream message and doesn't want to inspect it. ``data:`` URLs are parsed into ``mime_type`` + inline content (kind=blob); plain URIs become ``kind=uri``. Empty URLs are ignored. Returns ``self`` for chaining. + +--- + + + +### method `end` + +```python +end() → None +``` + +--- + + + +### method `model_post_init` + +```python +model_post_init(context: 'Any') → None +``` + +--- + + + +### method `output` + +```python +output(content: 'str') → LLM +``` + +Append an assistant message to output_messages. + +--- + + + +### method `record` + +```python +record( + input_messages: 'list[Message] | None' = None, + output_messages: 'list[Message] | None' = None, + media_attachments: 'list[MediaAttachment] | None' = None, + usage: 'Usage | None' = None, + reasoning: 'Reasoning | str | None' = None, + response_id: 'str | None' = None, + response_model: 'str | None' = None, + finish_reasons: 'list[str] | None' = None, + output_type: 'str | None' = None +) → LLM +``` + +Set multiple LLM-call fields in one call. + +Manually-instrumented agents typically build up a chat span by assigning eight or more individual fields at the end of an LLM call (``input_messages``, ``output_messages``, ``usage``, ``response_id``, etc.). ``record(...)`` collapses those into a single keyword call so the recording site stays compact. + +Only fields explicitly passed (non-``None``) are applied — existing values are preserved. ``reasoning`` accepts either a ``Reasoning`` instance or a plain string (wrapped automatically). Returns ``self`` for chaining. + +--- + + + +### method `think` + +```python +think(content: 'str') → LLM +``` + +Set reasoning/chain-of-thought content. + +--- + + + +## class `LogResult` +Result of a batch log_* call. + +**Pydantic Fields:** + +- `session_id`: `` +- `trace_ids`: `list[str]` +- `root_span_ids`: `list[str]` +- `span_count`: `` + +--- + + ## class `Markdown` A Markdown renderable. - - `dest`: Destination path where the file will be copied to (string or pathlib.Path) The destination path can be a file or a directory. **Args:** - `markup` (str): A string containing markdown. @@ -1388,7 +1620,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__` @@ -1406,11 +1638,105 @@ __init__( --- - + + +## class `MediaAttachment` +A media attachment on an LLM call. + + - `inline_code_lexer`: (str, optional): Lexer to use if inline code highlighting is enabled. Defaults to None. + - `inline_code_theme`: (Optional[str], optional): Pygments theme for inline code highlighting, or None for no highlighting. Defaults to None. +**Pydantic Fields:** + +- `kind`: `typing.Literal['blob', 'uri', 'file']` +- `modality`: `` +- `mime_type`: `` +- `content`: `bytes | str` +- `uri`: `` +- `file_id`: `` + +--- + + + +## class `Message` +A single message in a conversation. + +Two construction styles are supported: + +1. Flat (back-compat, ergonomic for plain text): ``Message(role="assistant", content="Hi there")`` + +2. Explicit parts (richer — supports tool calls, mixed reasoning+text, inline media): ``Message(role="assistant", parts=[TextPart(content="Let me check"), ToolCallPart(id="c1", name="get_weather", arguments='{...}')])`` + +When ``parts`` is non-empty it is the canonical representation. When empty, the serializer synthesizes a single TextPart (or ToolCallResponsePart for ``role="tool"``) from the flat fields. + +**Pydantic Fields:** + +- `role`: `typing.Literal['user', 'assistant', 'system', 'tool']` +- `content`: `` +- `tool_call_id`: `` +- `tool_name`: `` +- `parts`: `list[typing.Annotated[session.types.TextPart | session.types.ReasoningPart | session.types.ToolCallPart | session.types.ToolCallResponsePart | session.types.BlobPart | session.types.UriPart | session.types.FilePart, FieldInfo(annotation=NoneType, required=True, discriminator='type')]]` + + + +### classmethod `assistant` + +```python +assistant( + text: 'str' = '', + tool_calls: 'list[ToolCallPart] | None' = None +) → Message +``` + +Build an assistant message with optional text and tool calls. + +Use plain text for simple replies; pass ``tool_calls`` when the assistant requests one or more tools. When both are present the text is emitted as a leading ``TextPart`` followed by each ``ToolCallPart`` so the chat view renders them inline. + +--- + + + +### classmethod `system` + +```python +system(text: 'str') → Message +``` + +Build a system message from plain text. + +--- + + + +### classmethod `tool_result` + +```python +tool_result(call_id: 'str', output: 'Any') → Message +``` + +Build a tool-result message for a previously-requested tool call. + +``output`` may be a string, dict, list, scalar, or ``None`` — the underlying ``ToolCallResponsePart`` JSON-encodes non-strings. + +--- + + + +### classmethod `user` + +```python +user(text: 'str') → Message +``` + +Build a user message from plain text. + +--- + + ## class `MessagesPrompt` - + ### method `__init__` @@ -1418,8 +1744,6 @@ __init__( __init__(messages: list[dict]) ``` - - `inline_code_lexer`: (str, optional): Lexer to use if inline code highlighting is enabled. Defaults to None. - - `inline_code_theme`: (Optional[str], optional): Pygments theme for inline code highlighting, or None for no highlighting. Defaults to None. **Pydantic Fields:** - `name`: `str | None` @@ -1427,7 +1751,7 @@ __init__(messages: list[dict]) - `ref`: `trace.refs.ObjectRef | None` - `messages`: `list[dict]` - + ### method `format` @@ -1437,7 +1761,7 @@ format(**kwargs: Any) → list --- - + ### method `format_message` @@ -1451,7 +1775,7 @@ This method delegates to the standalone format_message_with_template_vars functi --- - + ### classmethod `from_obj` @@ -1461,7 +1785,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. @@ -1487,7 +1811,7 @@ class YourModel(Model): - `description`: `str | None` - `ref`: `trace.refs.ObjectRef | None` - + ### method `get_infer_method` @@ -1497,7 +1821,7 @@ get_infer_method() → Callable --- - + ## class `Monitor` Sets up a monitor to score incoming calls automatically. @@ -1540,13 +1864,13 @@ my_monitor.activate() - `ref`: `trace.refs.ObjectRef | None` - `sampling_rate`: `` - `scorers`: `list[flow.scorer.Scorer]` -- `op_names`: `list[str]` +- `op_names`: `list[typing.Union[typing.Literal['genai.turn_ended'], str]]` - `query`: `trace_server.interface.query.Query | None` - `is_traced`: `` - `active`: `` - `scorer_debounce_config`: `flow.monitor.ScorerDebounceConfig | None` - + ### method `activate` @@ -1561,7 +1885,7 @@ Activates the monitor. --- - + ### method `deactivate` @@ -1576,7 +1900,7 @@ Deactivates the monitor. --- - + ### classmethod `from_obj` @@ -1586,7 +1910,7 @@ from_obj(obj: WeaveObject) → Self --- - + ## class `Object` Base class for Weave objects that can be tracked and versioned. @@ -1595,9 +1919,9 @@ This class extends Pydantic's BaseModel to provide Weave-specific functionality **Attributes:** - - `name` (Optional[str]): A human-readable name for the object. - - `description` (Optional[str]): A description of what the object represents. - - `ref` (Optional[ObjectRef]): A reference to the object in the Weave system. + - `name` (str | None): A human-readable name for the object. + - `description` (str | None): A description of what the object represents. + - `ref` (ObjectRef | None): A reference to the object in the Weave system. **Examples:** ```python @@ -1614,7 +1938,7 @@ obj = Object.from_uri("weave:///entity/project/object:digest") - `description`: `str | None` - `ref`: `trace.refs.ObjectRef | None` - + ### classmethod `from_uri` @@ -1644,7 +1968,7 @@ obj = MyObject.from_uri("weave:///entity/project/object:digest") --- - + ### classmethod `handle_relocatable_object` @@ -1681,12 +2005,26 @@ This validator handles special cases where the input is an ObjectRef or WeaveObj --- - + + +### classmethod `strip_weave_serialization_metadata` + +```python +strip_weave_serialization_metadata(data: Any) → Any +``` + +Strip weave serialization metadata from dict inputs. + +Weave's serialization adds _type, _class_name, and _bases to dicts for type reconstruction. These are not real model fields and must be removed before Pydantic validation, which uses extra="forbid". + +--- + + ## class `ObjectRef` ObjectRef(entity: 'str', project: 'str', name: 'str', _digest: 'str | Future[str]', _extra: 'tuple[str | Future[str], ...]' = ()) - + ### method `__init__` @@ -1710,7 +2048,11 @@ __init__( --- - +#### property is_digest_resolved + +--- + + ### method `as_param_dict` @@ -1720,7 +2062,7 @@ as_param_dict() → dict --- - + ### method `delete` @@ -1730,7 +2072,7 @@ delete() → None --- - + ### method `get` @@ -1740,7 +2082,7 @@ get(objectify: 'bool' = True) → Any --- - + ### method `is_descended_from` @@ -1750,7 +2092,7 @@ is_descended_from(potential_ancestor: 'ObjectRef') → bool --- - + ### method `maybe_parse_uri` @@ -1760,7 +2102,7 @@ maybe_parse_uri(s: 'str') → AnyRef | None --- - + ### method `parse_uri` @@ -1770,7 +2112,7 @@ parse_uri(uri: 'str') → ObjectRef --- - + ### method `with_attr` @@ -1780,7 +2122,7 @@ with_attr(attr: 'str') → Self --- - + ### method `with_extra` @@ -1790,7 +2132,7 @@ with_extra(extra: 'tuple[str | Future[str], ]') → Self --- - + ### method `with_index` @@ -1800,7 +2142,7 @@ with_index(index: 'int') → Self --- - + ### method `with_item` @@ -1810,7 +2152,7 @@ with_item(item_digest: 'str | Future[str]') → Self --- - + ### method `with_key` @@ -1820,7 +2162,7 @@ with_key(key: 'str') → Self --- - + ## class `Prompt` @@ -1830,7 +2172,7 @@ with_key(key: 'str') → Self - `description`: `str | None` - `ref`: `trace.refs.ObjectRef | None` - + ### method `format` @@ -1840,12 +2182,12 @@ format(**kwargs: Any) → Any --- - + ## class `SavedView` A fluent-style class for working with SavedView objects. - + ### method `__init__` @@ -1871,7 +2213,7 @@ __init__(view_type: 'str' = 'traces', label: 'str' = 'SavedView') → None --- - + ### method `add_column` @@ -1881,7 +2223,7 @@ add_column(path: 'str | ObjectPath', label: 'str | None' = None) → SavedView --- - + ### method `add_columns` @@ -1893,7 +2235,7 @@ Convenience method for adding multiple columns to the grid. --- - + ### method `add_filter` @@ -1907,7 +2249,7 @@ add_filter( --- - + ### method `add_sort` @@ -1917,7 +2259,7 @@ add_sort(field: 'str', direction: 'SortDirection') → SavedView --- - + ### method `column_index` @@ -1927,7 +2269,7 @@ column_index(path: 'int | str | ObjectPath') → int --- - + ### method `filter_op` @@ -1937,7 +2279,7 @@ filter_op(op_name: 'str | None') → SavedView --- - + ### method `get_calls` @@ -1955,7 +2297,7 @@ Get calls matching this saved view's filters and settings. --- - + ### method `get_known_columns` @@ -1967,7 +2309,7 @@ Get the set of columns that are known to exist. --- - + ### method `get_table_columns` @@ -1977,7 +2319,7 @@ get_table_columns() → list[TableColumn] --- - + ### method `hide_column` @@ -1987,7 +2329,7 @@ hide_column(col_name: 'str') → SavedView --- - + ### method `insert_column` @@ -2001,7 +2343,7 @@ insert_column( --- - + ### classmethod `load` @@ -2011,7 +2353,7 @@ load(ref: 'str') → Self --- - + ### method `page_size` @@ -2021,7 +2363,7 @@ page_size(page_size: 'int') → SavedView --- - + ### method `pin_column_left` @@ -2031,7 +2373,7 @@ pin_column_left(col_name: 'str') → SavedView --- - + ### method `pin_column_right` @@ -2041,7 +2383,7 @@ pin_column_right(col_name: 'str') → SavedView --- - + ### method `remove_column` @@ -2051,7 +2393,7 @@ remove_column(path: 'int | str | ObjectPath') → SavedView --- - + ### method `remove_columns` @@ -2063,7 +2405,7 @@ Remove columns from the saved view. --- - + ### method `remove_filter` @@ -2073,7 +2415,7 @@ remove_filter(index_or_field: 'int | str') → SavedView --- - + ### method `remove_filters` @@ -2085,7 +2427,7 @@ Remove all filters from the saved view. --- - + ### method `rename` @@ -2095,7 +2437,7 @@ rename(label: 'str') → SavedView --- - + ### method `rename_column` @@ -2105,7 +2447,7 @@ rename_column(path: 'int | str | ObjectPath', label: 'str') → SavedView --- - + ### method `save` @@ -2117,7 +2459,7 @@ Publish the saved view to the server. --- - + ### method `set_columns` @@ -2129,7 +2471,7 @@ Set the columns to be displayed in the grid. --- - + ### method `show_column` @@ -2139,7 +2481,7 @@ show_column(col_name: 'str') → SavedView --- - + ### method `sort_by` @@ -2149,7 +2491,7 @@ sort_by(field: 'str', direction: 'SortDirection') → SavedView --- - + ### method `to_grid` @@ -2159,7 +2501,7 @@ to_grid(limit: 'int | None' = None) → Grid --- - + ### method `to_rich_table_str` @@ -2169,7 +2511,7 @@ to_rich_table_str() → str --- - + ### method `ui_url` @@ -2183,7 +2525,7 @@ Note this is the "result" page with traces etc, not the URL for the view object. --- - + ### method `unpin_column` @@ -2193,7 +2535,7 @@ unpin_column(col_name: 'str') → SavedView --- - + ## class `Scorer` @@ -2208,7 +2550,7 @@ unpin_column(col_name: 'str') → SavedView #### property display_name - + ### classmethod `from_obj` @@ -2218,17 +2560,17 @@ from_obj(obj: WeaveObject) → Self --- - + ### method `model_post_init` ```python -model_post_init(_Scorer__context: Any) → None +model_post_init(context: Any) → None ``` --- - + ### method `score` @@ -2238,7 +2580,7 @@ score(output: Any, **kwargs: Any) → Any --- - + ### method `summarize` @@ -2248,11 +2590,65 @@ summarize(score_rows: list) → dict | None --- - + + +## class `Session` +A conversation session. Groups turns by conversation_id (no span). + +``continue_parent_trace`` controls trace isolation for the turns this session creates. Default ``False`` means each turn starts its own OTel trace (the right choice for the standalone Agents tab view). Set ``True`` when the application has an outer trace (e.g. a fastapi-instrumented request) that should contain the agent invocation. + +**Pydantic Fields:** + +- `session_id`: `` +- `session_name`: `` +- `agent_name`: `` +- `model`: `` +- `include_content`: `` +- `continue_parent_trace`: `` + + + +### method `end` + +```python +end() → None +``` + +--- + + + +### method `model_post_init` + +```python +model_post_init(context: 'Any') → None +``` + +--- + + + +### method `start_turn` + +```python +start_turn( + user_message: 'str' = '', + model: 'str' = '', + agent_name: 'str' = '' +) → Turn +``` + +Create a new turn. Auto-ends the previous turn if still open. + +Sets the ``_current_turn`` contextvar so the turn is visible via ``get_current_turn()`` regardless of whether a context manager is used. Propagates ``continue_parent_trace`` from this session. + +--- + + ## class `StringPrompt` - + ### method `__init__` @@ -2267,7 +2663,7 @@ __init__(content: str) - `ref`: `trace.refs.ObjectRef | None` - `content`: `` - + ### method `format` @@ -2277,7 +2673,7 @@ format(**kwargs: Any) → str --- - + ### classmethod `from_obj` @@ -2287,11 +2683,68 @@ from_obj(obj: WeaveObject) → Self --- - + + +## class `SubAgent` +A delegated agent invocation within a turn. + +Maps to a nested invoke_agent OTel span in the same trace. + +**Pydantic Fields:** + +- `name`: `` +- `model`: `` +- `agent_id`: `` +- `agent_description`: `` +- `agent_version`: `` +- `started_at`: `datetime.datetime | None` +- `ended_at`: `datetime.datetime | None` + + + +### method `end` + +```python +end() → None +``` + +--- + + + +### method `llm` + +```python +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. + +--- + + + +### method `tool` + +```python +tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool +``` + +Start a tool execution within this sub-agent. + +--- + + ## class `Table` - + ### method `__init__` @@ -2305,7 +2758,7 @@ __init__(rows: 'list[dict]') → None --- - + ### method `append` @@ -2317,7 +2770,7 @@ Add a row to the table. --- - + ### method `pop` @@ -2329,7 +2782,7 @@ Remove a row at the given index from the table. --- - + ## class `ContextAwareThread` A Thread that runs functions with the context of the caller. @@ -2349,7 +2802,7 @@ thread = threading.Thread(target=run_with_context(your_func, *args, **kwargs)) thread.start() ``` - + ### method `__init__` @@ -2393,7 +2846,7 @@ This is a non-negative integer. See the get_native_id() function. This represent --- - + ### method `run` @@ -2403,12 +2856,12 @@ run() → None --- - + ## class `ThreadContext` Context object providing access to current thread and turn information. - + ### method `__init__` @@ -2442,7 +2895,7 @@ Get the current turn_id from the active context. --- - + ## class `ContextAwareThreadPoolExecutor` A ThreadPoolExecutor that runs functions with the context of the caller. @@ -2461,7 +2914,7 @@ with concurrent.futures.ThreadPoolExecutor() as executor: executor.map(_wrapped_fn, vals) ``` - + ### method `__init__` @@ -2471,7 +2924,7 @@ __init__(*args: 'Any', **kwargs: 'Any') → None --- - + ### method `map` @@ -2486,7 +2939,7 @@ map( --- - + ### method `submit` @@ -2496,7 +2949,146 @@ submit(fn: 'Callable', *args: 'Any', **kwargs: 'Any') → Any --- - + + +## class `Tool` +One tool execution. Maps to an execute_tool OTel span. + +``arguments`` and ``result`` use the ``JSONString`` annotation: callers can assign a dict / list / scalar and the SDK JSON-encodes it at construction or assignment. The stored value is always a string, matching the wire format per GenAI semconv. + +**Pydantic Fields:** + +- `name`: `` +- `arguments`: `` +- `result`: `` +- `tool_call_id`: `` +- `tool_type`: `` +- `tool_description`: `` +- `tool_definitions`: `` +- `duration_ms`: `` +- `started_at`: `datetime.datetime | None` +- `ended_at`: `datetime.datetime | None` + + + +### method `end` + +```python +end() → None +``` + +--- + + + +## class `Turn` +One user-agent exchange. Maps to an invoke_agent OTel span. + +By default each turn starts its own OTel trace (``continue_parent_trace=False``) so the Agents tab shows one trace per turn. Set ``continue_parent_trace=True`` on the Session (or directly on the Turn) when an outer trace is already active and you want the agent invocation to nest inside it — e.g. inside a fastapi-instrumented request. + +**Pydantic Fields:** + +- `agent_name`: `` +- `model`: `` +- `agent_id`: `` +- `agent_description`: `` +- `agent_version`: `` +- `messages`: `list[session.types.Message]` +- `spans`: `list[session.session.LLM | session.session.Tool | session.session.SubAgent]` +- `continue_parent_trace`: `` +- `started_at`: `datetime.datetime | None` +- `ended_at`: `datetime.datetime | None` + + + +### method `end` + +```python +end() → None +``` + +--- + + + +### method `llm` + +```python +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 `model_post_init` + +```python +model_post_init(context: 'Any') → None +``` + +--- + + + +### method `subagent` + +```python +subagent(name: 'str', model: 'str' = '') → SubAgent +``` + +Start a sub-agent invocation (nested invoke_agent span, same trace). + +--- + + + +### method `tool` + +```python +tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool +``` + +Start a tool execution (execute_tool span, child of this turn). + +--- + + + +### method `user` + +```python +user(content: 'str') → Turn +``` + +Append a user message mid-turn. + +--- + + + +## class `Usage` +Token usage for an LLM call. + +**Pydantic Fields:** + +- `input_tokens`: `` +- `output_tokens`: `` +- `reasoning_tokens`: `` +- `cache_creation_input_tokens`: `` +- `cache_read_input_tokens`: `` + +--- + + ### function `add_tags` @@ -2511,7 +3103,7 @@ Add tags to an object version. --- - + ### function `as_op` @@ -2534,7 +3126,7 @@ Given a @weave.op decorated function, return its Op. --- - + ### function `attributes` @@ -2552,7 +3144,43 @@ with weave.attributes({'env': 'production'}): --- - + + +### function `end_llm` + +```python +end_llm() → None +``` + +End the current LLM call (from contextvar). + +--- + + + +### function `end_session` + +```python +end_session() → None +``` + +End the current session (from contextvar). + +--- + + + +### function `end_turn` + +```python +end_turn() → None +``` + +End the current turn (from contextvar). + +--- + + ### function `finish` @@ -2566,7 +3194,7 @@ Following finish, calls of weave.op decorated functions will no longer be logged --- - + ### function `get` @@ -2596,7 +3224,7 @@ dataset2 = weave.get(ref) # same as dataset! --- - + ### function `get_aliases` @@ -2615,7 +3243,7 @@ Get aliases for an object version. --- - + ### function `get_client` @@ -2625,7 +3253,7 @@ get_client() → WeaveClient | None --- - + ### function `get_current_call` @@ -2644,7 +3272,43 @@ Get the Call object for the currently executing Op, within that Op. --- - + + +### function `get_current_llm` + +```python +get_current_llm() → LLM | None +``` + +Return the active LLM call from contextvar, or None. + +--- + + + +### function `get_current_session` + +```python +get_current_session() → Session | None +``` + +Return the active session from contextvar, or None. + +--- + + + +### function `get_current_turn` + +```python +get_current_turn() → Turn | None +``` + +Return the active turn from contextvar, or None. + +--- + + ### function `get_tags` @@ -2663,7 +3327,7 @@ Get tags for an object version. --- - + ### function `get_tags_and_aliases` @@ -2682,7 +3346,7 @@ Get both tags and aliases for an object version in a single call. --- - + ### function `init` @@ -2691,6 +3355,9 @@ init( project_name: 'str', settings: 'UserSettings | dict[str, Any] | None' = None, autopatch_settings: 'AutopatchSettings | None' = None, + postprocess_inputs: 'PostprocessInputsFunc | None' = None, + postprocess_output: 'PostprocessOutputFunc | None' = None, + attributes: 'dict[str, Any] | None' = None, global_postprocess_inputs: 'PostprocessInputsFunc | None' = None, global_postprocess_output: 'PostprocessOutputFunc | None' = None, global_attributes: 'dict[str, Any] | None' = None @@ -2706,20 +3373,52 @@ Following init, calls of weave.op decorated functions will be logged to the spec **Args:** -NOTE: Global postprocessing settings are applied to all ops after each op's own postprocessing. The order is always: 1. Op-specific postprocessing 2. Global postprocessing +NOTE: Client-level postprocessing runs after each op's own postprocessing. The order is always: 1. Op-specific postprocessing 2. Client-level postprocessing - - `project_name`: The name of the Weights & Biases team and project to log to. If you don't specify a team, your default entity is used. To find or update your default entity, refer to [User Settings](https://docs.wandb.ai/guides/models/app/settings-page/user-settings/#default-team) in the W&B Models documentation. - - `settings`: Configuration for the Weave client generally. + - `project_name`: The name of the Weights & Biases team and project to log to. If you don't specify a team, your default entity is used. To find or update your default entity, refer to [User Settings](https://docs.wandb.ai/platform/app/settings-page/user-settings#default-team) in the W&B Models documentation. + - `settings`: Configuration for the Weave client generally. Can be a UserSettings instance or a dict with any of the following keys (all optional). All settings can also be configured via environment variables using the prefix WEAVE_ (e.g., WEAVE_DISABLED=true). Available settings: - `disabled` (bool): Disables traces on all functions. Default: `False` - `print_call_link` (bool): Prints links in terminal to Weave UI for ops. Default: `True` - `log_level` (str): Sets what type of information to log (`DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`). Default: `INFO` - `display_viewer` (str): Controls how Weave displays objects in the console (`auto`, `rich`, `print`). Default: `auto` - `capture_code` (bool): Captures code of traced ops to your Weave project. Default: `True` - `implicitly_patch_integrations` (bool): Auto-patches supported libraries. Default: `True` - `redact_pii` (bool): Scans all trace data for sensitive information, like emails, phone numbers, and credit cards, and replaces them with placeholder values before sending to the server. Requires presidio-analyzer and presidio-anonymizer packages. + - `Default`: `False` - `redact_pii_fields` (list[str]): Specifies which PII entity types to redact when `redact_pii` is True. If empty, uses Presidio's default set. Examples ['EMAIL','PHONE_NUMBER','CREDIT_CARD','US_SSN']. See full list at https://microsoft.github.io/presidio/supported_entities/ + - `Default`: `[]` - `redact_pii_exclude_fields` (list[str]): PII entity types to exclude. Default: `[]` - `capture_client_info` (bool): Captures Python/SDK version info. Default: `True` - `capture_system_info` (bool): Captures OS information. Default: `True` - `client_parallelism` (int): Number of workers for background ops. Default: `auto` - `use_server_cache` (bool): Enables local disk caching of server responses. - `server_cache_size_limit` (int): Cache size limit in bytes. Default: `1_000_000_000` - `server_cache_dir` (str): Directory for server cache. Default: `temporary` - `scorers_dir` (str): Directory for scorer model checkpoints. Default: `~/.cache/wandb/weave-scorers` - `max_calls_queue_size` (int): Maximum queue size (0 = unbounded). Default: `100_000` - `retry_max_interval` (float): Maximum retry interval in seconds. Default: `300` - `retry_max_attempts` (int): Maximum number of retries. Default: `3` - `enable_disk_fallback` (bool): Writes dropped items to disk. Default: `True` - `use_parallel_table_upload` (bool): Enables parallel chunked upload for large tables. If False, tables are uploaded sequentially in smaller chunks. + - `Default`: `True` - `http_timeout` (float): Maximum time in seconds to wait for HTTP requests to complete. This includes connection time, data transfer, and server processing. Increase for slow networks or when working with large payloads. + - `Default`: `30.0` - `use_stainless_server` (bool): Uses the Stainless-generated HTTP client which provides better type safety, automatic retries, and improved error handling. This is experimental and may become the default in future versions. + - `Default`: `False` - `use_calls_complete` (bool): Uses an optimized write path that batches complete call data (start and end) into a single request instead of separate start/end requests. This reduces server load and improves performance, especially for short-lived ops. + - `Default`: `False` - `autopatch_settings`: (Deprecated) Configuration for autopatch integrations. Use explicit patching instead. - - `global_postprocess_inputs`: A function that will be applied to all inputs of all ops. - - `global_postprocess_output`: A function that will be applied to all outputs of all ops. - - `global_attributes`: A dictionary of attributes that will be applied to all traces. + - `postprocess_inputs`: A function applied to the inputs of every op traced by this client. + - `postprocess_output`: A function applied to the output of every op traced by this client. + - `attributes`: A dictionary of attributes applied to every trace produced by this client. **Returns:** A Weave client. --- - + + +### function `link_prompt_to_registry` + +```python +link_prompt_to_registry( + prompt: 'LinkablePrompt', + target_path: 'str', + aliases: 'Sequence[str] | None' = None +) → LinkAssetToRegistryRes +``` + +Link a published prompt version into the registry. + +**Args:** + + + - `prompt`: A published prompt, an `ObjectRef`, or a fully qualified weave ///... URI string. + - `target_path`: Registry destination path in the format `/`, for example `wandb-registry-prompts/my-prompt-collection`. + - `aliases`: Optional aliases to attach to the created registry version. +**Returns:** + + - `LinkAssetToRegistryRes`: Parsed response from the registry-link endpoint. + +--- + + ### function `list_aliases` @@ -2734,7 +3433,7 @@ List all distinct aliases in the project. --- - + ### function `list_tags` @@ -2749,7 +3448,7 @@ List all distinct tags in the project. --- - + ### function `log_call` @@ -2836,7 +3535,54 @@ import weave --- - + + +### function `log_session` + +```python +log_session( + turns: 'list[Turn]', + session_id: 'str' = '', + session_name: 'str' = '', + agent_name: 'str' = '', + model: 'str' = '', + include_content: 'bool' = True, + continue_parent_trace: 'bool' = False +) → LogResult +``` + +Imperatively emit a complete session. + +Each Turn's ``.spans`` attribute provides its children. Auto-generates ``session_id`` if empty. By default each turn gets its own OTel trace. + +--- + + + +### function `log_turn` + +```python +log_turn( + session_id: 'str', + agent_name: 'str' = '', + session_name: 'str' = '', + model: 'str' = '', + messages: 'list[Message] | None' = None, + spans: 'list[LLM | Tool | SubAgent] | None' = None, + started_at: 'datetime | None' = None, + ended_at: 'datetime | None' = None, + include_content: 'bool' = True, + continue_parent_trace: 'bool' = False +) → LogResult +``` + +Imperatively emit one turn and its child spans to OTel. + +Use when context managers aren't viable (stateless containers, callbacks, queue workers). Each child span passed in should have ``started_at`` / ``ended_at`` set; the emitted OTel span timestamps come from those fields. Falls back to the earliest/latest child timestamp, then ``now()``, when the turn doesn't supply its own. + +--- + + ### function `op` @@ -2863,22 +3609,17 @@ A decorator to weave op-ify a function or method. Works for both sync and async. --- - + -### function `publish` +### function `otel_traces_endpoint` ```python -publish( - obj: 'Any', - name: 'str | None' = None, - tags: 'list[str] | None' = None, - aliases: 'list[str] | None' = None -) → ObjectRef +otel_traces_endpoint(base_url: str | None = None) → str ``` -Save and version a Python object. +Return the full OTLP HTTP endpoint URL for Weave GenAI trace ingestion. -Weave creates a new version of the object if the object's name already exists and its content hash does not match the latest version of that object. +External callers (e.g. boot-time probes that want to verify the ingest endpoint is reachable before relying on the BatchSpanProcessor to silently drop exports) should call this rather than constructing the URL by hand. The path is owned by the SDK and may move. - `func`: The function to decorate. - `name`: Custom name for the op. Defaults to the function name. @@ -2892,6 +3633,29 @@ Weave creates a new version of the object if the object's name already exists an **Args:** +--- + + + +### function `publish` + +```python +publish( + obj: 'Any', + name: 'str | None' = None, + tags: 'list[str] | None' = None, + aliases: 'list[str] | None' = None +) → ObjectRef +``` + +Save and version a Python object. + +Weave creates a new version of the object if the object's name already exists and its content hash does not match the latest version of that object. + + - `base_url`: Trace server base URL. Defaults to ``weave_trace_server_url()``. +**Args:** + + - `obj`: The object to save and version. - `name`: The name to save the object under. - `tags`: Optional list of tags to add to the published object version. @@ -2901,7 +3665,7 @@ Weave creates a new version of the object if the object's name already exists an --- - + ### function `ref` @@ -2920,7 +3684,7 @@ Creates a Ref to an existing Weave object. This does not directly retrieve the o --- - + ### function `remove_aliases` @@ -2935,7 +3699,7 @@ Remove one or more aliases from an object. --- - + ### function `remove_tags` @@ -2952,7 +3716,7 @@ Remove tags from an object version. --- - + ### function `require_current_call` @@ -3003,7 +3767,7 @@ print(call.id) --- - + ### function `set_aliases` @@ -3018,7 +3782,7 @@ Set one or more aliases for an object version. --- - + ### function `set_view` @@ -3060,13 +3824,98 @@ Attach a custom view to the current call summary at `_weave.views.`. --- - + + +### function `start_llm` + +```python +start_llm( + model: 'str' = '', + provider_name: 'str' = '', + system_instructions: 'list[str] | None' = None +) → LLM +``` + +Create and activate an LLM call. Uses the current turn if available. + +If no turn is active, returns a disconnected LLM (no contextvar set). + +Pass ``provider_name`` explicitly. The SDK does not infer it from the model identifier: prefix-based guessing misattributes user fine-tunes (e.g. a model named ``text-...``) and bakes assumptions about future model names into telemetry that's expensive to correct after the fact. + +--- + + + +### function `start_session` + +```python +start_session( + agent_name: 'str' = '', + model: 'str' = '', + session_id: 'str' = '', + session_name: 'str' = '', + include_content: 'bool' = True, + continue_parent_trace: 'bool' = False +) → Session +``` + +Create and activate a session. Sets the contextvar for cross-module access. + +--- + + + +### function `start_subagent` + +```python +start_subagent(name: 'str', model: 'str' = '') → SubAgent +``` + +Create a sub-agent invocation span. + +The SubAgent's OTel span automatically becomes a child of whatever span is current in OTel context — typically a Turn span if one is active. Mirrors ``start_tool`` in shape; OTel context handles parent-child propagation, no explicit delegation is needed. + +--- + + + +### function `start_tool` + +```python +start_tool(name: 'str', arguments: 'str' = '', tool_call_id: 'str' = '') → Tool +``` + +Create a tool execution span. + +The Tool's OTel span automatically becomes a child of whatever span is current in OTel context — typically a Turn span if one is active. No explicit turn delegation is needed: parent-child propagation happens via OTel context, not via the Session SDK contextvars. + +--- + + + +### function `start_turn` + +```python +start_turn( + user_message: 'str' = '', + model: 'str' = '', + agent_name: 'str' = '' +) → Turn +``` + +Create and activate a turn. Uses the current session if available. + +If no session is active, returns a disconnected Turn that is NOT set in the contextvar. This means ``get_current_turn()`` will return None. Use ``session.start_turn()`` instead if you need contextvar-based cross-module access. + +--- + + ### function `thread` ```python thread( - thread_id: 'str | None | object' = + thread_id: 'str | object | None' = ) → Iterator[ThreadContext] ``` @@ -3099,7 +3948,7 @@ with weave.thread(None) as t: --- - + ### function `wandb_init_hook` diff --git a/weave/reference/python-sdk/trace/feedback.mdx b/weave/reference/python-sdk/trace/feedback.mdx index 7253dd05db..e7f6efd913 100644 --- a/weave/reference/python-sdk/trace/feedback.mdx +++ b/weave/reference/python-sdk/trace/feedback.mdx @@ -10,12 +10,12 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `FeedbackQuery` Lazy-loading object for fetching feedback from the server. - + ### method `__init__` @@ -32,7 +32,7 @@ __init__( --- - + ### method `execute` @@ -42,7 +42,7 @@ execute() → Feedbacks --- - + ### method `refresh` @@ -52,7 +52,7 @@ refresh() → Feedbacks --- - + ### method `refs` @@ -62,12 +62,12 @@ refs() → Refs --- - + ## class `Feedbacks` A collection of Feedback objects with utilities. - + ### method `__init__` @@ -80,7 +80,7 @@ __init__( --- - + ### method `refs` @@ -92,12 +92,12 @@ Return the unique refs associated with these feedbacks. --- - + ## class `RefFeedbackQuery` Object for interacting with feedback associated with a particular ref. - + ### method `__init__` @@ -107,7 +107,7 @@ __init__(ref: 'str') → None --- - + ### method `add` @@ -127,7 +127,7 @@ feedback_type: A string identifying the type of feedback. The "wandb." prefix is --- - + ### method `add_note` @@ -137,7 +137,7 @@ add_note(note: 'str', creator: 'str | None' = None) → str --- - + ### method `add_reaction` @@ -147,7 +147,7 @@ add_reaction(emoji: 'str', creator: 'str | None' = None) → str --- - + ### method `execute` @@ -157,7 +157,7 @@ execute() → Feedbacks --- - + ### method `purge` @@ -167,7 +167,7 @@ purge(feedback_id: 'str') → None --- - + ### method `refresh` @@ -177,7 +177,7 @@ refresh() → Feedbacks --- - + ### method `refs` diff --git a/weave/reference/python-sdk/trace/op.mdx b/weave/reference/python-sdk/trace/op.mdx index 635d3b1265..ada80ffc67 100644 --- a/weave/reference/python-sdk/trace/op.mdx +++ b/weave/reference/python-sdk/trace/op.mdx @@ -10,31 +10,31 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `DisplayNameFuncError` --- - + ## class `OpCallError` --- - + ## class `OpKwargs` TypedDict for op() keyword arguments. --- - + ## class `Sentinel` Sentinel(package: 'str', path: 'str', name: 'str') - + ### method `__init__` @@ -44,13 +44,13 @@ __init__(package: 'str', path: 'str', name: 'str') → None --- - + ## class `WeaveKwargs` --- - + ### function `as_op` @@ -71,7 +71,7 @@ Given a @weave.op decorated function, return its Op. --- - + ### function `call` @@ -102,7 +102,7 @@ result, call = add.call(1, 2) --- - + ### function `calls` @@ -126,7 +126,7 @@ for call in calls: --- - + ### function `get_captured_code` @@ -142,7 +142,7 @@ ref = weave.publish(func) op = ref.get() captured_code = op.get_captured_code() --- - + ### function `is_op` @@ -154,7 +154,7 @@ Check if an object is an Op. --- - + ### function `is_placeholder_call` @@ -164,7 +164,7 @@ is_placeholder_call(call: 'Call') → TypeIs[NoOpCall] --- - + ### function `is_tracing_setting_disabled` @@ -174,7 +174,7 @@ is_tracing_setting_disabled() → bool --- - + ### function `maybe_bind_method` @@ -188,7 +188,7 @@ If self is None, return the function as is. --- - + ### function `maybe_unbind_method` @@ -204,7 +204,7 @@ For: --- - + ### function `op` @@ -231,7 +231,7 @@ A decorator to weave op-ify a function or method. Works for both sync and async. --- - + ### function `placeholder_call` @@ -241,7 +241,7 @@ placeholder_call() → Call --- - + ### function `setup_dunder_weave_dict` @@ -270,7 +270,7 @@ Sets up a __weave dict used to pass WeaveKwargs to ops. --- - + ### function `should_skip_tracing_for_op` diff --git a/weave/reference/python-sdk/trace/util.mdx b/weave/reference/python-sdk/trace/util.mdx index 93ecf50a19..0b138357a6 100644 --- a/weave/reference/python-sdk/trace/util.mdx +++ b/weave/reference/python-sdk/trace/util.mdx @@ -10,7 +10,7 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `ContextAwareThread` A Thread that runs functions with the context of the caller. @@ -30,7 +30,7 @@ thread = threading.Thread(target=run_with_context(your_func, *args, **kwargs)) thread.start() ``` - + ### method `__init__` @@ -74,7 +74,7 @@ This is a non-negative integer. See the get_native_id() function. This represent --- - + ### method `run` @@ -84,7 +84,7 @@ run() → None --- - + ## class `ContextAwareThreadPoolExecutor` A ThreadPoolExecutor that runs functions with the context of the caller. @@ -103,7 +103,7 @@ with concurrent.futures.ThreadPoolExecutor() as executor: executor.map(_wrapped_fn, vals) ``` - + ### method `__init__` @@ -113,7 +113,7 @@ __init__(*args: 'Any', **kwargs: 'Any') → None --- - + ### method `map` @@ -128,7 +128,7 @@ map( --- - + ### method `submit` @@ -138,7 +138,7 @@ submit(fn: 'Callable', *args: 'Any', **kwargs: 'Any') → Any --- - + ### function `deprecated` @@ -150,7 +150,7 @@ Decorator to mark a function as deprecated and redirect users to `new_name`. --- - + ### function `is_colab` @@ -160,7 +160,7 @@ is_colab() --- - + ### function `is_notebook` @@ -170,7 +170,7 @@ is_notebook() → bool --- - + ### function `log_once` diff --git a/weave/reference/python-sdk/trace/weave_client.mdx b/weave/reference/python-sdk/trace/weave_client.mdx index 6e9dfe5545..749b8ec062 100644 --- a/weave/reference/python-sdk/trace/weave_client.mdx +++ b/weave/reference/python-sdk/trace/weave_client.mdx @@ -10,39 +10,39 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `CrossProjectRefError` Raised when client-side digest computation encounters a ref to a different project that cannot be resolved to an internal ID. --- - + ## class `FlushStatus` Status information about the current flush operation. --- - + ## class `NoInternalProjectIDError` Raised when client-side digest computation cannot proceed because no internal project ID has been resolved yet. --- - + ## class `PendingJobCounts` Counts of pending jobs for each type. --- - + ## class `WeaveClient` - + ### method `__init__` @@ -51,7 +51,11 @@ __init__( entity: 'str', project: 'str', server: 'TraceServerClientInterface', - ensure_project_exists: 'bool' = True + ensure_project_exists: 'bool' = True, + postprocess_inputs: 'PostprocessInputsFunc | None' = None, + postprocess_output: 'PostprocessOutputFunc | None' = None, + attributes: 'dict[str, Any] | None' = None, + api_key: 'str | None' = None ) ``` @@ -69,7 +73,11 @@ This property can be used to check the progress of background tasks without bloc --- - +#### property project_id + +--- + + ### method `add_cost` @@ -108,7 +116,7 @@ client.add_cost(llm_id="my_expensive_custom_model", prompt_token_cost=500, compl --- - + ### method `add_tags` @@ -123,7 +131,7 @@ Add tags to an object version. --- - + ### method `clear_wandb_run_context` @@ -148,7 +156,7 @@ client.clear_wandb_run_context() --- - + ### method `create_call` @@ -182,7 +190,7 @@ Create, log, and push a call onto the runtime stack. --- - + ### method `delete_all_object_versions` @@ -201,7 +209,7 @@ Delete all versions of an object. --- - + ### method `delete_all_op_versions` @@ -220,7 +228,7 @@ Delete all versions of an op. --- - + ### method `delete_call` @@ -230,7 +238,7 @@ delete_call(call: 'Call') → None --- - + ### method `delete_calls` @@ -247,7 +255,7 @@ Deleting a call will also delete all of its children. --- - + ### method `delete_object_version` @@ -257,7 +265,7 @@ delete_object_version(object: 'ObjectRef') → None --- - + ### method `delete_object_versions` @@ -278,7 +286,7 @@ Delete specific versions of an object. --- - + ### method `delete_op_version` @@ -288,7 +296,7 @@ delete_op_version(op: 'OpRef') → None --- - + ### method `fail_call` @@ -300,7 +308,7 @@ Fail a call with an exception. This is a convenience method for finish_call. --- - + ### method `finish` @@ -320,7 +328,7 @@ This method blocks until all currently enqueued jobs are processed, displaying a --- - + ### method `finish_call` @@ -340,7 +348,7 @@ Any values present in ``call.summary`` are deep-merged with computed summary sta --- - + ### method `flush` @@ -352,7 +360,7 @@ Flushes background asynchronous tasks, safe to call multiple times. --- - + ### method `get` @@ -362,7 +370,7 @@ get(ref: 'ObjectRef', objectify: 'bool' = True) → Any --- - + ### method `get_aliases` @@ -383,7 +391,7 @@ Get aliases for an object version. --- - + ### method `get_call` @@ -410,7 +418,7 @@ Get a single call by its ID. --- - + ### method `get_calls` @@ -425,6 +433,7 @@ get_calls( include_feedback: 'bool' = False, include_storage_size: 'bool' = False, include_total_storage_size: 'bool' = False, + include_usernames: 'bool' = False, columns: 'list[str] | None' = None, expand_columns: 'list[str] | None' = None, return_expanded_column_values: 'bool' = True, @@ -450,6 +459,7 @@ Performance Tip: Specify `columns` and use `filter` or `query` to reduce result - ``include_feedback``: If True, includes feedback in `summary.weave.feedback`. - ``include_storage_size``: If True, includes the storage size for a call. - ``include_total_storage_size``: If True, includes the total storage size for a trace. + - ``include_usernames``: If True, attempts to resolve each call's `wb_user_id` to a `wb_username`. - ``columns``: List of fields to return per call. Reducing this can significantly improve performance. (Some fields like `id`, `trace_id`, `op_name`, and `started_at` are always included.) - ``scored_by``: Filter by one or more scorers (name or ref URI). Multiple scorers are AND-ed. - ``page_size``: Number of calls fetched per page. Tune this for performance in large queries. @@ -471,7 +481,7 @@ for call in calls: --- - + ### method `get_evaluation` @@ -507,7 +517,7 @@ print(evaluation.name) --- - + ### method `get_evaluations` @@ -532,7 +542,7 @@ for eval in evaluations: --- - + ### method `get_feedback` @@ -586,7 +596,7 @@ client.get_feedback(query=query) --- - + ### method `get_tags` @@ -605,7 +615,7 @@ Get tags for an object version. --- - + ### method `get_tags_and_aliases` @@ -624,7 +634,33 @@ Get both tags and aliases for an object version in a single call. --- - + + +### method `link_prompt_to_registry` + +```python +link_prompt_to_registry( + prompt: 'LinkablePrompt', + target_path: 'str', + aliases: 'Sequence[str] | None' = None +) → LinkAssetToRegistryRes +``` + +Link a published prompt version into the registry. + +**Args:** + + + - `prompt`: A published prompt, an `ObjectRef`, or a fully qualified weave ///... URI string. + - `target_path`: Registry destination path in the format `/`, for example `wandb-registry-prompts/my-prompt-collection`. + - `aliases`: Optional aliases to attach to the created registry version. +**Returns:** + + - `LinkAssetToRegistryRes`: Parsed response from the registry-link endpoint. + +--- + + ### method `list_aliases` @@ -639,7 +675,7 @@ List all distinct aliases in the project. --- - + ### method `list_tags` @@ -654,7 +690,7 @@ List all distinct tags in the project. --- - + ### method `purge_costs` @@ -675,7 +711,7 @@ client.purge_costs(ids) --- - + ### method `query_costs` @@ -714,7 +750,7 @@ client.query_costs(llm_ids=["gpt-4o-mini-2024-07-18"], limit=10) --- - + ### method `remove_aliases` @@ -729,7 +765,7 @@ Remove one or more aliases from an object. --- - + ### method `remove_tags` @@ -746,7 +782,7 @@ Remove tags from an object version. --- - + ### method `save` @@ -769,7 +805,7 @@ Do not call directly, use weave.publish() instead. --- - + ### method `set_aliases` @@ -784,7 +820,7 @@ Set one or more aliases for an object version. --- - + ### method `set_wandb_run_context` @@ -816,7 +852,7 @@ client.set_wandb_run_context(run_id="my-run-id") --- - + ### function `get_obj_name` @@ -826,7 +862,7 @@ get_obj_name(val: 'Any') → str --- - + ### function `get_parallelism_settings` @@ -836,7 +872,7 @@ get_parallelism_settings() → tuple[int | None, int | None] --- - + ### function `map_to_refs` @@ -846,7 +882,7 @@ map_to_refs(obj: 'Any') → Any --- - + ### function `print_call_link` @@ -856,7 +892,7 @@ print_call_link(call: 'Call') → None --- - + ### function `redact_sensitive_keys` @@ -866,7 +902,7 @@ redact_sensitive_keys(obj: 'Any') → Any --- - + ### function `sanitize_object_name` diff --git a/weave/reference/python-sdk/trace_server/trace_server_interface.mdx b/weave/reference/python-sdk/trace_server/trace_server_interface.mdx index 863680e839..260069c35b 100644 --- a/weave/reference/python-sdk/trace_server/trace_server_interface.mdx +++ b/weave/reference/python-sdk/trace_server/trace_server_interface.mdx @@ -10,7 +10,7 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `ActionsExecuteBatchReq` @@ -23,20 +23,20 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `ActionsExecuteBatchRes` --- - + ## class `AggregationType` Aggregation functions supported by feedback and call stats metrics. --- - + ## class `AliasesListReq` @@ -47,7 +47,7 @@ Aggregation functions supported by feedback and call stats metrics. --- - + ## class `AliasesListRes` @@ -57,7 +57,7 @@ Aggregation functions supported by feedback and call stats metrics. --- - + ## class `AnnotationQueueAddCallsReq` Request to add calls to an annotation queue in batch. @@ -74,7 +74,7 @@ Extends AnnotationQueueAddCallsBody by adding queue_id for internal API usage. --- - + ## class `AnnotationQueueAddCallsRes` Response from adding calls to a queue. @@ -86,7 +86,7 @@ Response from adding calls to a queue. --- - + ## class `AnnotationQueueCreateReq` Request to create a new annotation queue. @@ -101,7 +101,7 @@ Request to create a new annotation queue. --- - + ## class `AnnotationQueueCreateRes` Response from creating an annotation queue. @@ -112,7 +112,7 @@ Response from creating an annotation queue. --- - + ## class `AnnotationQueueDeleteReq` Request to delete (soft-delete) an annotation queue. @@ -125,7 +125,7 @@ Request to delete (soft-delete) an annotation queue. --- - + ## class `AnnotationQueueDeleteRes` Response from deleting an annotation queue. @@ -136,7 +136,7 @@ Response from deleting an annotation queue. --- - + ## class `AnnotationQueueItemSchema` Schema for annotation queue item responses. @@ -163,7 +163,7 @@ Schema for annotation queue item responses. --- - + ## class `AnnotationQueueItemsQueryReq` Request to query items in an annotation queue. @@ -182,7 +182,7 @@ Extends AnnotationQueueItemsQueryBody by adding queue_id for internal API usage. --- - + ## class `AnnotationQueueItemsQueryRes` Response from querying annotation queue items. @@ -193,7 +193,7 @@ Response from querying annotation queue items. --- - + ## class `AnnotationQueueReadReq` Request to read a specific annotation queue. @@ -205,7 +205,7 @@ Request to read a specific annotation queue. --- - + ## class `AnnotationQueueReadRes` Response from reading an annotation queue. @@ -216,7 +216,7 @@ Response from reading an annotation queue. --- - + ## class `AnnotationQueueSchema` Schema for annotation queue responses. @@ -235,7 +235,7 @@ Schema for annotation queue responses. --- - + ## class `AnnotationQueueStatsSchema` Statistics for a single annotation queue. @@ -248,7 +248,7 @@ Statistics for a single annotation queue. --- - + ## class `AnnotationQueueUpdateReq` Request to update an annotation queue. @@ -266,7 +266,7 @@ All fields except project_id and queue_id are optional - only provided fields wi --- - + ## class `AnnotationQueueUpdateRes` Response from updating an annotation queue. @@ -277,7 +277,7 @@ Response from updating an annotation queue. --- - + ## class `AnnotationQueuesQueryReq` Request to query annotation queues for a project. @@ -292,7 +292,7 @@ Request to query annotation queues for a project. --- - + ## class `AnnotationQueuesQueryRes` Response from querying annotation queues. @@ -303,7 +303,7 @@ Response from querying annotation queues. --- - + ## class `AnnotationQueuesStatsReq` Request to get stats for multiple annotation queues. @@ -315,7 +315,7 @@ Request to get stats for multiple annotation queues. --- - + ## class `AnnotationQueuesStatsRes` Response with stats for multiple annotation queues. @@ -326,7 +326,7 @@ Response with stats for multiple annotation queues. --- - + ## class `AnnotatorQueueItemsProgressUpdateReq` Request to update the annotation state of a queue item for the current annotator. @@ -347,7 +347,7 @@ Valid state transitions: --- - + ## class `AnnotatorQueueItemsProgressUpdateRes` Response from updating annotation state. @@ -358,7 +358,7 @@ Response from updating annotation state. --- - + ## class `CallBatchEndMode` @@ -369,7 +369,7 @@ Response from updating annotation state. --- - + ## class `CallBatchStartMode` @@ -380,7 +380,7 @@ Response from updating annotation state. --- - + ## class `CallCreateBatchReq` @@ -390,7 +390,7 @@ Response from updating annotation state. --- - + ## class `CallCreateBatchRes` @@ -400,7 +400,7 @@ Response from updating annotation state. --- - + ## class `CallEndReq` @@ -410,13 +410,13 @@ Response from updating annotation state. --- - + ## class `CallEndRes` --- - + ## class `CallEndV2Req` Request for ending a single call via v2 API. @@ -427,14 +427,14 @@ Request for ending a single call via v2 API. --- - + ## class `CallEndV2Res` Response for ending a single call via v2 API. --- - + ## class `CallMetricSpec` Specification for a call-level metric to aggregate (not grouped by model). @@ -447,7 +447,7 @@ Specification for a call-level metric to aggregate (not grouped by model). --- - + ## class `CallReadReq` @@ -461,7 +461,7 @@ Specification for a call-level metric to aggregate (not grouped by model). --- - + ## class `CallReadRes` @@ -471,7 +471,7 @@ Specification for a call-level metric to aggregate (not grouped by model). --- - + ## class `CallSchema` @@ -493,14 +493,16 @@ Specification for a call-level metric to aggregate (not grouped by model). - `output`: `typing.Any | None` - `summary`: `SummaryMap | None` - `wb_user_id`: `str | None` +- `wb_username`: `str | None` - `wb_run_id`: `str | None` - `wb_run_step`: `int | None` - `wb_run_step_end`: `int | None` - `deleted_at`: `datetime.datetime | None` +- `expire_at`: `datetime.datetime | None` - `storage_size_bytes`: `int | None` - `total_storage_size_bytes`: `int | None` - + ### method `serialize_typed_dicts` @@ -510,7 +512,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CallStartReq` @@ -520,7 +522,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CallStartRes` @@ -531,7 +533,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CallStartV2Req` Request for starting a single call via v2 API. @@ -542,7 +544,7 @@ Request for starting a single call via v2 API. --- - + ## class `CallStartV2Res` Response for starting a single call via v2 API. @@ -554,7 +556,7 @@ Response for starting a single call via v2 API. --- - + ## class `CallStatsReq` Request for aggregated call statistics over a time range. @@ -570,7 +572,7 @@ Request for aggregated call statistics over a time range. - `filter`: `CallsFilter | None` - `timezone`: `` - + ### method `validate_date_range` @@ -582,7 +584,7 @@ Ensure call stats requests are bounded to a safe date range. --- - + ## class `CallStatsRes` Response containing time-series call statistics. @@ -598,7 +600,7 @@ Response containing time-series call statistics. --- - + ## class `CallUpdateReq` @@ -611,13 +613,13 @@ Response containing time-series call statistics. --- - + ## class `CallUpdateRes` --- - + ## class `CallsDeleteReq` @@ -629,7 +631,7 @@ Response containing time-series call statistics. --- - + ## class `CallsDeleteRes` @@ -639,7 +641,7 @@ Response containing time-series call statistics. --- - + ## class `CallsFilter` @@ -659,7 +661,7 @@ Response containing time-series call statistics. --- - + ## class `CallsQueryReq` @@ -675,13 +677,14 @@ Response containing time-series call statistics. - `include_feedback`: `bool | None` - `include_storage_size`: `bool | None` - `include_total_storage_size`: `bool | None` +- `include_usernames`: `bool | None` - `columns`: `list[str] | None` - `expand_columns`: `list[str] | None` - `return_expanded_column_values`: `bool | None` --- - + ## class `CallsQueryRes` @@ -691,7 +694,7 @@ Response containing time-series call statistics. --- - + ## class `CallsQueryStatsReq` @@ -706,7 +709,7 @@ Response containing time-series call statistics. --- - + ## class `CallsQueryStatsRes` @@ -717,7 +720,7 @@ Response containing time-series call statistics. --- - + ## class `CallsScoreReq` Request to enqueue scoring jobs for a list of calls. @@ -733,7 +736,7 @@ Scoring is performed asynchronously by the call_scoring_worker, which consumes m --- - + ## class `CallsScoreRes` Empty response for calls_score. @@ -742,7 +745,7 @@ Defined as a model (rather than returning None) to follow the convention used th --- - + ## class `CallsUpsertCompleteReq` Request for upserting a batch of completed calls. @@ -753,14 +756,14 @@ Request for upserting a batch of completed calls. --- - + ## class `CallsUpsertCompleteRes` Response for upserting a batch of completed calls. --- - + ## class `CallsUsageReq` Request to compute aggregated usage for multiple root calls. @@ -778,7 +781,7 @@ Note: All matching calls are loaded into memory for aggregation. For very large --- - + ## class `CallsUsageRes` Response with aggregated usage metrics per root call. @@ -790,7 +793,7 @@ Response with aggregated usage metrics per root call. --- - + ## class `CompletedCallSchemaForInsert` Schema for inserting a completed call directly. @@ -820,7 +823,7 @@ This represents a call that is already finished at insertion time, with both sta - `wb_run_step`: `int | None` - `wb_run_step_end`: `int | None` - + ### method `serialize_typed_dicts` @@ -830,7 +833,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CompletionsCreateReq` @@ -845,7 +848,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CompletionsCreateRequestInputs` @@ -883,7 +886,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CompletionsCreateRes` @@ -894,7 +897,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostCreateInput` @@ -902,6 +905,8 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] - `prompt_token_cost`: `` - `completion_token_cost`: `` +- `cache_read_input_token_cost`: `` +- `cache_creation_input_token_cost`: `` - `prompt_token_cost_unit`: `str | None` - `completion_token_cost_unit`: `str | None` - `effective_date`: `datetime.datetime | None` @@ -909,7 +914,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostCreateReq` @@ -921,7 +926,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostCreateRes` @@ -931,7 +936,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostPurgeReq` @@ -942,13 +947,13 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostPurgeRes` --- - + ## class `CostQueryOutput` @@ -965,7 +970,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostQueryReq` @@ -980,7 +985,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `CostQueryRes` @@ -990,7 +995,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetCreateBody` @@ -1002,7 +1007,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetCreateReq` @@ -1016,7 +1021,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetCreateRes` @@ -1028,7 +1033,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetDeleteReq` @@ -1041,7 +1046,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetDeleteRes` @@ -1051,7 +1056,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetListReq` @@ -1064,7 +1069,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetReadReq` @@ -1077,7 +1082,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `DatasetReadRes` @@ -1093,7 +1098,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `EndedCallSchemaForInsert` @@ -1107,7 +1112,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] - `summary`: `` - `wb_run_step_end`: `int | None` - + ### method `serialize_typed_dicts` @@ -1117,7 +1122,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `EndedCallSchemaForInsertWithStartedAt` Ended call schema with optional started_at for v2 end updates. @@ -1135,7 +1140,7 @@ When started_at is provided, it enables more efficient ClickHouse queries by uti - `wb_run_step_end`: `int | None` - `started_at`: `datetime.datetime | None` - + ### method `serialize_typed_dicts` @@ -1145,7 +1150,7 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + ## class `EvalResultsEvaluationSummary` @@ -1162,7 +1167,19 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] --- - + + +## class `EvalResultsFilter` +A filter scoped to an optional evaluation. + +**Pydantic Fields:** + +- `evaluation_call_id`: `str | None` +- `query`: `` + +--- + + ## class `EvalResultsQueryBody` @@ -1176,10 +1193,13 @@ serialize_typed_dicts(v: dict[str, Any]) → dict[str, Any] - `include_rows`: `` - `include_summary`: `` - `summary_require_intersection`: `bool | None` +- `include_predict_and_score_children`: `` +- `sort_by`: `list[EvalResultsSortBy] | None` +- `filters`: `list[EvalResultsFilter] | None` - `limit`: `int | None` - `offset`: `` - + ### method `validate_identifiers` @@ -1191,7 +1211,7 @@ Validate that at least one evaluation identifier is provided. --- - + ## class `EvalResultsQueryReq` @@ -1205,11 +1225,14 @@ Validate that at least one evaluation identifier is provided. - `include_rows`: `` - `include_summary`: `` - `summary_require_intersection`: `bool | None` +- `include_predict_and_score_children`: `` +- `sort_by`: `list[EvalResultsSortBy] | None` +- `filters`: `list[EvalResultsFilter] | None` - `limit`: `int | None` - `offset`: `` - `project_id`: `` - + ### method `validate_identifiers` @@ -1221,7 +1244,7 @@ Validate that at least one evaluation identifier is provided. --- - + ## class `EvalResultsQueryRes` @@ -1234,7 +1257,7 @@ Validate that at least one evaluation identifier is provided. --- - + ## class `EvalResultsRow` @@ -1246,7 +1269,7 @@ Validate that at least one evaluation identifier is provided. --- - + ## class `EvalResultsRowEvaluation` @@ -1257,7 +1280,7 @@ Validate that at least one evaluation identifier is provided. --- - + ## class `EvalResultsScorerStats` Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.leaf). @@ -1266,7 +1289,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l - `scorer_key`: `` - `path`: `str | None` -- `value_type`: `typing.Optional[typing.Literal['binary', 'continuous']]` +- `value_type`: `typing.Optional[typing.Literal['binary', 'continuous', 'text']]` - `trial_count`: `` - `numeric_count`: `` - `numeric_mean`: `float | None` @@ -1277,7 +1300,21 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + + +## class `EvalResultsSortBy` +Sort specification for evaluation results, extending SortBy + +**Pydantic Fields:** + +- `field`: `` +- `direction`: `typing.Literal['asc', 'desc']` +- `evaluation_call_id`: `str | None` +- `mode`: `typing.Literal['value', 'difference']` + +--- + + ## class `EvalResultsSummaryRes` @@ -1288,7 +1325,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvalResultsTrial` @@ -1301,10 +1338,11 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l - `model_latency_seconds`: `float | None` - `total_tokens`: `int | None` - `scorer_call_ids`: `dict[str, str]` +- `genai_span_ref`: `list[GenAISpanRef] | None` --- - + ## class `EvaluateModelReq` @@ -1317,7 +1355,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluateModelRes` @@ -1327,7 +1365,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationCreateBody` @@ -1343,7 +1381,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationCreateReq` @@ -1361,7 +1399,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationCreateRes` @@ -1374,7 +1412,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationDeleteReq` @@ -1387,7 +1425,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationDeleteRes` @@ -1397,7 +1435,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationListReq` @@ -1410,7 +1448,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationReadReq` @@ -1423,7 +1461,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationReadRes` @@ -1445,7 +1483,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunCreateBody` @@ -1456,7 +1494,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunCreateReq` @@ -1469,7 +1507,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunCreateRes` @@ -1479,7 +1517,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunDeleteReq` @@ -1491,7 +1529,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunDeleteRes` @@ -1501,7 +1539,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunFilter` @@ -1513,7 +1551,7 @@ Stats for a single flattened score dimension (scorer_key or scorer_key.path.to.l --- - + ## class `EvaluationRunFinishBody` Request body for finishing an evaluation run via REST API. @@ -1526,7 +1564,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationRunFinishReq` @@ -1539,7 +1577,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationRunFinishRes` @@ -1549,7 +1587,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationRunListReq` @@ -1562,7 +1600,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationRunReadReq` @@ -1573,7 +1611,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationRunReadRes` @@ -1589,7 +1627,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationStatusComplete` @@ -1600,7 +1638,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationStatusFailed` @@ -1611,7 +1649,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationStatusNotFound` @@ -1621,7 +1659,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationStatusReq` @@ -1632,7 +1670,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationStatusRes` @@ -1642,7 +1680,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `EvaluationStatusRunning` @@ -1654,7 +1692,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `ExportTracePartialSuccess` @@ -1665,13 +1703,13 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `ExtraKeysTypedDict` --- - + ## class `Feedback` @@ -1693,7 +1731,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `FeedbackCreateBatchReq` @@ -1703,7 +1741,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `FeedbackCreateBatchRes` @@ -1713,7 +1751,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `FeedbackCreateReq` @@ -1734,7 +1772,7 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `FeedbackCreateRes` @@ -1747,13 +1785,13 @@ This model excludes project_id and evaluation_run_id since they come from the UR --- - + ## class `FeedbackDict` --- - + ## class `FeedbackMetricSpec` Specification for a feedback payload metric to aggregate. @@ -1767,7 +1805,7 @@ Specification for a feedback payload metric to aggregate. --- - + ## class `FeedbackPayloadPath` Discovered path in feedback payload with inferred type. @@ -1779,7 +1817,7 @@ Discovered path in feedback payload with inferred type. --- - + ## class `FeedbackPayloadSchemaReq` Request for feedback payload schema discovery. @@ -1793,7 +1831,7 @@ Request for feedback payload schema discovery. - `trigger_ref`: `str | None` - `sample_limit`: `` - + ### method `validate_date_range` @@ -1805,7 +1843,7 @@ Ensure feedback requests are bounded to a safe date range. --- - + ## class `FeedbackPayloadSchemaRes` Response with discovered feedback payload paths and types. @@ -1816,7 +1854,7 @@ Response with discovered feedback payload paths and types. --- - + ## class `FeedbackPurgeReq` @@ -1827,13 +1865,13 @@ Response with discovered feedback payload paths and types. --- - + ## class `FeedbackPurgeRes` --- - + ## class `FeedbackQueryReq` @@ -1848,7 +1886,7 @@ Response with discovered feedback payload paths and types. --- - + ## class `FeedbackQueryRes` @@ -1858,7 +1896,7 @@ Response with discovered feedback payload paths and types. --- - + ## class `FeedbackReplaceReq` @@ -1880,7 +1918,7 @@ Response with discovered feedback payload paths and types. --- - + ## class `FeedbackReplaceRes` @@ -1893,7 +1931,7 @@ Response with discovered feedback payload paths and types. --- - + ## class `FeedbackStatsReq` Request for aggregated feedback statistics over time buckets. @@ -1909,7 +1947,7 @@ Request for aggregated feedback statistics over time buckets. - `timezone`: `` - `metrics`: `list[FeedbackMetricSpec]` - + ### method `validate_date_range` @@ -1921,7 +1959,7 @@ Ensure feedback requests are bounded to a safe date range. --- - + ## class `FeedbackStatsRes` Response with time-series feedback statistics. @@ -1937,7 +1975,7 @@ Response with time-series feedback statistics. --- - + ## class `FileContentReadReq` @@ -1948,7 +1986,7 @@ Response with time-series feedback statistics. --- - + ## class `FileContentReadRes` @@ -1958,7 +1996,7 @@ Response with time-series feedback statistics. --- - + ## class `FileCreateReq` @@ -1971,7 +2009,7 @@ Response with time-series feedback statistics. --- - + ## class `FileCreateRes` @@ -1981,7 +2019,7 @@ Response with time-series feedback statistics. --- - + ## class `FilesStatsReq` @@ -1991,7 +2029,7 @@ Response with time-series feedback statistics. --- - + ## class `FilesStatsRes` @@ -2001,7 +2039,7 @@ Response with time-series feedback statistics. --- - + ## class `FullTraceServerInterface` Complete trace server interface supporting both V1 and Object APIs. @@ -2010,7 +2048,7 @@ This protocol represents a trace server implementation that supports the full se --- - + ### method `actions_execute_batch` @@ -2020,7 +2058,91 @@ actions_execute_batch(req: ActionsExecuteBatchReq) → ActionsExecuteBatchRes --- - + + +### method `agent_agents_query` + +```python +agent_agents_query(req: AgentsQueryReq) → AgentsQueryRes +``` + +--- + + + +### method `agent_conversation_chat` + +```python +agent_conversation_chat( + req: AgentConversationChatReq +) → AgentConversationChatRes +``` + +--- + + + +### method `agent_custom_attrs_schema` + +```python +agent_custom_attrs_schema( + req: AgentCustomAttrsSchemaReq +) → AgentCustomAttrsSchemaRes +``` + +--- + + + +### method `agent_search` + +```python +agent_search(req: AgentSearchReq) → AgentSearchRes +``` + +--- + + + +### method `agent_spans_query` + +```python +agent_spans_query(req: AgentSpansQueryReq) → AgentSpansQueryRes +``` + +--- + + + +### method `agent_spans_stats` + +```python +agent_spans_stats(req: AgentSpanStatsReq) → AgentSpanStatsRes +``` + +--- + + + +### method `agent_traces_chat` + +```python +agent_traces_chat(req: AgentTraceChatReq) → AgentTraceChatRes +``` + +--- + + + +### method `agent_versions_query` + +```python +agent_versions_query(req: AgentVersionsQueryReq) → AgentVersionsQueryRes +``` + +--- + + ### method `aliases_list` @@ -2030,7 +2152,7 @@ aliases_list(req: AliasesListReq) → AliasesListRes --- - + ### method `annotation_queue_add_calls` @@ -2042,7 +2164,7 @@ annotation_queue_add_calls( --- - + ### method `annotation_queue_create` @@ -2054,7 +2176,7 @@ annotation_queue_create( --- - + ### method `annotation_queue_delete` @@ -2066,7 +2188,7 @@ annotation_queue_delete( --- - + ### method `annotation_queue_items_query` @@ -2078,7 +2200,7 @@ annotation_queue_items_query( --- - + ### method `annotation_queue_read` @@ -2088,7 +2210,7 @@ annotation_queue_read(req: AnnotationQueueReadReq) → AnnotationQueueReadRes --- - + ### method `annotation_queue_update` @@ -2100,7 +2222,7 @@ annotation_queue_update( --- - + ### method `annotation_queues_query_stream` @@ -2112,7 +2234,7 @@ annotation_queues_query_stream( --- - + ### method `annotation_queues_stats` @@ -2124,7 +2246,7 @@ annotation_queues_stats( --- - + ### method `annotator_queue_items_progress_update` @@ -2136,7 +2258,7 @@ annotator_queue_items_progress_update( --- - + ### method `call_end` @@ -2146,7 +2268,7 @@ call_end(req: CallEndReq) → CallEndRes --- - + ### method `call_end_v2` @@ -2156,7 +2278,7 @@ call_end_v2(req: CallEndV2Req) → CallEndV2Res --- - + ### method `call_read` @@ -2166,7 +2288,7 @@ call_read(req: CallReadReq) → CallReadRes --- - + ### method `call_start` @@ -2176,7 +2298,7 @@ call_start(req: CallStartReq) → CallStartRes --- - + ### method `call_start_batch` @@ -2186,7 +2308,7 @@ call_start_batch(req: CallCreateBatchReq) → CallCreateBatchRes --- - + ### method `call_start_v2` @@ -2196,7 +2318,7 @@ call_start_v2(req: CallStartV2Req) → CallStartV2Res --- - + ### method `call_stats` @@ -2206,7 +2328,7 @@ call_stats(req: 'CallStatsReq') → CallStatsRes --- - + ### method `call_update` @@ -2216,7 +2338,7 @@ call_update(req: CallUpdateReq) → CallUpdateRes --- - + ### method `calls_complete` @@ -2226,7 +2348,7 @@ calls_complete(req: CallsUpsertCompleteReq) → CallsUpsertCompleteRes --- - + ### method `calls_delete` @@ -2236,7 +2358,7 @@ calls_delete(req: CallsDeleteReq) → CallsDeleteRes --- - + ### method `calls_query` @@ -2246,7 +2368,7 @@ calls_query(req: CallsQueryReq) → CallsQueryRes --- - + ### method `calls_query_stats` @@ -2256,7 +2378,7 @@ calls_query_stats(req: CallsQueryStatsReq) → CallsQueryStatsRes --- - + ### method `calls_query_stream` @@ -2266,7 +2388,7 @@ calls_query_stream(req: CallsQueryReq) → Iterator[CallSchema] --- - + ### method `calls_score` @@ -2276,7 +2398,7 @@ calls_score(req: CallsScoreReq) → CallsScoreRes --- - + ### method `calls_usage` @@ -2286,7 +2408,7 @@ calls_usage(req: 'CallsUsageReq') → CallsUsageRes --- - + ### method `completions_create` @@ -2296,7 +2418,7 @@ completions_create(req: CompletionsCreateReq) → CompletionsCreateRes --- - + ### method `completions_create_stream` @@ -2306,7 +2428,7 @@ completions_create_stream(req: CompletionsCreateReq) → Iterator[dict[str, Any] --- - + ### method `cost_create` @@ -2316,7 +2438,7 @@ cost_create(req: CostCreateReq) → CostCreateRes --- - + ### method `cost_purge` @@ -2326,7 +2448,7 @@ cost_purge(req: CostPurgeReq) → CostPurgeRes --- - + ### method `cost_query` @@ -2336,7 +2458,7 @@ cost_query(req: CostQueryReq) → CostQueryRes --- - + ### method `dataset_create` @@ -2346,7 +2468,7 @@ dataset_create(req: DatasetCreateReq) → DatasetCreateRes --- - + ### method `dataset_delete` @@ -2356,7 +2478,7 @@ dataset_delete(req: DatasetDeleteReq) → DatasetDeleteRes --- - + ### method `dataset_list` @@ -2366,7 +2488,7 @@ dataset_list(req: DatasetListReq) → Iterator[DatasetReadRes] --- - + ### method `dataset_read` @@ -2376,7 +2498,7 @@ dataset_read(req: DatasetReadReq) → DatasetReadRes --- - + ### method `eval_results_query` @@ -2386,7 +2508,7 @@ eval_results_query(req: EvalResultsQueryReq) → EvalResultsQueryRes --- - + ### method `evaluate_model` @@ -2396,7 +2518,7 @@ evaluate_model(req: EvaluateModelReq) → EvaluateModelRes --- - + ### method `evaluation_create` @@ -2406,7 +2528,7 @@ evaluation_create(req: EvaluationCreateReq) → EvaluationCreateRes --- - + ### method `evaluation_delete` @@ -2416,7 +2538,7 @@ evaluation_delete(req: EvaluationDeleteReq) → EvaluationDeleteRes --- - + ### method `evaluation_list` @@ -2426,7 +2548,7 @@ evaluation_list(req: EvaluationListReq) → Iterator[EvaluationReadRes] --- - + ### method `evaluation_read` @@ -2436,7 +2558,7 @@ evaluation_read(req: EvaluationReadReq) → EvaluationReadRes --- - + ### method `evaluation_run_create` @@ -2446,7 +2568,7 @@ evaluation_run_create(req: EvaluationRunCreateReq) → EvaluationRunCreateRes --- - + ### method `evaluation_run_delete` @@ -2456,7 +2578,7 @@ evaluation_run_delete(req: EvaluationRunDeleteReq) → EvaluationRunDeleteRes --- - + ### method `evaluation_run_finish` @@ -2466,7 +2588,7 @@ evaluation_run_finish(req: EvaluationRunFinishReq) → EvaluationRunFinishRes --- - + ### method `evaluation_run_list` @@ -2476,7 +2598,7 @@ evaluation_run_list(req: EvaluationRunListReq) → Iterator[EvaluationRunReadRes --- - + ### method `evaluation_run_read` @@ -2486,7 +2608,7 @@ evaluation_run_read(req: EvaluationRunReadReq) → EvaluationRunReadRes --- - + ### method `evaluation_status` @@ -2496,7 +2618,7 @@ evaluation_status(req: EvaluationStatusReq) → EvaluationStatusRes --- - + ### method `feedback_create` @@ -2506,7 +2628,7 @@ feedback_create(req: FeedbackCreateReq) → FeedbackCreateRes --- - + ### method `feedback_create_batch` @@ -2516,7 +2638,7 @@ feedback_create_batch(req: FeedbackCreateBatchReq) → FeedbackCreateBatchRes --- - + ### method `feedback_payload_schema` @@ -2528,7 +2650,7 @@ feedback_payload_schema( --- - + ### method `feedback_purge` @@ -2538,7 +2660,7 @@ feedback_purge(req: FeedbackPurgeReq) → FeedbackPurgeRes --- - + ### method `feedback_query` @@ -2548,7 +2670,7 @@ feedback_query(req: FeedbackQueryReq) → FeedbackQueryRes --- - + ### method `feedback_replace` @@ -2558,7 +2680,7 @@ feedback_replace(req: FeedbackReplaceReq) → FeedbackReplaceRes --- - + ### method `feedback_stats` @@ -2568,7 +2690,7 @@ feedback_stats(req: FeedbackStatsReq) → FeedbackStatsRes --- - + ### method `file_content_read` @@ -2578,7 +2700,7 @@ file_content_read(req: FileContentReadReq) → FileContentReadRes --- - + ### method `file_create` @@ -2588,7 +2710,7 @@ file_create(req: FileCreateReq) → FileCreateRes --- - + ### method `files_stats` @@ -2598,7 +2720,17 @@ files_stats(req: FilesStatsReq) → FilesStatsRes --- - + + +### method `genai_otel_export` + +```python +genai_otel_export(req: GenAIOTelExportReq) → GenAIOTelExportRes +``` + +--- + + ### method `image_create` @@ -2608,7 +2740,7 @@ image_create(req: ImageGenerationCreateReq) → ImageGenerationCreateRes --- - + ### method `model_create` @@ -2618,7 +2750,7 @@ model_create(req: ModelCreateReq) → ModelCreateRes --- - + ### method `model_delete` @@ -2628,7 +2760,7 @@ model_delete(req: ModelDeleteReq) → ModelDeleteRes --- - + ### method `model_list` @@ -2638,7 +2770,7 @@ model_list(req: ModelListReq) → Iterator[ModelReadRes] --- - + ### method `model_read` @@ -2648,7 +2780,7 @@ model_read(req: ModelReadReq) → ModelReadRes --- - + ### method `obj_add_tags` @@ -2658,7 +2790,7 @@ obj_add_tags(req: ObjAddTagsReq) → ObjAddTagsRes --- - + ### method `obj_create` @@ -2668,7 +2800,7 @@ obj_create(req: ObjCreateReq) → ObjCreateRes --- - + ### method `obj_delete` @@ -2678,7 +2810,7 @@ obj_delete(req: ObjDeleteReq) → ObjDeleteRes --- - + ### method `obj_read` @@ -2688,7 +2820,7 @@ obj_read(req: ObjReadReq) → ObjReadRes --- - + ### method `obj_remove_aliases` @@ -2698,7 +2830,7 @@ obj_remove_aliases(req: ObjRemoveAliasesReq) → ObjRemoveAliasesRes --- - + ### method `obj_remove_tags` @@ -2708,7 +2840,7 @@ obj_remove_tags(req: ObjRemoveTagsReq) → ObjRemoveTagsRes --- - + ### method `obj_set_aliases` @@ -2718,7 +2850,7 @@ obj_set_aliases(req: ObjSetAliasesReq) → ObjSetAliasesRes --- - + ### method `objs_query` @@ -2728,7 +2860,7 @@ objs_query(req: ObjQueryReq) → ObjQueryRes --- - + ### method `op_create` @@ -2738,7 +2870,7 @@ op_create(req: OpCreateReq) → OpCreateRes --- - + ### method `op_delete` @@ -2748,7 +2880,7 @@ op_delete(req: OpDeleteReq) → OpDeleteRes --- - + ### method `op_list` @@ -2758,7 +2890,7 @@ op_list(req: OpListReq) → Iterator[OpReadRes] --- - + ### method `op_read` @@ -2768,7 +2900,7 @@ op_read(req: OpReadReq) → OpReadRes --- - + ### method `otel_export` @@ -2778,7 +2910,7 @@ otel_export(req: OTelExportReq) → OTelExportRes --- - + ### method `prediction_create` @@ -2788,7 +2920,7 @@ prediction_create(req: PredictionCreateReq) → PredictionCreateRes --- - + ### method `prediction_delete` @@ -2798,7 +2930,7 @@ prediction_delete(req: PredictionDeleteReq) → PredictionDeleteRes --- - + ### method `prediction_finish` @@ -2808,7 +2940,7 @@ prediction_finish(req: PredictionFinishReq) → PredictionFinishRes --- - + ### method `prediction_list` @@ -2818,7 +2950,7 @@ prediction_list(req: PredictionListReq) → Iterator[PredictionReadRes] --- - + ### method `prediction_read` @@ -2828,7 +2960,7 @@ prediction_read(req: PredictionReadReq) → PredictionReadRes --- - + ### method `project_stats` @@ -2838,7 +2970,31 @@ project_stats(req: ProjectStatsReq) → ProjectStatsRes --- - + + +### method `project_ttl_settings_read` + +```python +project_ttl_settings_read( + req: ProjectTTLSettingsReadReq +) → ProjectTTLSettingsReadRes +``` + +--- + + + +### method `project_ttl_settings_update` + +```python +project_ttl_settings_update( + req: ProjectTTLSettingsUpdateReq +) → ProjectTTLSettingsUpdateRes +``` + +--- + + ### method `refs_read_batch` @@ -2848,7 +3004,7 @@ refs_read_batch(req: RefsReadBatchReq) → RefsReadBatchRes --- - + ### method `score_create` @@ -2858,7 +3014,7 @@ score_create(req: ScoreCreateReq) → ScoreCreateRes --- - + ### method `score_delete` @@ -2868,7 +3024,7 @@ score_delete(req: ScoreDeleteReq) → ScoreDeleteRes --- - + ### method `score_list` @@ -2878,7 +3034,7 @@ score_list(req: ScoreListReq) → Iterator[ScoreReadRes] --- - + ### method `score_read` @@ -2888,7 +3044,7 @@ score_read(req: ScoreReadReq) → ScoreReadRes --- - + ### method `scorer_create` @@ -2898,7 +3054,7 @@ scorer_create(req: ScorerCreateReq) → ScorerCreateRes --- - + ### method `scorer_delete` @@ -2908,7 +3064,7 @@ scorer_delete(req: ScorerDeleteReq) → ScorerDeleteRes --- - + ### method `scorer_list` @@ -2918,7 +3074,7 @@ scorer_list(req: ScorerListReq) → Iterator[ScorerReadRes] --- - + ### method `scorer_read` @@ -2928,7 +3084,7 @@ scorer_read(req: ScorerReadReq) → ScorerReadRes --- - + ### method `table_create` @@ -2938,7 +3094,7 @@ table_create(req: TableCreateReq) → TableCreateRes --- - + ### method `table_create_from_digests` @@ -2950,7 +3106,7 @@ table_create_from_digests( --- - + ### method `table_query` @@ -2960,7 +3116,7 @@ table_query(req: TableQueryReq) → TableQueryRes --- - + ### method `table_query_stats` @@ -2970,7 +3126,7 @@ table_query_stats(req: TableQueryStatsReq) → TableQueryStatsRes --- - + ### method `table_query_stats_batch` @@ -2980,7 +3136,7 @@ table_query_stats_batch(req: TableQueryStatsBatchReq) → TableQueryStatsBatchRe --- - + ### method `table_query_stream` @@ -2990,7 +3146,7 @@ table_query_stream(req: TableQueryReq) → Iterator[TableRowSchema] --- - + ### method `table_update` @@ -3000,7 +3156,7 @@ table_update(req: TableUpdateReq) → TableUpdateRes --- - + ### method `tags_list` @@ -3010,7 +3166,7 @@ tags_list(req: TagsListReq) → TagsListRes --- - + ### method `threads_query_stream` @@ -3020,7 +3176,7 @@ threads_query_stream(req: ThreadsQueryReq) → Iterator[ThreadSchema] --- - + ### method `trace_usage` @@ -3030,7 +3186,18 @@ trace_usage(req: 'TraceUsageReq') → TraceUsageRes --- - + + +## class `GenAISpanRef` + +**Pydantic Fields:** + +- `trace_id`: `` +- `span_id`: `` + +--- + + ## class `ImageGenerationCreateReq` @@ -3043,7 +3210,7 @@ trace_usage(req: 'TraceUsageReq') → TraceUsageRes --- - + ## class `ImageGenerationCreateRes` @@ -3054,7 +3221,7 @@ trace_usage(req: 'TraceUsageReq') → TraceUsageRes --- - + ## class `ImageGenerationRequestInputs` @@ -3066,7 +3233,7 @@ trace_usage(req: 'TraceUsageReq') → TraceUsageRes --- - + ## class `LLMAggregatedUsage` Aggregated usage metrics for a specific LLM. @@ -3077,24 +3244,28 @@ Aggregated usage metrics for a specific LLM. - `prompt_tokens`: `` - `completion_tokens`: `` - `total_tokens`: `` +- `cache_read_input_tokens`: `` +- `cache_creation_input_tokens`: `` - `prompt_tokens_total_cost`: `float | None` - `completion_tokens_total_cost`: `float | None` +- `cache_read_input_tokens_total_cost`: `float | None` +- `cache_creation_input_tokens_total_cost`: `float | None` --- - + ## class `LLMCostSchema` --- - + ## class `LLMUsageSchema` --- - + ## class `ModelCreateBody` @@ -3107,7 +3278,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelCreateReq` @@ -3122,7 +3293,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelCreateRes` @@ -3135,7 +3306,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelDeleteReq` @@ -3148,7 +3319,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelDeleteRes` @@ -3158,7 +3329,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelListReq` @@ -3170,7 +3341,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelReadReq` @@ -3182,7 +3353,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ModelReadRes` @@ -3199,7 +3370,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `OTelExportReq` @@ -3211,7 +3382,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `OTelExportRes` @@ -3221,7 +3392,7 @@ Aggregated usage metrics for a specific LLM. --- - + ## class `ObjAddTagsReq` @@ -3233,7 +3404,7 @@ Aggregated usage metrics for a specific LLM. - `tags`: `list[str]` - `wb_user_id`: `str | None` - + ### method `validate_tags` @@ -3243,13 +3414,13 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjAddTagsRes` --- - + ## class `ObjCreateReq` @@ -3259,7 +3430,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjCreateRes` @@ -3270,7 +3441,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjDeleteReq` @@ -3282,7 +3453,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjDeleteRes` @@ -3292,7 +3463,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjQueryReq` @@ -3309,7 +3480,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjQueryRes` @@ -3319,7 +3490,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjReadReq` @@ -3333,7 +3504,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjReadRes` @@ -3343,7 +3514,7 @@ validate_tags() → ObjAddTagsReq --- - + ## class `ObjRemoveAliasesReq` @@ -3354,7 +3525,7 @@ validate_tags() → ObjAddTagsReq - `aliases`: `list[str]` - `wb_user_id`: `str | None` - + ### method `validate_aliases` @@ -3364,13 +3535,13 @@ validate_aliases() → ObjRemoveAliasesReq --- - + ## class `ObjRemoveAliasesRes` --- - + ## class `ObjRemoveTagsReq` @@ -3384,13 +3555,13 @@ validate_aliases() → ObjRemoveAliasesReq --- - + ## class `ObjRemoveTagsRes` --- - + ## class `ObjSchema` @@ -3414,7 +3585,7 @@ validate_aliases() → ObjRemoveAliasesReq --- - + ## class `ObjSchemaForInsert` @@ -3428,17 +3599,17 @@ validate_aliases() → ObjRemoveAliasesReq - `expected_digest`: `str | None` - `wb_user_id`: `str | None` - + ### method `model_post_init` ```python -model_post_init(_ObjSchemaForInsert__context: Any) → None +model_post_init(context: Any) → None ``` --- - + ## class `ObjSetAliasesReq` @@ -3450,7 +3621,7 @@ model_post_init(_ObjSchemaForInsert__context: Any) → None - `aliases`: `list[str]` - `wb_user_id`: `str | None` - + ### method `validate_aliases` @@ -3460,13 +3631,13 @@ validate_aliases() → ObjSetAliasesReq --- - + ## class `ObjSetAliasesRes` --- - + ## class `ObjectInterface` Object API endpoints for Trace Server. @@ -3475,7 +3646,7 @@ This protocol contains object management APIs that provide cleaner, more RESTful --- - + ### method `call_end_v2` @@ -3485,7 +3656,7 @@ call_end_v2(req: CallEndV2Req) → CallEndV2Res --- - + ### method `call_start_v2` @@ -3495,7 +3666,7 @@ call_start_v2(req: CallStartV2Req) → CallStartV2Res --- - + ### method `calls_complete` @@ -3505,7 +3676,7 @@ calls_complete(req: CallsUpsertCompleteReq) → CallsUpsertCompleteRes --- - + ### method `dataset_create` @@ -3515,7 +3686,7 @@ dataset_create(req: DatasetCreateReq) → DatasetCreateRes --- - + ### method `dataset_delete` @@ -3525,7 +3696,7 @@ dataset_delete(req: DatasetDeleteReq) → DatasetDeleteRes --- - + ### method `dataset_list` @@ -3535,7 +3706,7 @@ dataset_list(req: DatasetListReq) → Iterator[DatasetReadRes] --- - + ### method `dataset_read` @@ -3545,7 +3716,7 @@ dataset_read(req: DatasetReadReq) → DatasetReadRes --- - + ### method `eval_results_query` @@ -3555,7 +3726,7 @@ eval_results_query(req: EvalResultsQueryReq) → EvalResultsQueryRes --- - + ### method `evaluation_create` @@ -3565,7 +3736,7 @@ evaluation_create(req: EvaluationCreateReq) → EvaluationCreateRes --- - + ### method `evaluation_delete` @@ -3575,7 +3746,7 @@ evaluation_delete(req: EvaluationDeleteReq) → EvaluationDeleteRes --- - + ### method `evaluation_list` @@ -3585,7 +3756,7 @@ evaluation_list(req: EvaluationListReq) → Iterator[EvaluationReadRes] --- - + ### method `evaluation_read` @@ -3595,7 +3766,7 @@ evaluation_read(req: EvaluationReadReq) → EvaluationReadRes --- - + ### method `evaluation_run_create` @@ -3605,7 +3776,7 @@ evaluation_run_create(req: EvaluationRunCreateReq) → EvaluationRunCreateRes --- - + ### method `evaluation_run_delete` @@ -3615,7 +3786,7 @@ evaluation_run_delete(req: EvaluationRunDeleteReq) → EvaluationRunDeleteRes --- - + ### method `evaluation_run_finish` @@ -3625,7 +3796,7 @@ evaluation_run_finish(req: EvaluationRunFinishReq) → EvaluationRunFinishRes --- - + ### method `evaluation_run_list` @@ -3635,7 +3806,7 @@ evaluation_run_list(req: EvaluationRunListReq) → Iterator[EvaluationRunReadRes --- - + ### method `evaluation_run_read` @@ -3645,7 +3816,7 @@ evaluation_run_read(req: EvaluationRunReadReq) → EvaluationRunReadRes --- - + ### method `model_create` @@ -3655,7 +3826,7 @@ model_create(req: ModelCreateReq) → ModelCreateRes --- - + ### method `model_delete` @@ -3665,7 +3836,7 @@ model_delete(req: ModelDeleteReq) → ModelDeleteRes --- - + ### method `model_list` @@ -3675,7 +3846,7 @@ model_list(req: ModelListReq) → Iterator[ModelReadRes] --- - + ### method `model_read` @@ -3685,7 +3856,7 @@ model_read(req: ModelReadReq) → ModelReadRes --- - + ### method `op_create` @@ -3695,7 +3866,7 @@ op_create(req: OpCreateReq) → OpCreateRes --- - + ### method `op_delete` @@ -3705,7 +3876,7 @@ op_delete(req: OpDeleteReq) → OpDeleteRes --- - + ### method `op_list` @@ -3715,7 +3886,7 @@ op_list(req: OpListReq) → Iterator[OpReadRes] --- - + ### method `op_read` @@ -3725,7 +3896,7 @@ op_read(req: OpReadReq) → OpReadRes --- - + ### method `prediction_create` @@ -3735,7 +3906,7 @@ prediction_create(req: PredictionCreateReq) → PredictionCreateRes --- - + ### method `prediction_delete` @@ -3745,7 +3916,7 @@ prediction_delete(req: PredictionDeleteReq) → PredictionDeleteRes --- - + ### method `prediction_finish` @@ -3755,7 +3926,7 @@ prediction_finish(req: PredictionFinishReq) → PredictionFinishRes --- - + ### method `prediction_list` @@ -3765,7 +3936,7 @@ prediction_list(req: PredictionListReq) → Iterator[PredictionReadRes] --- - + ### method `prediction_read` @@ -3775,7 +3946,7 @@ prediction_read(req: PredictionReadReq) → PredictionReadRes --- - + ### method `score_create` @@ -3785,7 +3956,7 @@ score_create(req: ScoreCreateReq) → ScoreCreateRes --- - + ### method `score_delete` @@ -3795,7 +3966,7 @@ score_delete(req: ScoreDeleteReq) → ScoreDeleteRes --- - + ### method `score_list` @@ -3805,7 +3976,7 @@ score_list(req: ScoreListReq) → Iterator[ScoreReadRes] --- - + ### method `score_read` @@ -3815,7 +3986,7 @@ score_read(req: ScoreReadReq) → ScoreReadRes --- - + ### method `scorer_create` @@ -3825,7 +3996,7 @@ scorer_create(req: ScorerCreateReq) → ScorerCreateRes --- - + ### method `scorer_delete` @@ -3835,7 +4006,7 @@ scorer_delete(req: ScorerDeleteReq) → ScorerDeleteRes --- - + ### method `scorer_list` @@ -3845,7 +4016,7 @@ scorer_list(req: ScorerListReq) → Iterator[ScorerReadRes] --- - + ### method `scorer_read` @@ -3855,7 +4026,7 @@ scorer_read(req: ScorerReadReq) → ScorerReadRes --- - + ## class `ObjectVersionFilter` @@ -3872,7 +4043,7 @@ scorer_read(req: ScorerReadReq) → ScorerReadRes --- - + ## class `OpCreateBody` Request body for creating an Op object via REST API. @@ -3886,7 +4057,7 @@ This model excludes project_id since it comes from the URL path in RESTful endpo --- - + ## class `OpCreateReq` Request model for creating an Op object. @@ -3902,7 +4073,7 @@ Extends OpCreateBody by adding project_id for internal API usage. --- - + ## class `OpCreateRes` Response model for creating an Op object. @@ -3915,7 +4086,7 @@ Response model for creating an Op object. --- - + ## class `OpDeleteReq` @@ -3928,7 +4099,7 @@ Response model for creating an Op object. --- - + ## class `OpDeleteRes` @@ -3938,7 +4109,7 @@ Response model for creating an Op object. --- - + ## class `OpListReq` @@ -3951,7 +4122,7 @@ Response model for creating an Op object. --- - + ## class `OpReadReq` @@ -3964,7 +4135,7 @@ Response model for creating an Op object. --- - + ## class `OpReadRes` Response model for reading an Op object. @@ -3981,7 +4152,7 @@ The code field contains the actual source code of the op. --- - + ## class `PredictionCreateBody` Request body for creating a Prediction via REST API. @@ -3994,10 +4165,11 @@ This model excludes project_id since it comes from the URL path in RESTful endpo - `inputs`: `dict[str, typing.Any]` - `output`: `typing.Any` - `evaluation_run_id`: `str | None` +- `genai_span_ref`: `list[GenAISpanRef] | None` --- - + ## class `PredictionCreateReq` Request model for creating a Prediction. @@ -4010,12 +4182,13 @@ Extends PredictionCreateBody by adding project_id for internal API usage. - `inputs`: `dict[str, typing.Any]` - `output`: `typing.Any` - `evaluation_run_id`: `str | None` +- `genai_span_ref`: `list[GenAISpanRef] | None` - `project_id`: `` - `wb_user_id`: `str | None` --- - + ## class `PredictionCreateRes` @@ -4025,7 +4198,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionDeleteReq` @@ -4037,7 +4210,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionDeleteRes` @@ -4047,7 +4220,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionFinishReq` @@ -4059,7 +4232,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionFinishRes` @@ -4069,7 +4242,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionListReq` @@ -4083,7 +4256,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionListRes` @@ -4093,7 +4266,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionReadReq` @@ -4105,7 +4278,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `PredictionReadRes` @@ -4120,7 +4293,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `ProcessedResourceSpans` @@ -4129,11 +4302,11 @@ Extends PredictionCreateBody by adding project_id for internal API usage. - `entity`: `` - `project`: `` - `run_id`: `str | None` -- `resource_spans`: `typing.Any` +- `resource_spans`: `` --- - + ## class `ProjectStatsReq` @@ -4147,7 +4320,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `ProjectStatsRes` @@ -4160,7 +4333,49 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + + +## class `ProjectTTLSettingsReadReq` + +**Pydantic Fields:** + +- `project_id`: `` + +--- + + + +## class `ProjectTTLSettingsReadRes` + +**Pydantic Fields:** + +- `retention_days`: `int | None` + +--- + + + +## class `ProjectTTLSettingsUpdateReq` + +**Pydantic Fields:** + +- `project_id`: `` +- `retention_days`: `int | None` +- `wb_user_id`: `str | None` + +--- + + + +## class `ProjectTTLSettingsUpdateRes` + +**Pydantic Fields:** + +- `retention_days`: `int | None` + +--- + + ## class `RefsReadBatchReq` @@ -4170,7 +4385,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `RefsReadBatchRes` @@ -4180,7 +4395,7 @@ Extends PredictionCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreCreateBody` Request body for creating a Score via REST API. @@ -4196,7 +4411,7 @@ This model excludes project_id since it comes from the URL path in RESTful endpo --- - + ## class `ScoreCreateReq` Request model for creating a Score. @@ -4214,7 +4429,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreCreateRes` @@ -4224,7 +4439,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreDeleteReq` @@ -4236,7 +4451,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreDeleteRes` @@ -4246,7 +4461,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreListReq` @@ -4260,7 +4475,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreReadReq` @@ -4272,7 +4487,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScoreReadRes` @@ -4286,7 +4501,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerCreateBody` @@ -4298,7 +4513,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerCreateReq` @@ -4312,7 +4527,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerCreateRes` @@ -4325,7 +4540,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerDeleteReq` @@ -4338,7 +4553,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerDeleteRes` @@ -4348,7 +4563,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerListReq` @@ -4361,7 +4576,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerReadReq` @@ -4374,7 +4589,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ScorerReadRes` @@ -4390,7 +4605,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `StartedCallSchemaForInsert` @@ -4414,19 +4629,19 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `SummaryInsertMap` --- - + ## class `SummaryMap` --- - + ## class `TableAppendSpec` @@ -4436,7 +4651,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableAppendSpecPayload` @@ -4446,7 +4661,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableCreateFromDigestsReq` @@ -4458,7 +4673,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableCreateFromDigestsRes` @@ -4468,7 +4683,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableCreateReq` @@ -4478,7 +4693,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableCreateRes` @@ -4489,7 +4704,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableInsertSpec` @@ -4499,7 +4714,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableInsertSpecPayload` @@ -4510,7 +4725,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TablePopSpec` @@ -4520,7 +4735,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TablePopSpecPayload` @@ -4530,7 +4745,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableQueryReq` @@ -4545,7 +4760,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableQueryRes` @@ -4555,7 +4770,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableQueryStatsBatchReq` @@ -4567,7 +4782,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableQueryStatsBatchRes` @@ -4577,7 +4792,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableQueryStatsReq` @@ -4588,7 +4803,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableQueryStatsRes` @@ -4598,7 +4813,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableRowFilter` @@ -4608,7 +4823,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableRowSchema` @@ -4620,7 +4835,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableSchemaForInsert` @@ -4632,7 +4847,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableStatsRow` @@ -4644,7 +4859,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableUpdateReq` @@ -4656,7 +4871,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TableUpdateRes` @@ -4667,7 +4882,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TagsListReq` @@ -4678,7 +4893,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `TagsListRes` @@ -4688,7 +4903,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ThreadSchema` @@ -4705,7 +4920,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ThreadsQueryFilter` @@ -4717,7 +4932,7 @@ Extends ScoreCreateBody by adding project_id for internal API usage. --- - + ## class `ThreadsQueryReq` Query threads with aggregated statistics based on turn calls only. @@ -4734,13 +4949,13 @@ Turn calls are the immediate children of thread contexts (where call.id == turn_ --- - + ## class `TraceServerInterface` --- - + ### method `actions_execute_batch` @@ -4750,7 +4965,91 @@ actions_execute_batch(req: ActionsExecuteBatchReq) → ActionsExecuteBatchRes --- - + + +### method `agent_agents_query` + +```python +agent_agents_query(req: AgentsQueryReq) → AgentsQueryRes +``` + +--- + + + +### method `agent_conversation_chat` + +```python +agent_conversation_chat( + req: AgentConversationChatReq +) → AgentConversationChatRes +``` + +--- + + + +### method `agent_custom_attrs_schema` + +```python +agent_custom_attrs_schema( + req: AgentCustomAttrsSchemaReq +) → AgentCustomAttrsSchemaRes +``` + +--- + + + +### method `agent_search` + +```python +agent_search(req: AgentSearchReq) → AgentSearchRes +``` + +--- + + + +### method `agent_spans_query` + +```python +agent_spans_query(req: AgentSpansQueryReq) → AgentSpansQueryRes +``` + +--- + + + +### method `agent_spans_stats` + +```python +agent_spans_stats(req: AgentSpanStatsReq) → AgentSpanStatsRes +``` + +--- + + + +### method `agent_traces_chat` + +```python +agent_traces_chat(req: AgentTraceChatReq) → AgentTraceChatRes +``` + +--- + + + +### method `agent_versions_query` + +```python +agent_versions_query(req: AgentVersionsQueryReq) → AgentVersionsQueryRes +``` + +--- + + ### method `aliases_list` @@ -4760,7 +5059,7 @@ aliases_list(req: AliasesListReq) → AliasesListRes --- - + ### method `annotation_queue_add_calls` @@ -4772,7 +5071,7 @@ annotation_queue_add_calls( --- - + ### method `annotation_queue_create` @@ -4784,7 +5083,7 @@ annotation_queue_create( --- - + ### method `annotation_queue_delete` @@ -4796,7 +5095,7 @@ annotation_queue_delete( --- - + ### method `annotation_queue_items_query` @@ -4808,7 +5107,7 @@ annotation_queue_items_query( --- - + ### method `annotation_queue_read` @@ -4818,7 +5117,7 @@ annotation_queue_read(req: AnnotationQueueReadReq) → AnnotationQueueReadRes --- - + ### method `annotation_queue_update` @@ -4830,7 +5129,7 @@ annotation_queue_update( --- - + ### method `annotation_queues_query_stream` @@ -4842,7 +5141,7 @@ annotation_queues_query_stream( --- - + ### method `annotation_queues_stats` @@ -4854,7 +5153,7 @@ annotation_queues_stats( --- - + ### method `annotator_queue_items_progress_update` @@ -4866,7 +5165,7 @@ annotator_queue_items_progress_update( --- - + ### method `call_end` @@ -4876,7 +5175,7 @@ call_end(req: CallEndReq) → CallEndRes --- - + ### method `call_read` @@ -4886,7 +5185,7 @@ call_read(req: CallReadReq) → CallReadRes --- - + ### method `call_start` @@ -4896,7 +5195,7 @@ call_start(req: CallStartReq) → CallStartRes --- - + ### method `call_start_batch` @@ -4906,7 +5205,7 @@ call_start_batch(req: CallCreateBatchReq) → CallCreateBatchRes --- - + ### method `call_stats` @@ -4916,7 +5215,7 @@ call_stats(req: 'CallStatsReq') → CallStatsRes --- - + ### method `call_update` @@ -4926,7 +5225,7 @@ call_update(req: CallUpdateReq) → CallUpdateRes --- - + ### method `calls_delete` @@ -4936,7 +5235,7 @@ calls_delete(req: CallsDeleteReq) → CallsDeleteRes --- - + ### method `calls_query` @@ -4946,7 +5245,7 @@ calls_query(req: CallsQueryReq) → CallsQueryRes --- - + ### method `calls_query_stats` @@ -4956,7 +5255,7 @@ calls_query_stats(req: CallsQueryStatsReq) → CallsQueryStatsRes --- - + ### method `calls_query_stream` @@ -4966,7 +5265,7 @@ calls_query_stream(req: CallsQueryReq) → Iterator[CallSchema] --- - + ### method `calls_score` @@ -4976,7 +5275,7 @@ calls_score(req: CallsScoreReq) → CallsScoreRes --- - + ### method `calls_usage` @@ -4986,7 +5285,7 @@ calls_usage(req: 'CallsUsageReq') → CallsUsageRes --- - + ### method `completions_create` @@ -4996,7 +5295,7 @@ completions_create(req: CompletionsCreateReq) → CompletionsCreateRes --- - + ### method `completions_create_stream` @@ -5006,7 +5305,7 @@ completions_create_stream(req: CompletionsCreateReq) → Iterator[dict[str, Any] --- - + ### method `cost_create` @@ -5016,7 +5315,7 @@ cost_create(req: CostCreateReq) → CostCreateRes --- - + ### method `cost_purge` @@ -5026,7 +5325,7 @@ cost_purge(req: CostPurgeReq) → CostPurgeRes --- - + ### method `cost_query` @@ -5036,7 +5335,7 @@ cost_query(req: CostQueryReq) → CostQueryRes --- - + ### method `evaluate_model` @@ -5046,7 +5345,7 @@ evaluate_model(req: EvaluateModelReq) → EvaluateModelRes --- - + ### method `evaluation_status` @@ -5056,7 +5355,7 @@ evaluation_status(req: EvaluationStatusReq) → EvaluationStatusRes --- - + ### method `feedback_create` @@ -5066,7 +5365,7 @@ feedback_create(req: FeedbackCreateReq) → FeedbackCreateRes --- - + ### method `feedback_create_batch` @@ -5076,7 +5375,7 @@ feedback_create_batch(req: FeedbackCreateBatchReq) → FeedbackCreateBatchRes --- - + ### method `feedback_payload_schema` @@ -5088,7 +5387,7 @@ feedback_payload_schema( --- - + ### method `feedback_purge` @@ -5098,7 +5397,7 @@ feedback_purge(req: FeedbackPurgeReq) → FeedbackPurgeRes --- - + ### method `feedback_query` @@ -5108,7 +5407,7 @@ feedback_query(req: FeedbackQueryReq) → FeedbackQueryRes --- - + ### method `feedback_replace` @@ -5118,7 +5417,7 @@ feedback_replace(req: FeedbackReplaceReq) → FeedbackReplaceRes --- - + ### method `feedback_stats` @@ -5128,7 +5427,7 @@ feedback_stats(req: FeedbackStatsReq) → FeedbackStatsRes --- - + ### method `file_content_read` @@ -5138,7 +5437,7 @@ file_content_read(req: FileContentReadReq) → FileContentReadRes --- - + ### method `file_create` @@ -5148,7 +5447,7 @@ file_create(req: FileCreateReq) → FileCreateRes --- - + ### method `files_stats` @@ -5158,7 +5457,17 @@ files_stats(req: FilesStatsReq) → FilesStatsRes --- - + + +### method `genai_otel_export` + +```python +genai_otel_export(req: GenAIOTelExportReq) → GenAIOTelExportRes +``` + +--- + + ### method `image_create` @@ -5168,7 +5477,7 @@ image_create(req: ImageGenerationCreateReq) → ImageGenerationCreateRes --- - + ### method `obj_add_tags` @@ -5178,7 +5487,7 @@ obj_add_tags(req: ObjAddTagsReq) → ObjAddTagsRes --- - + ### method `obj_create` @@ -5188,7 +5497,7 @@ obj_create(req: ObjCreateReq) → ObjCreateRes --- - + ### method `obj_delete` @@ -5198,7 +5507,7 @@ obj_delete(req: ObjDeleteReq) → ObjDeleteRes --- - + ### method `obj_read` @@ -5208,7 +5517,7 @@ obj_read(req: ObjReadReq) → ObjReadRes --- - + ### method `obj_remove_aliases` @@ -5218,7 +5527,7 @@ obj_remove_aliases(req: ObjRemoveAliasesReq) → ObjRemoveAliasesRes --- - + ### method `obj_remove_tags` @@ -5228,7 +5537,7 @@ obj_remove_tags(req: ObjRemoveTagsReq) → ObjRemoveTagsRes --- - + ### method `obj_set_aliases` @@ -5238,7 +5547,7 @@ obj_set_aliases(req: ObjSetAliasesReq) → ObjSetAliasesRes --- - + ### method `objs_query` @@ -5248,7 +5557,7 @@ objs_query(req: ObjQueryReq) → ObjQueryRes --- - + ### method `otel_export` @@ -5258,7 +5567,7 @@ otel_export(req: OTelExportReq) → OTelExportRes --- - + ### method `project_stats` @@ -5268,7 +5577,31 @@ project_stats(req: ProjectStatsReq) → ProjectStatsRes --- - + + +### method `project_ttl_settings_read` + +```python +project_ttl_settings_read( + req: ProjectTTLSettingsReadReq +) → ProjectTTLSettingsReadRes +``` + +--- + + + +### method `project_ttl_settings_update` + +```python +project_ttl_settings_update( + req: ProjectTTLSettingsUpdateReq +) → ProjectTTLSettingsUpdateRes +``` + +--- + + ### method `refs_read_batch` @@ -5278,7 +5611,7 @@ refs_read_batch(req: RefsReadBatchReq) → RefsReadBatchRes --- - + ### method `table_create` @@ -5288,7 +5621,7 @@ table_create(req: TableCreateReq) → TableCreateRes --- - + ### method `table_create_from_digests` @@ -5300,7 +5633,7 @@ table_create_from_digests( --- - + ### method `table_query` @@ -5310,7 +5643,7 @@ table_query(req: TableQueryReq) → TableQueryRes --- - + ### method `table_query_stats` @@ -5320,7 +5653,7 @@ table_query_stats(req: TableQueryStatsReq) → TableQueryStatsRes --- - + ### method `table_query_stats_batch` @@ -5330,7 +5663,7 @@ table_query_stats_batch(req: TableQueryStatsBatchReq) → TableQueryStatsBatchRe --- - + ### method `table_query_stream` @@ -5340,7 +5673,7 @@ table_query_stream(req: TableQueryReq) → Iterator[TableRowSchema] --- - + ### method `table_update` @@ -5350,7 +5683,7 @@ table_update(req: TableUpdateReq) → TableUpdateRes --- - + ### method `tags_list` @@ -5360,7 +5693,7 @@ tags_list(req: TagsListReq) → TagsListRes --- - + ### method `threads_query_stream` @@ -5370,7 +5703,7 @@ threads_query_stream(req: ThreadsQueryReq) → Iterator[ThreadSchema] --- - + ### method `trace_usage` @@ -5380,13 +5713,13 @@ trace_usage(req: 'TraceUsageReq') → TraceUsageRes --- - + ## class `TraceStatus` --- - + ## class `TraceUsageReq` Request to compute per-call usage for a trace, with descendant rollup. @@ -5405,7 +5738,7 @@ Note: All matching calls are loaded into memory for aggregation. For very large --- - + ## class `TraceUsageRes` Response with per-call usage metrics (each includes descendant contributions). @@ -5417,20 +5750,20 @@ Response with per-call usage metrics (each includes descendant contributions). --- - + ## class `UsageMetricSpec` Specification for a usage metric to aggregate (grouped by model). **Pydantic Fields:** -- `metric`: `typing.Literal['input_tokens', 'output_tokens', 'total_tokens', 'input_cost', 'output_cost', 'total_cost']` +- `metric`: `typing.Literal['input_tokens', 'output_tokens', 'total_tokens', 'cache_read_input_tokens', 'cache_creation_input_tokens', 'input_cost', 'output_cost', 'total_cost']` - `aggregations`: `list[AggregationType]` - `percentiles`: `list[float]` --- - + ## class `WeaveSummarySchema` diff --git a/weave/reference/python-sdk/trace_server_bindings/remote_http_trace_server.mdx b/weave/reference/python-sdk/trace_server_bindings/remote_http_trace_server.mdx index 3eda207862..c40561921b 100644 --- a/weave/reference/python-sdk/trace_server_bindings/remote_http_trace_server.mdx +++ b/weave/reference/python-sdk/trace_server_bindings/remote_http_trace_server.mdx @@ -10,11 +10,11 @@ import { SourceLink } from '/snippets/_includes/source-link.mdx'; --- - + ## class `RemoteHTTPTraceServer` - + ### method `__init__` @@ -24,13 +24,14 @@ __init__( should_batch: bool = False, remote_request_bytes_limit: int = 32505856, auth: tuple[str, str] | None = None, - extra_headers: dict[str, str] | None = None + extra_headers: dict[str, str] | None = None, + entity: str | None = None ) ``` --- - + ### method `actions_execute_batch` @@ -40,7 +41,7 @@ actions_execute_batch(req: ActionsExecuteBatchReq) → ActionsExecuteBatchRes --- - + ### method `aliases_list` @@ -50,7 +51,7 @@ aliases_list(req: AliasesListReq) → AliasesListRes --- - + ### method `annotation_queue_add_calls` @@ -62,7 +63,7 @@ annotation_queue_add_calls( --- - + ### method `annotation_queue_create` @@ -74,7 +75,7 @@ annotation_queue_create( --- - + ### method `annotation_queue_delete` @@ -86,7 +87,7 @@ annotation_queue_delete( --- - + ### method `annotation_queue_items_query` @@ -98,7 +99,7 @@ annotation_queue_items_query( --- - + ### method `annotation_queue_read` @@ -108,7 +109,7 @@ annotation_queue_read(req: AnnotationQueueReadReq) → AnnotationQueueReadRes --- - + ### method `annotation_queue_update` @@ -120,7 +121,7 @@ annotation_queue_update( --- - + ### method `annotation_queues_query_stream` @@ -132,7 +133,7 @@ annotation_queues_query_stream( --- - + ### method `annotation_queues_stats` @@ -144,7 +145,7 @@ annotation_queues_stats( --- - + ### method `annotator_queue_items_progress_update` @@ -156,7 +157,7 @@ annotator_queue_items_progress_update( --- - + ### method `call_end` @@ -166,7 +167,7 @@ call_end(req: CallEndReq) → CallEndRes --- - + ### method `call_end_v2` @@ -180,7 +181,7 @@ This endpoint is used for eager ops that need their end sent separately. --- - + ### method `call_read` @@ -190,7 +191,7 @@ call_read(req: CallReadReq) → CallReadRes --- - + ### method `call_start` @@ -200,7 +201,7 @@ call_start(req: CallStartReq) → CallStartRes --- - + ### method `call_start_batch` @@ -210,7 +211,7 @@ call_start_batch(req: CallCreateBatchReq) → CallCreateBatchRes --- - + ### method `call_start_v2` @@ -224,7 +225,7 @@ This endpoint is used for eager ops that need their start visible immediately. --- - + ### method `call_update` @@ -234,7 +235,7 @@ call_update(req: CallUpdateReq) → CallUpdateRes --- - + ### method `calls_complete` @@ -248,7 +249,7 @@ This endpoint is used when use_calls_complete is enabled to send complete calls --- - + ### method `calls_delete` @@ -258,7 +259,7 @@ calls_delete(req: CallsDeleteReq) → CallsDeleteRes --- - + ### method `calls_query` @@ -268,7 +269,7 @@ calls_query(req: CallsQueryReq) → CallsQueryRes --- - + ### method `calls_query_stats` @@ -278,7 +279,7 @@ calls_query_stats(req: CallsQueryStatsReq) → CallsQueryStatsRes --- - + ### method `calls_query_stream` @@ -288,7 +289,7 @@ calls_query_stream(req: CallsQueryReq) → Iterator[CallSchema] --- - + ### method `calls_usage` @@ -298,7 +299,7 @@ calls_usage(req: CallsUsageReq) → CallsUsageRes --- - + ### method `completions_create` @@ -308,7 +309,7 @@ completions_create(req: CompletionsCreateReq) → CompletionsCreateRes --- - + ### method `completions_create_stream` @@ -318,7 +319,7 @@ completions_create_stream(req: CompletionsCreateReq) → Iterator[dict[str, Any] --- - + ### method `cost_create` @@ -328,7 +329,7 @@ cost_create(req: CostCreateReq) → CostCreateRes --- - + ### method `cost_purge` @@ -338,7 +339,7 @@ cost_purge(req: CostPurgeReq) → CostPurgeRes --- - + ### method `cost_query` @@ -348,7 +349,7 @@ cost_query(req: CostQueryReq) → CostQueryRes --- - + ### method `dataset_create` @@ -358,7 +359,7 @@ dataset_create(req: DatasetCreateReq) → DatasetCreateRes --- - + ### method `dataset_delete` @@ -368,7 +369,7 @@ dataset_delete(req: DatasetDeleteReq) → DatasetDeleteRes --- - + ### method `dataset_list` @@ -378,7 +379,7 @@ dataset_list(req: DatasetListReq) → Iterator[DatasetReadRes] --- - + ### method `dataset_read` @@ -388,7 +389,7 @@ dataset_read(req: DatasetReadReq) → DatasetReadRes --- - + ### method `delete` @@ -398,7 +399,7 @@ delete(url: str, *args: Any, **kwargs: Any) → Response --- - + ### method `ensure_project_exists` @@ -408,7 +409,7 @@ ensure_project_exists(entity: str, project: str) → EnsureProjectExistsRes --- - + ### method `evaluate_model` @@ -418,7 +419,7 @@ evaluate_model(req: EvaluateModelReq) → EvaluateModelRes --- - + ### method `evaluation_create` @@ -428,7 +429,7 @@ evaluation_create(req: EvaluationCreateReq) → EvaluationCreateRes --- - + ### method `evaluation_delete` @@ -438,7 +439,7 @@ evaluation_delete(req: EvaluationDeleteReq) → EvaluationDeleteRes --- - + ### method `evaluation_list` @@ -448,7 +449,7 @@ evaluation_list(req: EvaluationListReq) → Iterator[EvaluationReadRes] --- - + ### method `evaluation_read` @@ -458,7 +459,7 @@ evaluation_read(req: EvaluationReadReq) → EvaluationReadRes --- - + ### method `evaluation_run_create` @@ -468,7 +469,7 @@ evaluation_run_create(req: EvaluationRunCreateReq) → EvaluationRunCreateRes --- - + ### method `evaluation_run_delete` @@ -478,7 +479,7 @@ evaluation_run_delete(req: EvaluationRunDeleteReq) → EvaluationRunDeleteRes --- - + ### method `evaluation_run_finish` @@ -488,7 +489,7 @@ evaluation_run_finish(req: EvaluationRunFinishReq) → EvaluationRunFinishRes --- - + ### method `evaluation_run_list` @@ -498,7 +499,7 @@ evaluation_run_list(req: EvaluationRunListReq) → Iterator[EvaluationRunReadRes --- - + ### method `evaluation_run_read` @@ -508,7 +509,7 @@ evaluation_run_read(req: EvaluationRunReadReq) → EvaluationRunReadRes --- - + ### method `evaluation_status` @@ -518,7 +519,7 @@ evaluation_status(req: EvaluationStatusReq) → EvaluationStatusRes --- - + ### method `feedback_create` @@ -528,7 +529,7 @@ feedback_create(req: FeedbackCreateReq) → FeedbackCreateRes --- - + ### method `feedback_create_batch` @@ -538,7 +539,7 @@ feedback_create_batch(req: FeedbackCreateBatchReq) → FeedbackCreateBatchRes --- - + ### method `feedback_payload_schema` @@ -550,7 +551,7 @@ feedback_payload_schema( --- - + ### method `feedback_purge` @@ -560,7 +561,7 @@ feedback_purge(req: FeedbackPurgeReq) → FeedbackPurgeRes --- - + ### method `feedback_query` @@ -570,7 +571,7 @@ feedback_query(req: FeedbackQueryReq) → FeedbackQueryRes --- - + ### method `feedback_replace` @@ -580,7 +581,7 @@ feedback_replace(req: FeedbackReplaceReq) → FeedbackReplaceRes --- - + ### method `feedback_stats` @@ -590,7 +591,7 @@ feedback_stats(req: FeedbackStatsReq) → FeedbackStatsRes --- - + ### method `file_content_read` @@ -600,7 +601,7 @@ file_content_read(req: FileContentReadReq) → FileContentReadRes --- - + ### method `file_create` @@ -610,7 +611,7 @@ file_create(req: FileCreateReq) → FileCreateRes --- - + ### method `files_stats` @@ -620,17 +621,17 @@ files_stats(req: FilesStatsReq) → FilesStatsRes --- - + ### classmethod `from_env` ```python -from_env(should_batch: bool = False) → Self +from_env(should_batch: bool = False, entity: str | None = None) → Self ``` --- - + ### method `get` @@ -640,7 +641,7 @@ get(url: str, *args: Any, **kwargs: Any) → Response --- - + ### method `get_call_processor` @@ -652,7 +653,7 @@ Custom method not defined on the formal TraceServerInterface to expose the under --- - + ### method `get_feedback_processor` @@ -664,7 +665,7 @@ Custom method not defined on the formal TraceServerInterface to expose the under --- - + ### method `image_create` @@ -674,7 +675,7 @@ image_create(req: ImageGenerationCreateReq) → ImageGenerationCreateRes --- - + ### method `model_create` @@ -684,7 +685,7 @@ model_create(req: ModelCreateReq) → ModelCreateRes --- - + ### method `model_delete` @@ -694,7 +695,7 @@ model_delete(req: ModelDeleteReq) → ModelDeleteRes --- - + ### method `model_list` @@ -704,7 +705,7 @@ model_list(req: ModelListReq) → Iterator[ModelReadRes] --- - + ### method `model_read` @@ -714,7 +715,7 @@ model_read(req: ModelReadReq) → ModelReadRes --- - + ### method `obj_add_tags` @@ -724,7 +725,7 @@ obj_add_tags(req: ObjAddTagsReq) → ObjAddTagsRes --- - + ### method `obj_create` @@ -734,7 +735,7 @@ obj_create(req: ObjCreateReq) → ObjCreateRes --- - + ### method `obj_delete` @@ -744,7 +745,7 @@ obj_delete(req: ObjDeleteReq) → ObjDeleteRes --- - + ### method `obj_read` @@ -754,7 +755,7 @@ obj_read(req: ObjReadReq) → ObjReadRes --- - + ### method `obj_remove_aliases` @@ -764,7 +765,7 @@ obj_remove_aliases(req: ObjRemoveAliasesReq) → ObjRemoveAliasesRes --- - + ### method `obj_remove_tags` @@ -774,7 +775,7 @@ obj_remove_tags(req: ObjRemoveTagsReq) → ObjRemoveTagsRes --- - + ### method `obj_set_aliases` @@ -784,7 +785,7 @@ obj_set_aliases(req: ObjSetAliasesReq) → ObjSetAliasesRes --- - + ### method `objs_query` @@ -794,7 +795,7 @@ objs_query(req: ObjQueryReq) → ObjQueryRes --- - + ### method `op_create` @@ -804,7 +805,7 @@ op_create(req: OpCreateReq) → OpCreateRes --- - + ### method `op_delete` @@ -814,7 +815,7 @@ op_delete(req: OpDeleteReq) → OpDeleteRes --- - + ### method `op_list` @@ -824,7 +825,7 @@ op_list(req: OpListReq) → Iterator[OpReadRes] --- - + ### method `op_read` @@ -834,7 +835,7 @@ op_read(req: OpReadReq) → OpReadRes --- - + ### method `otel_export` @@ -844,7 +845,7 @@ otel_export(req: OTelExportReq) → OTelExportRes --- - + ### method `post` @@ -854,7 +855,7 @@ post(url: str, *args: Any, **kwargs: Any) → Response --- - + ### method `prediction_create` @@ -864,7 +865,7 @@ prediction_create(req: PredictionCreateReq) → PredictionCreateRes --- - + ### method `prediction_delete` @@ -874,7 +875,7 @@ prediction_delete(req: PredictionDeleteReq) → PredictionDeleteRes --- - + ### method `prediction_finish` @@ -884,7 +885,7 @@ prediction_finish(req: PredictionFinishReq) → PredictionFinishRes --- - + ### method `prediction_list` @@ -894,7 +895,7 @@ prediction_list(req: PredictionListReq) → Iterator[PredictionReadRes] --- - + ### method `prediction_read` @@ -904,7 +905,7 @@ prediction_read(req: PredictionReadReq) → PredictionReadRes --- - + ### method `project_stats` @@ -914,7 +915,31 @@ project_stats(req: ProjectStatsReq) → ProjectStatsRes --- - + + +### method `project_ttl_settings_read` + +```python +project_ttl_settings_read( + req: ProjectTTLSettingsReadReq +) → ProjectTTLSettingsReadRes +``` + +--- + + + +### method `project_ttl_settings_update` + +```python +project_ttl_settings_update( + req: ProjectTTLSettingsUpdateReq +) → ProjectTTLSettingsUpdateRes +``` + +--- + + ### method `projects_info` @@ -924,7 +949,7 @@ projects_info(req: ProjectsInfoReq) → list[ProjectsInfoRes] --- - + ### method `put` @@ -934,7 +959,7 @@ put(url: str, *args: Any, **kwargs: Any) → Response --- - + ### method `refs_read_batch` @@ -944,7 +969,7 @@ refs_read_batch(req: RefsReadBatchReq) → RefsReadBatchRes --- - + ### method `score_create` @@ -954,7 +979,7 @@ score_create(req: ScoreCreateReq) → ScoreCreateRes --- - + ### method `score_delete` @@ -964,7 +989,7 @@ score_delete(req: ScoreDeleteReq) → ScoreDeleteRes --- - + ### method `score_list` @@ -974,7 +999,7 @@ score_list(req: ScoreListReq) → Iterator[ScoreReadRes] --- - + ### method `score_read` @@ -984,7 +1009,7 @@ score_read(req: ScoreReadReq) → ScoreReadRes --- - + ### method `scorer_create` @@ -994,7 +1019,7 @@ scorer_create(req: ScorerCreateReq) → ScorerCreateRes --- - + ### method `scorer_delete` @@ -1004,7 +1029,7 @@ scorer_delete(req: ScorerDeleteReq) → ScorerDeleteRes --- - + ### method `scorer_list` @@ -1014,7 +1039,7 @@ scorer_list(req: ScorerListReq) → Iterator[ScorerReadRes] --- - + ### method `scorer_read` @@ -1024,7 +1049,7 @@ scorer_read(req: ScorerReadReq) → ScorerReadRes --- - + ### method `server_info` @@ -1034,7 +1059,7 @@ server_info() → ServerInfoRes --- - + ### method `set_auth` @@ -1044,7 +1069,7 @@ set_auth(auth: tuple[str, str]) → None --- - + ### method `table_create` @@ -1054,7 +1079,7 @@ table_create(req: TableCreateReq) → TableCreateRes --- - + ### method `table_create_from_digests` @@ -1068,7 +1093,7 @@ Create a table by specifying row digests instead of actual rows. --- - + ### method `table_query` @@ -1078,7 +1103,7 @@ table_query(req: TableQueryReq) → TableQueryRes --- - + ### method `table_query_stats` @@ -1088,7 +1113,7 @@ table_query_stats(req: TableQueryStatsReq) → TableQueryStatsRes --- - + ### method `table_query_stats_batch` @@ -1098,7 +1123,7 @@ table_query_stats_batch(req: TableQueryStatsReq) → TableQueryStatsRes --- - + ### method `table_query_stream` @@ -1108,7 +1133,7 @@ table_query_stream(req: TableQueryReq) → Iterator[TableRowSchema] --- - + ### method `table_update` @@ -1120,7 +1145,7 @@ Similar to `calls/batch_upsert`, we can dynamically adjust the payload size due --- - + ### method `tags_list` @@ -1130,7 +1155,7 @@ tags_list(req: TagsListReq) → TagsListRes --- - + ### method `threads_query_stream` @@ -1140,7 +1165,7 @@ threads_query_stream(req: ThreadsQueryReq) → Iterator[ThreadSchema] --- - + ### method `trace_usage` diff --git a/weave/reference/service-api.mdx b/weave/reference/service-api.mdx index 8e20b0a846..4aa195d55e 100644 --- a/weave/reference/service-api.mdx +++ b/weave/reference/service-api.mdx @@ -101,7 +101,6 @@ curl -H "Authorization: Bearer YOUR_API_KEY" https://trace.wandb.ai/... - **[POST `/table/query_stats`](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-stats)** - Table Query Stats - **[POST `/table/query_stats_batch`](https://docs.wandb.ai/weave/reference/service-api/tables/table-query-stats-batch)** - Table Query Stats Batch - **[POST `/table/update`](https://docs.wandb.ai/weave/reference/service-api/tables/table-update)** - Table Update -- **[POST `/table/query_stream`](https://docs.wandb.ai/weave/reference/service-api/table-query-stream)** - Table Query Stream ### Threads @@ -125,6 +124,25 @@ curl -H "Authorization: Bearer YOUR_API_KEY" https://trace.wandb.ai/... - **[POST `/annotation_queues/{queue_id}/items/query`](https://docs.wandb.ai/weave/reference/service-api/annotation-queues/annotation-queue-items-query)** - Annotation Queue Items Query - **[POST `/annotation_queues/{queue_id}/items/{item_id}/progress`](https://docs.wandb.ai/weave/reference/service-api/annotation-queues/annotation-queue-item-progress-update)** - Annotation Queue Item Progress Update +### Datasets + +- **[GET `/v2/{entity}/{project}/datasets`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-list)** - Dataset List +- **[POST `/v2/{entity}/{project}/datasets`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-create)** - Dataset Create +- **[DELETE `/v2/{entity}/{project}/datasets/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-delete)** - Dataset Delete +- **[GET `/v2/{entity}/{project}/datasets/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-read)** - Dataset Read + +### Eval Results + +- **[POST `/v2/{entity}/{project}/eval_results/query`](https://docs.wandb.ai/weave/reference/service-api/eval-results/eval-results-query)** - Eval Results Query + +### Evaluation Runs + +- **[DELETE `/v2/{entity}/{project}/evaluation_runs`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-delete)** - Evaluation Run Delete +- **[GET `/v2/{entity}/{project}/evaluation_runs`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-list)** - Evaluation Run List +- **[POST `/v2/{entity}/{project}/evaluation_runs`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-create)** - Evaluation Run Create +- **[GET `/v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-read)** - Evaluation Run Read +- **[POST `/v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-finish)** - Evaluation Run Finish + ### Evaluations - **[POST `/evaluations/evaluate_model`](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluate-model)** - Evaluate Model @@ -134,21 +152,16 @@ curl -H "Authorization: Bearer YOUR_API_KEY" https://trace.wandb.ai/... - **[DELETE `/v2/{entity}/{project}/evaluations/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-delete)** - Evaluation Delete - **[GET `/v2/{entity}/{project}/evaluations/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/evaluations/evaluation-read)** - Evaluation Read -### Scores - -- **[POST `/calls/score`](https://docs.wandb.ai/weave/reference/service-api/scores/calls-score)** - Calls Score -- **[DELETE `/v2/{entity}/{project}/scores`](https://docs.wandb.ai/weave/reference/service-api/scores/score-delete)** - Score Delete -- **[GET `/v2/{entity}/{project}/scores`](https://docs.wandb.ai/weave/reference/service-api/scores/score-list)** - Score List -- **[POST `/v2/{entity}/{project}/scores`](https://docs.wandb.ai/weave/reference/service-api/scores/score-create)** - Score Create -- **[GET `/v2/{entity}/{project}/scores/{score_id}`](https://docs.wandb.ai/weave/reference/service-api/scores/score-read)** - Score Read - ### Images - **[POST `/image/create`](https://docs.wandb.ai/weave/reference/service-api/images/image-create)** - Image Create -### Registry +### Models -- **[POST /link_to_registry](https://docs.wandb.ai/weave/reference/service-api/registry/link-to-registry)** - Link To Registry +- **[GET `/v2/{entity}/{project}/models`](https://docs.wandb.ai/weave/reference/service-api/models/model-list)** - Model List +- **[POST `/v2/{entity}/{project}/models`](https://docs.wandb.ai/weave/reference/service-api/models/model-create)** - Model Create +- **[DELETE `/v2/{entity}/{project}/models/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/models/model-delete)** - Model Delete +- **[GET `/v2/{entity}/{project}/models/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/models/model-read)** - Model Read ### Ops @@ -157,12 +170,17 @@ curl -H "Authorization: Bearer YOUR_API_KEY" https://trace.wandb.ai/... - **[DELETE `/v2/{entity}/{project}/ops/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/ops/op-delete)** - Op Delete - **[GET `/v2/{entity}/{project}/ops/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/ops/op-read)** - Op Read -### Datasets +### Predictions -- **[GET `/v2/{entity}/{project}/datasets`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-list)** - Dataset List -- **[POST `/v2/{entity}/{project}/datasets`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-create)** - Dataset Create -- **[DELETE `/v2/{entity}/{project}/datasets/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-delete)** - Dataset Delete -- **[GET `/v2/{entity}/{project}/datasets/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/datasets/dataset-read)** - Dataset Read +- **[DELETE `/v2/{entity}/{project}/predictions`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-delete)** - Prediction Delete +- **[GET `/v2/{entity}/{project}/predictions`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-list)** - Prediction List +- **[POST `/v2/{entity}/{project}/predictions`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-create)** - Prediction Create +- **[GET `/v2/{entity}/{project}/predictions/{prediction_id}`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-read)** - Prediction Read +- **[POST `/v2/{entity}/{project}/predictions/{prediction_id}/finish`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-finish)** - Prediction Finish + +### Registry + +- **[POST `/link_to_registry`](https://docs.wandb.ai/weave/reference/service-api/registry/link-to-registry)** - Link To Registry ### Scorers @@ -171,29 +189,10 @@ curl -H "Authorization: Bearer YOUR_API_KEY" https://trace.wandb.ai/... - **[DELETE `/v2/{entity}/{project}/scorers/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-delete)** - Scorer Delete - **[GET `/v2/{entity}/{project}/scorers/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/scorers/scorer-read)** - Scorer Read -### Models - -- **[GET `/v2/{entity}/{project}/models`](https://docs.wandb.ai/weave/reference/service-api/models/model-list)** - Model List -- **[POST `/v2/{entity}/{project}/models`](https://docs.wandb.ai/weave/reference/service-api/models/model-create)** - Model Create -- **[DELETE `/v2/{entity}/{project}/models/{object_id}`](https://docs.wandb.ai/weave/reference/service-api/models/model-delete)** - Model Delete -- **[GET `/v2/{entity}/{project}/models/{object_id}/versions/{digest}`](https://docs.wandb.ai/weave/reference/service-api/models/model-read)** - Model Read - -### Evaluation Runs - -- **[DELETE `/v2/{entity}/{project}/evaluation_runs`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-delete)** - Evaluation Run Delete -- **[GET `/v2/{entity}/{project}/evaluation_runs`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-list)** - Evaluation Run List -- **[POST `/v2/{entity}/{project}/evaluation_runs`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-create)** - Evaluation Run Create -- **[GET `/v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-read)** - Evaluation Run Read -- **[POST `/v2/{entity}/{project}/evaluation_runs/{evaluation_run_id}/finish`](https://docs.wandb.ai/weave/reference/service-api/evaluation-runs/evaluation-run-finish)** - Evaluation Run Finish - -### Predictions - -- **[DELETE `/v2/{entity}/{project}/predictions`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-delete)** - Prediction Delete -- **[GET `/v2/{entity}/{project}/predictions`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-list)** - Prediction List -- **[POST `/v2/{entity}/{project}/predictions`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-create)** - Prediction Create -- **[GET `/v2/{entity}/{project}/predictions/{prediction_id}`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-read)** - Prediction Read -- **[POST `/v2/{entity}/{project}/predictions/{prediction_id}/finish`](https://docs.wandb.ai/weave/reference/service-api/predictions/prediction-finish)** - Prediction Finish - -### Eval Results +### Scores -- **[POST `/v2/{entity}/{project}/eval_results/query`](https://docs.wandb.ai/weave/reference/service-api/eval-results/eval-results-query)** - Eval Results Query +- **[POST `/calls/score`](https://docs.wandb.ai/weave/reference/service-api/scores/calls-score)** - Calls Score +- **[DELETE `/v2/{entity}/{project}/scores`](https://docs.wandb.ai/weave/reference/service-api/scores/score-delete)** - Score Delete +- **[GET `/v2/{entity}/{project}/scores`](https://docs.wandb.ai/weave/reference/service-api/scores/score-list)** - Score List +- **[POST `/v2/{entity}/{project}/scores`](https://docs.wandb.ai/weave/reference/service-api/scores/score-create)** - Score Create +- **[GET `/v2/{entity}/{project}/scores/{score_id}`](https://docs.wandb.ai/weave/reference/service-api/scores/score-read)** - Score Read \ No newline at end of file diff --git a/weave/reference/service-api/openapi.json b/weave/reference/service-api/openapi.json index 25bff3484d..e4ba439d00 100644 --- a/weave/reference/service-api/openapi.json +++ b/weave/reference/service-api/openapi.json @@ -7833,6 +7833,11 @@ "type": "integer", "title": "Count" }, + "has_more": { + "type": "boolean", + "title": "Has More", + "default": false + }, "total_storage_size_bytes": { "anyOf": [ { @@ -9495,6 +9500,20 @@ }, "type": "object", "title": "Scorer Call Ids" + }, + "genai_span_ref": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/GenAISpanRef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Genai Span Ref" } }, "type": "object", @@ -10991,6 +11010,24 @@ ], "title": "FilesStatsRes" }, + "GenAISpanRef": { + "properties": { + "trace_id": { + "type": "string", + "title": "Trace Id" + }, + "span_id": { + "type": "string", + "title": "Span Id" + } + }, + "type": "object", + "required": [ + "trace_id", + "span_id" + ], + "title": "GenAISpanRef" + }, "Geolocation": { "properties": { "file_index": { @@ -13214,6 +13251,21 @@ ], "title": "Evaluation Run Id", "description": "Optional evaluation run ID to link this prediction as a child call" + }, + "genai_span_ref": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/GenAISpanRef" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Genai Span Ref", + "description": "Optional GenAI span reference(s) produced by this prediction." } }, "type": "object", diff --git a/weave/reference/typescript-sdk.mdx b/weave/reference/typescript-sdk.mdx index 763cab10dc..8addf7893c 100644 --- a/weave/reference/typescript-sdk.mdx +++ b/weave/reference/typescript-sdk.mdx @@ -14,10 +14,15 @@ weave - [Dataset](./typescript-sdk/classes/dataset) - [Evaluation](./typescript-sdk/classes/evaluation) - [EvaluationLogger](./typescript-sdk/classes/evaluationlogger) +- [LLM](./typescript-sdk/classes/llm) - [MessagesPrompt](./typescript-sdk/classes/messagesprompt) - [ObjectRef](./typescript-sdk/classes/objectref) - [ScoreLogger](./typescript-sdk/classes/scorelogger) +- [Session](./typescript-sdk/classes/session) - [StringPrompt](./typescript-sdk/classes/stringprompt) +- [SubAgent](./typescript-sdk/classes/subagent) +- [Tool](./typescript-sdk/classes/tool) +- [Turn](./typescript-sdk/classes/turn) - [WeaveClient](./typescript-sdk/classes/weaveclient) - [WeaveObject](./typescript-sdk/classes/weaveobject) @@ -25,18 +30,40 @@ weave - [CallSchema](./typescript-sdk/interfaces/callschema) - [CallsFilter](./typescript-sdk/interfaces/callsfilter) +- [GetCallsOptions](./typescript-sdk/interfaces/getcallsoptions) +- [LLMInit](./typescript-sdk/interfaces/llminit) +- [Message](./typescript-sdk/interfaces/message) +- [Query](./typescript-sdk/interfaces/query) +- [Reasoning](./typescript-sdk/interfaces/reasoning) +- [SessionInit](./typescript-sdk/interfaces/sessioninit) +- [SortBy](./typescript-sdk/interfaces/sortby) +- [SubAgentInit](./typescript-sdk/interfaces/subagentinit) +- [ToolInit](./typescript-sdk/interfaces/toolinit) +- [TurnInit](./typescript-sdk/interfaces/turninit) +- [Usage](./typescript-sdk/interfaces/usage) - [WeaveAudio](./typescript-sdk/interfaces/weaveaudio) - [WeaveImage](./typescript-sdk/interfaces/weaveimage) ### Type Aliases +- [MessagePart](./typescript-sdk/type-aliases/messagepart) +- [Modality](./typescript-sdk/type-aliases/modality) - [OpDecorator](./typescript-sdk/type-aliases/opdecorator) - [Op](./typescript-sdk/type-aliases/op) +- [Role](./typescript-sdk/type-aliases/role) ### Functions - [createOpenAIAgentsTracingProcessor](./typescript-sdk/functions/createopenaiagentstracingprocessor) +- [createOtelExtension](./typescript-sdk/functions/createotelextension) +- [endLLM](./typescript-sdk/functions/endllm) +- [endSession](./typescript-sdk/functions/endsession) +- [endTurn](./typescript-sdk/functions/endturn) +- [flushOTel](./typescript-sdk/functions/flushotel) +- [getCurrentLLM](./typescript-sdk/functions/getcurrentllm) +- [getCurrentSession](./typescript-sdk/functions/getcurrentsession) +- [getCurrentTurn](./typescript-sdk/functions/getcurrentturn) - [init](./typescript-sdk/functions/init) - [instrumentOpenAIAgents](./typescript-sdk/functions/instrumentopenaiagents) - [login](./typescript-sdk/functions/login) @@ -44,6 +71,12 @@ weave - [patchRealtimeSession](./typescript-sdk/functions/patchrealtimesession) - [requireCurrentCallStackEntry](./typescript-sdk/functions/requirecurrentcallstackentry) - [requireCurrentChildSummary](./typescript-sdk/functions/requirecurrentchildsummary) +- [runIsolated](./typescript-sdk/functions/runisolated) +- [startLLM](./typescript-sdk/functions/startllm) +- [startSession](./typescript-sdk/functions/startsession) +- [startSubagent](./typescript-sdk/functions/startsubagent) +- [startTool](./typescript-sdk/functions/starttool) +- [startTurn](./typescript-sdk/functions/startturn) - [weaveAudio](./typescript-sdk/functions/weaveaudio) - [weaveImage](./typescript-sdk/functions/weaveimage) - [withAttributes](./typescript-sdk/functions/withattributes) @@ -53,3 +86,6 @@ weave ## Type Aliases + + + diff --git a/weave/reference/typescript-sdk/classes/dataset.mdx b/weave/reference/typescript-sdk/classes/dataset.mdx index fa297ae42d..502a2ac1ac 100644 --- a/weave/reference/typescript-sdk/classes/dataset.mdx +++ b/weave/reference/typescript-sdk/classes/dataset.mdx @@ -93,7 +93,7 @@ const ref = await dataset.save() #### Defined in -[dataset.ts:51](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/dataset.ts#L51) +[dataset.ts:51](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/dataset.ts#L51) ## Properties @@ -107,7 +107,7 @@ const ref = await dataset.save() #### Defined in -[weaveObject.ts:73](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L73) +[weaveObject.ts:73](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L73) ___ @@ -117,7 +117,7 @@ ___ #### Defined in -[dataset.ts:49](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/dataset.ts#L49) +[dataset.ts:49](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/dataset.ts#L49) ## Accessors @@ -135,7 +135,7 @@ WeaveObject.description #### Defined in -[weaveObject.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L100) +[weaveObject.ts:100](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L100) ___ @@ -149,7 +149,7 @@ ___ #### Defined in -[dataset.ts:64](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/dataset.ts#L64) +[dataset.ts:64](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/dataset.ts#L64) ___ @@ -167,7 +167,7 @@ WeaveObject.name #### Defined in -[weaveObject.ts:96](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L96) +[weaveObject.ts:96](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L96) ## Methods @@ -181,7 +181,7 @@ WeaveObject.name #### Defined in -[dataset.ts:68](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/dataset.ts#L68) +[dataset.ts:68](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/dataset.ts#L68) ___ @@ -201,7 +201,7 @@ ___ #### Defined in -[dataset.ts:74](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/dataset.ts#L74) +[dataset.ts:74](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/dataset.ts#L74) ___ @@ -215,7 +215,7 @@ ___ #### Defined in -[dataset.ts:60](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/dataset.ts#L60) +[dataset.ts:60](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/dataset.ts#L60) ___ @@ -233,4 +233,4 @@ ___ #### Defined in -[weaveObject.ts:77](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L77) \ No newline at end of file +[weaveObject.ts:77](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L77) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/evaluation.mdx b/weave/reference/typescript-sdk/classes/evaluation.mdx index fc648413df..72b00abd26 100644 --- a/weave/reference/typescript-sdk/classes/evaluation.mdx +++ b/weave/reference/typescript-sdk/classes/evaluation.mdx @@ -112,7 +112,7 @@ const results = await evaluation.evaluate({ model }); #### Defined in -[evaluation.ts:148](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluation.ts#L148) +[evaluation.ts:148](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluation.ts#L148) ## Properties @@ -126,7 +126,7 @@ const results = await evaluation.evaluate({ model }); #### Defined in -[weaveObject.ts:73](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L73) +[weaveObject.ts:73](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L73) ## Accessors @@ -144,7 +144,7 @@ WeaveObject.description #### Defined in -[weaveObject.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L100) +[weaveObject.ts:100](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L100) ___ @@ -162,7 +162,7 @@ WeaveObject.name #### Defined in -[weaveObject.ts:96](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L96) +[weaveObject.ts:96](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L96) ## Methods @@ -185,7 +185,7 @@ WeaveObject.name #### Defined in -[evaluation.ts:163](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluation.ts#L163) +[evaluation.ts:163](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluation.ts#L163) ___ @@ -208,7 +208,7 @@ ___ #### Defined in -[evaluation.ts:231](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluation.ts#L231) +[evaluation.ts:231](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluation.ts#L231) ___ @@ -226,4 +226,4 @@ ___ #### Defined in -[weaveObject.ts:77](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L77) \ No newline at end of file +[weaveObject.ts:77](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L77) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/evaluationlogger.mdx b/weave/reference/typescript-sdk/classes/evaluationlogger.mdx index 63e1b898d2..1b67c83222 100644 --- a/weave/reference/typescript-sdk/classes/evaluationlogger.mdx +++ b/weave/reference/typescript-sdk/classes/evaluationlogger.mdx @@ -60,7 +60,7 @@ await ev.logSummary(); #### Defined in -[evaluationLogger.ts:554](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L554) +[evaluationLogger.ts:570](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L570) ## Methods @@ -98,7 +98,7 @@ await evalLogger.logSummary(); // Waits for everything #### Defined in -[evaluationLogger.ts:641](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L641) +[evaluationLogger.ts:657](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L657) ___ @@ -134,7 +134,7 @@ await scoreLogger.finish(); #### Defined in -[evaluationLogger.ts:666](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L666) +[evaluationLogger.ts:682](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L682) ___ @@ -160,4 +160,4 @@ it will wait for all pending operations to complete. #### Defined in -[evaluationLogger.ts:767](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L767) \ No newline at end of file +[evaluationLogger.ts:783](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L783) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/llm.mdx b/weave/reference/typescript-sdk/classes/llm.mdx new file mode 100644 index 0000000000..f1852ba250 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/llm.mdx @@ -0,0 +1,333 @@ +--- +title: "Class: LLM" +description: "TypeScript SDK reference" +--- + +[weave](../) / LLM + + + +An LLM call. Emits a `chat` span with `gen_ai.*` attributes. + +Created by `weave.startLLM()` (or `turn.startLLM()`) and terminated with +`end()`. Only one LLM may be active in an async context at a time; nest +tool/subagent calls under it via `startTool` / `startSubagent`. + +Populate `inputMessages` / `outputMessages` / `usage` / `reasoning` directly, +or via the helper functions (`output`, `think`, `attachMedia`, `record`). + +All recorded data is flushed to the span at `end()`. + +`Example` + +```ts +const llm = weave.startLLM({model: 'gpt-4o-mini', providerName: 'openai'}); +try { + llm.inputMessages = [{role: 'user', content: prompt}]; + const resp = await openai.chat.completions.create({...}); + llm.output(resp.choices[0].message.content ?? ''); + llm.record({usage: {inputTokens: resp.usage?.prompt_tokens}}); +} finally { + llm.end(); +} +``` + +## Table of contents + +### Properties + +- [inputMessages](./llm#inputmessages) +- [model](./llm#model) +- [outputMessages](./llm#outputmessages) +- [providerName](./llm#providername) +- [reasoning](./llm#reasoning) +- [usage](./llm#usage) + +### Methods + +- [attachMedia](./llm#attachmedia) +- [attachMediaUrl](./llm#attachmediaurl) +- [end](./llm#end) +- [output](./llm#output) +- [record](./llm#record) +- [startSubagent](./llm#startsubagent) +- [startTool](./llm#starttool) +- [think](./llm#think) +- [create](./llm#create) + +## Properties + +### inputMessages + +• **inputMessages**: [`Message`](../interfaces/message)[] = `[]` + +Input messages sent to the model. Flushed to `gen_ai.input.messages` on +`end()`. + +#### Defined in + +[genai/llm.ts:78](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L78) + +___ + +### model + +• `Readonly` **model**: `string` + +#### Defined in + +[genai/llm.ts:98](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L98) + +___ + +### outputMessages + +• **outputMessages**: [`Message`](../interfaces/message)[] = `[]` + +Assistant messages returned by the model. Flushed to +`gen_ai.output.messages` on `end()`. + +#### Defined in + +[genai/llm.ts:83](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L83) + +___ + +### providerName + +• `Readonly` **providerName**: `string` + +#### Defined in + +[genai/llm.ts:99](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L99) + +___ + +### reasoning + +• `Optional` **reasoning**: [`Reasoning`](../interfaces/reasoning) + +Chain-of-thought content. Folded into the last assistant message as a +ReasoningPart at serialization time. + +#### Defined in + +[genai/llm.ts:90](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L90) + +___ + +### usage + +• **usage**: [`Usage`](../interfaces/usage) = `{}` + +Token counts and cache stats. Flushed to `gen_ai.usage.*` on `end()`. + +#### Defined in + +[genai/llm.ts:85](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L85) + +## Methods + +### attachMedia + +▸ **attachMedia**(`opts`): `this` + +Attach a media part to the last input message. Pick exactly one of + `content` (inline base64 bytes), `uri` (URI reference), or `fileId` + (pre-uploaded file id). + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | `AttachMediaOpts` | + +#### Returns + +`this` + +#### Defined in + +[genai/llm.ts:168](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L168) + +___ + +### attachMediaUrl + +▸ **attachMediaUrl**(`url`, `opts`): `this` + +Convenience for `attachMedia({uri, modality})`. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `url` | `string` | +| `opts` | `Object` | +| `opts.modality` | [`Modality`](../#modality) | + +#### Returns + +`this` + +#### Defined in + +[genai/llm.ts:186](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L186) + +___ + +### end + +▸ **end**(`opts?`): `void` + +Flush accumulated state to the span and close it. Idempotent. Pass +`error` to mark the span as failed. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts?` | `Object` | +| `opts.error?` | `Error` | + +#### Returns + +`void` + +#### Defined in + +[genai/llm.ts:246](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L246) + +___ + +### output + +▸ **output**(`content`): `this` + +Append an assistant message to the response. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `content` | `string` | + +#### Returns + +`this` + +#### Defined in + +[genai/llm.ts:141](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L141) + +___ + +### record + +▸ **record**(`opts`): `this` + +Bulk-set any subset of the mutable fields. Replaces (does not merge). +Useful for assigning everything at once after a provider call returns. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | `LLMRecordOpts` | + +#### Returns + +`this` + +#### Defined in + +[genai/llm.ts:197](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L197) + +___ + +### startSubagent + +▸ **startSubagent**(`opts`): [`SubAgent`](./subagent) + +Start a child SubAgent span nested under this LLM. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`SubAgentInit`](../interfaces/subagentinit) | + +#### Returns + +[`SubAgent`](./subagent) + +#### Defined in + +[genai/llm.ts:230](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L230) + +___ + +### startTool + +▸ **startTool**(`opts`): [`Tool`](./tool) + +Start a child Tool span nested under this LLM. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`ToolInit`](../interfaces/toolinit) | + +#### Returns + +[`Tool`](./tool) + +#### Defined in + +[genai/llm.ts:221](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L221) + +___ + +### think + +▸ **think**(`content`): `this` + +Set or extend the model's reasoning/chain-of-thought content. Accumulates + into `this.reasoning.content`. Folded into the last assistant message as + a `ReasoningPart` at serialization time, matching the Python SDK's + on-the-wire shape. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `content` | `string` | + +#### Returns + +`this` + +#### Defined in + +[genai/llm.ts:153](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L153) + +___ + +### create + +▸ **create**(`opts`): [`LLM`](./llm) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`LLMInit`](../interfaces/llminit) & `ChildSpanContext` | + +#### Returns + +[`LLM`](./llm) + +#### Defined in + +[genai/llm.ts:102](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L102) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/messagesprompt.mdx b/weave/reference/typescript-sdk/classes/messagesprompt.mdx index 5a71477b77..bc53e8953f 100644 --- a/weave/reference/typescript-sdk/classes/messagesprompt.mdx +++ b/weave/reference/typescript-sdk/classes/messagesprompt.mdx @@ -57,7 +57,7 @@ Prompt.constructor #### Defined in -[prompt.ts:40](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L40) +[prompt.ts:40](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L40) ## Properties @@ -71,7 +71,7 @@ Prompt.\_\_savedRef #### Defined in -[weaveObject.ts:73](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L73) +[weaveObject.ts:73](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L73) ___ @@ -81,7 +81,7 @@ ___ #### Defined in -[prompt.ts:38](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L38) +[prompt.ts:38](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L38) ## Accessors @@ -99,7 +99,7 @@ Prompt.description #### Defined in -[weaveObject.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L100) +[weaveObject.ts:100](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L100) ___ @@ -117,7 +117,7 @@ Prompt.name #### Defined in -[weaveObject.ts:96](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L96) +[weaveObject.ts:96](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L96) ## Methods @@ -137,7 +137,7 @@ Prompt.name #### Defined in -[prompt.ts:67](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L67) +[prompt.ts:67](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L67) ___ @@ -155,7 +155,7 @@ Prompt.saveAttrs #### Defined in -[weaveObject.ts:77](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L77) +[weaveObject.ts:77](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L77) ___ @@ -176,4 +176,4 @@ ___ #### Defined in -[prompt.ts:73](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L73) \ No newline at end of file +[prompt.ts:73](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L73) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/objectref.mdx b/weave/reference/typescript-sdk/classes/objectref.mdx index 27c3e5e8e0..51cdaa6cd3 100644 --- a/weave/reference/typescript-sdk/classes/objectref.mdx +++ b/weave/reference/typescript-sdk/classes/objectref.mdx @@ -60,7 +60,7 @@ const uri = ref.uri(); // weave:///my-project/object/abc123:def456 #### Defined in -[weaveObject.ts:26](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L26) +[weaveObject.ts:26](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L26) ## Properties @@ -70,7 +70,7 @@ const uri = ref.uri(); // weave:///my-project/object/abc123:def456 #### Defined in -[weaveObject.ts:29](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L29) +[weaveObject.ts:29](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L29) ___ @@ -80,7 +80,7 @@ ___ #### Defined in -[weaveObject.ts:28](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L28) +[weaveObject.ts:28](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L28) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[weaveObject.ts:27](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L27) +[weaveObject.ts:27](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L27) ## Methods @@ -104,7 +104,7 @@ ___ #### Defined in -[weaveObject.ts:66](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L66) +[weaveObject.ts:66](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L66) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[weaveObject.ts:61](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L61) +[weaveObject.ts:61](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L61) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[weaveObject.ts:57](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L57) +[weaveObject.ts:57](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L57) ___ @@ -166,4 +166,4 @@ const ref = ObjectRef.fromUri('weave:///my-entity/my-project/object/my-dataset:a #### Defined in -[weaveObject.ts:44](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L44) \ No newline at end of file +[weaveObject.ts:44](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L44) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/scorelogger.mdx b/weave/reference/typescript-sdk/classes/scorelogger.mdx index f25b623b66..5b4ee979cc 100644 --- a/weave/reference/typescript-sdk/classes/scorelogger.mdx +++ b/weave/reference/typescript-sdk/classes/scorelogger.mdx @@ -52,7 +52,7 @@ await pred.finish(); // Finalizes the prediction #### Defined in -[evaluationLogger.ts:319](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L319) +[evaluationLogger.ts:335](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L335) ## Accessors @@ -69,7 +69,7 @@ Used by EvaluationLogger to detect unfinished predictions. #### Defined in -[evaluationLogger.ts:349](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L349) +[evaluationLogger.ts:365](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L365) ## Methods @@ -87,7 +87,7 @@ Updates incremental aggregates and frees memory. #### Defined in -[evaluationLogger.ts:451](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L451) +[evaluationLogger.ts:467](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L467) ___ @@ -111,4 +111,4 @@ Creates a scorer call as a child of predict_and_score. #### Defined in -[evaluationLogger.ts:360](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/evaluationLogger.ts#L360) \ No newline at end of file +[evaluationLogger.ts:376](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/evaluationLogger.ts#L376) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/session.mdx b/weave/reference/typescript-sdk/classes/session.mdx new file mode 100644 index 0000000000..b4163edbc7 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/session.mdx @@ -0,0 +1,109 @@ +--- +title: "Class: Session" +description: "TypeScript SDK reference" +--- + +[weave](../) / Session + + + +A Session groups Turns under a single `gen_ai.conversation.id`. It is not +itself an OTel span — children stamp the conversation id onto theirs. + +## Table of contents + +### Properties + +- [agentName](./session#agentname) +- [model](./session#model) +- [sessionId](./session#sessionid) + +### Methods + +- [end](./session#end) +- [startTurn](./session#startturn) +- [create](./session#create) + +## Properties + +### agentName + +• `Readonly` **agentName**: `string` + +#### Defined in + +[genai/session.ts:22](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L22) + +___ + +### model + +• `Readonly` **model**: `string` + +#### Defined in + +[genai/session.ts:23](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L23) + +___ + +### sessionId + +• `Readonly` **sessionId**: `string` + +#### Defined in + +[genai/session.ts:24](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L24) + +## Methods + +### end + +▸ **end**(): `void` + +#### Returns + +`void` + +#### Defined in + +[genai/session.ts:51](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L51) + +___ + +### startTurn + +▸ **startTurn**(`opts?`): [`Turn`](./turn) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`TurnInit`](../interfaces/turninit) | + +#### Returns + +[`Turn`](./turn) + +#### Defined in + +[genai/session.ts:43](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L43) + +___ + +### create + +▸ **create**(`opts?`): [`Session`](./session) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`SessionInit`](../interfaces/sessioninit) | + +#### Returns + +[`Session`](./session) + +#### Defined in + +[genai/session.ts:27](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L27) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/stringprompt.mdx b/weave/reference/typescript-sdk/classes/stringprompt.mdx index 08ab9515f2..d84a9ebb77 100644 --- a/weave/reference/typescript-sdk/classes/stringprompt.mdx +++ b/weave/reference/typescript-sdk/classes/stringprompt.mdx @@ -57,7 +57,7 @@ Prompt.constructor #### Defined in -[prompt.ts:17](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L17) +[prompt.ts:17](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L17) ## Properties @@ -71,7 +71,7 @@ Prompt.\_\_savedRef #### Defined in -[weaveObject.ts:73](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L73) +[weaveObject.ts:73](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L73) ___ @@ -81,7 +81,7 @@ ___ #### Defined in -[prompt.ts:15](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L15) +[prompt.ts:15](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L15) ## Accessors @@ -99,7 +99,7 @@ Prompt.description #### Defined in -[weaveObject.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L100) +[weaveObject.ts:100](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L100) ___ @@ -117,7 +117,7 @@ Prompt.name #### Defined in -[weaveObject.ts:96](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L96) +[weaveObject.ts:96](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L96) ## Methods @@ -137,7 +137,7 @@ Prompt.name #### Defined in -[prompt.ts:22](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L22) +[prompt.ts:22](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L22) ___ @@ -155,7 +155,7 @@ Prompt.saveAttrs #### Defined in -[weaveObject.ts:77](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L77) +[weaveObject.ts:77](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L77) ___ @@ -176,4 +176,4 @@ ___ #### Defined in -[prompt.ts:26](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/prompt.ts#L26) \ No newline at end of file +[prompt.ts:26](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/prompt.ts#L26) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/subagent.mdx b/weave/reference/typescript-sdk/classes/subagent.mdx new file mode 100644 index 0000000000..af8cb0d6d6 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/subagent.mdx @@ -0,0 +1,102 @@ +--- +title: "Class: SubAgent" +description: "TypeScript SDK reference" +--- + +[weave](../) / SubAgent + + + +A nested agent invocation — used when the current agent hands work to +another named agent (e.g. a planner calling a researcher). Emits an +`invoke_agent` span tagged with the sub-agent's name and (optionally) +its model. + +Created by `weave.startSubagent()` (or `turn.startAgent()`, or +`llm.startAgent()`) and terminated with `end()`. + +`Example` + +```ts +const sub = weave.startSubagent({name: 'researcher', model: 'gpt-4o'}); +try { + // ... orchestrate the sub-agent's LLM/Tool calls ... +} finally { + sub.end(); +} +``` + +## Table of contents + +### Properties + +- [model](./subagent#model) +- [name](./subagent#name) + +### Methods + +- [end](./subagent#end) +- [create](./subagent#create) + +## Properties + +### model + +• `Readonly` **model**: `string` + +#### Defined in + +[genai/subagent.ts:41](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/subagent.ts#L41) + +___ + +### name + +• `Readonly` **name**: `string` + +#### Defined in + +[genai/subagent.ts:40](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/subagent.ts#L40) + +## Methods + +### end + +▸ **end**(`opts?`): `void` + +Close the SubAgent span. Idempotent. Pass `error` to mark it as failed. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts?` | `Object` | +| `opts.error?` | `Error` | + +#### Returns + +`void` + +#### Defined in + +[genai/subagent.ts:65](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/subagent.ts#L65) + +___ + +### create + +▸ **create**(`opts`): [`SubAgent`](./subagent) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`SubAgentInit`](../interfaces/subagentinit) & `ChildSpanContext` | + +#### Returns + +[`SubAgent`](./subagent) + +#### Defined in + +[genai/subagent.ts:44](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/subagent.ts#L44) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/tool.mdx b/weave/reference/typescript-sdk/classes/tool.mdx new file mode 100644 index 0000000000..1524aa4ad6 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/tool.mdx @@ -0,0 +1,130 @@ +--- +title: "Class: Tool" +description: "TypeScript SDK reference" +--- + +[weave](../) / Tool + + + +A tool invocation. Emits an `execute_tool` span carrying the tool name, +the JSON-encoded arguments, the tool-call id, and the result. + +Created by `weave.startTool()` (or `turn.startTool()`, or +`llm.startTool()`) and terminated with `end()`. Assign `result` before +calling `end()` to record the tool's output on the span. + +`Example` + +```ts +const tool = weave.startTool({ + name: tc.function.name, + args: tc.function.arguments, + toolCallId: tc.id, +}); +try { + tool.result = await wikipediaSearch(JSON.parse(tc.function.arguments)); +} finally { + tool.end(); +} +``` + +## Table of contents + +### Properties + +- [args](./tool#args) +- [name](./tool#name) +- [result](./tool#result) +- [toolCallId](./tool#toolcallid) + +### Methods + +- [end](./tool#end) +- [create](./tool#create) + +## Properties + +### args + +• `Readonly` **args**: `string` + +#### Defined in + +[genai/tool.ts:52](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L52) + +___ + +### name + +• `Readonly` **name**: `string` + +#### Defined in + +[genai/tool.ts:51](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L51) + +___ + +### result + +• `Optional` **result**: `string` + +Tool output as a string. Recorded on `gen_ai.tool.call.result` at `end()`. + +#### Defined in + +[genai/tool.ts:45](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L45) + +___ + +### toolCallId + +• `Readonly` **toolCallId**: `string` + +#### Defined in + +[genai/tool.ts:53](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L53) + +## Methods + +### end + +▸ **end**(`opts?`): `void` + +Flush `result` to the span and close it. Idempotent. Pass `error` to +mark the span as failed. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts?` | `Object` | +| `opts.error?` | `Error` | + +#### Returns + +`void` + +#### Defined in + +[genai/tool.ts:83](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L83) + +___ + +### create + +▸ **create**(`opts`): [`Tool`](./tool) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`ToolInit`](../interfaces/toolinit) & `ChildSpanContext` | + +#### Returns + +[`Tool`](./tool) + +#### Defined in + +[genai/tool.ts:56](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L56) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/turn.mdx b/weave/reference/typescript-sdk/classes/turn.mdx new file mode 100644 index 0000000000..3f20b80271 --- /dev/null +++ b/weave/reference/typescript-sdk/classes/turn.mdx @@ -0,0 +1,176 @@ +--- +title: "Class: Turn" +description: "TypeScript SDK reference" +--- + +[weave](../) / Turn + + + +An agent invocation. Typically wraps the work to respond to a single +user message. Emits an `invoke_agent` span and acts as the root of the +trace for that turn: it is always started under `ROOT_CONTEXT` so it +never accidentally inherits a parent from another OTel-instrumented +library. + +Created by `weave.startTurn()` (or `session.startTurn()`) and +terminated with `end()`. Only one Turn may be active in an async chain. +Children (LLM, Tool, SubAgent) attach via the `startLLM`, `startTool`, +`startSubagent` methods. + +`Example` + +```ts +const turn = weave.startTurn({agentName: 'research-bot', model: MODEL}); +try { + const llm = turn.startLLM({model: MODEL, providerName: 'openai'}); + // ... + llm.end(); +} finally { + turn.end(); +} +``` + +## Table of contents + +### Properties + +- [agentName](./turn#agentname) +- [model](./turn#model) + +### Methods + +- [end](./turn#end) +- [startLLM](./turn#startllm) +- [startSubagent](./turn#startsubagent) +- [startTool](./turn#starttool) +- [create](./turn#create) + +## Properties + +### agentName + +• `Readonly` **agentName**: `string` + +#### Defined in + +[genai/turn.ts:57](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L57) + +___ + +### model + +• `Readonly` **model**: `string` + +#### Defined in + +[genai/turn.ts:58](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L58) + +## Methods + +### end + +▸ **end**(`opts?`): `void` + +Close the Turn span. Idempotent. Pass `error` to mark it as failed. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts?` | `Object` | +| `opts.error?` | `Error` | + +#### Returns + +`void` + +#### Defined in + +[genai/turn.ts:128](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L128) + +___ + +### startLLM + +▸ **startLLM**(`opts`): [`LLM`](./llm) + +Start a child LLM span under this Turn. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`LLMInit`](../interfaces/llminit) | + +#### Returns + +[`LLM`](./llm) + +#### Defined in + +[genai/turn.ts:101](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L101) + +___ + +### startSubagent + +▸ **startSubagent**(`opts`): [`SubAgent`](./subagent) + +Start a child SubAgent span under this Turn. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`SubAgentInit`](../interfaces/subagentinit) | + +#### Returns + +[`SubAgent`](./subagent) + +#### Defined in + +[genai/turn.ts:119](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L119) + +___ + +### startTool + +▸ **startTool**(`opts`): [`Tool`](./tool) + +Start a child Tool span under this Turn. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`ToolInit`](../interfaces/toolinit) | + +#### Returns + +[`Tool`](./tool) + +#### Defined in + +[genai/turn.ts:110](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L110) + +___ + +### create + +▸ **create**(`opts?`): [`Turn`](./turn) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`TurnInit`](../interfaces/turninit) & \{ `conversationId?`: `string` } | + +#### Returns + +[`Turn`](./turn) + +#### Defined in + +[genai/turn.ts:61](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L61) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/weaveclient.mdx b/weave/reference/typescript-sdk/classes/weaveclient.mdx index f4ba9ad90a..31f6734dd0 100644 --- a/weave/reference/typescript-sdk/classes/weaveclient.mdx +++ b/weave/reference/typescript-sdk/classes/weaveclient.mdx @@ -31,6 +31,7 @@ description: "TypeScript SDK reference" - [getCalls](./weaveclient#getcalls) - [getCallsIterator](./weaveclient#getcallsiterator) - [getCurrentAttributes](./weaveclient#getcurrentattributes) +- [linkPromptToRegistry](./weaveclient#linkprompttoregistry) - [publish](./weaveclient#publish) - [pushNewCall](./weaveclient#pushnewcall) - [runWithAttributes](./weaveclient#runwithattributes) @@ -63,7 +64,7 @@ description: "TypeScript SDK reference" #### Defined in -[weaveClient.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L100) +[weaveClient.ts:190](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L190) ## Properties @@ -73,7 +74,7 @@ description: "TypeScript SDK reference" #### Defined in -[weaveClient.ts:103](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L103) +[weaveClient.ts:193](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L193) ___ @@ -83,7 +84,7 @@ ___ #### Defined in -[weaveClient.ts:104](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L104) +[weaveClient.ts:194](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L194) ___ @@ -93,7 +94,7 @@ ___ #### Defined in -[weaveClient.ts:101](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L101) +[weaveClient.ts:191](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L191) ## Methods @@ -119,7 +120,7 @@ Used in imperative evaluation to attach scorer results to predict calls. #### Defined in -[weaveClient.ts:908](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L908) +[weaveClient.ts:1128](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L1128) ___ @@ -148,7 +149,7 @@ ___ #### Defined in -[weaveClient.ts:763](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L763) +[weaveClient.ts:975](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L975) ___ @@ -174,7 +175,7 @@ ___ #### Defined in -[weaveClient.ts:815](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L815) +[weaveClient.ts:1035](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L1035) ___ @@ -199,7 +200,7 @@ ___ #### Defined in -[weaveClient.ts:855](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L855) +[weaveClient.ts:1075](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L1075) ___ @@ -219,7 +220,7 @@ ___ #### Defined in -[weaveClient.ts:289](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L289) +[weaveClient.ts:435](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L435) ___ @@ -240,7 +241,7 @@ ___ #### Defined in -[weaveClient.ts:220](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L220) +[weaveClient.ts:312](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L312) ___ @@ -254,21 +255,19 @@ ___ #### Defined in -[weaveClient.ts:674](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L674) +[weaveClient.ts:886](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L886) ___ ### getCalls -▸ **getCalls**(`filter?`, `includeCosts?`, `limit?`): `Promise`\<`Call`[]\> +▸ **getCalls**(`options?`): `Promise`\<`Call`[]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `filter` | [`CallsFilter`](../interfaces/callsfilter) | `{}` | -| `includeCosts` | `boolean` | `false` | -| `limit` | `number` | `1000` | +| Name | Type | +| :------ | :------ | +| `options?` | [`GetCallsOptions`](../interfaces/getcallsoptions) | #### Returns @@ -276,21 +275,55 @@ ___ #### Defined in -[weaveClient.ts:230](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L230) +[weaveClient.ts:345](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L345) + +▸ **getCalls**(`options?`, `includeCosts?`, `limit?`): `Promise`\<`Call`[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | [`CallsFilter`](../interfaces/callsfilter) | +| `includeCosts?` | `boolean` | +| `limit?` | `number` | + +#### Returns + +`Promise`\<`Call`[]\> + +#### Defined in + +[weaveClient.ts:346](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L346) ___ ### getCallsIterator -▸ **getCallsIterator**(`filter?`, `includeCosts?`, `limit?`): `AsyncIterableIterator`\<[`CallSchema`](../interfaces/callschema)\> +▸ **getCallsIterator**(`options?`, `includeCosts?`, `limit?`): `AsyncIterableIterator`\<[`CallSchema`](../interfaces/callschema)\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `filter` | [`CallsFilter`](../interfaces/callsfilter) | `{}` | -| `includeCosts` | `boolean` | `false` | -| `limit` | `number` | `1000` | +| Name | Type | +| :------ | :------ | +| `options?` | [`CallsFilter`](../interfaces/callsfilter) | +| `includeCosts?` | `boolean` | +| `limit?` | `number` | + +#### Returns + +`AsyncIterableIterator`\<[`CallSchema`](../interfaces/callschema)\> + +#### Defined in + +[weaveClient.ts:367](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L367) + +▸ **getCallsIterator**(`options?`): `AsyncIterableIterator`\<[`CallSchema`](../interfaces/callschema)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | [`GetCallsOptions`](../interfaces/getcallsoptions) | #### Returns @@ -298,7 +331,7 @@ ___ #### Defined in -[weaveClient.ts:244](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L244) +[weaveClient.ts:372](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L372) ___ @@ -312,7 +345,30 @@ ___ #### Defined in -[weaveClient.ts:678](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L678) +[weaveClient.ts:890](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L890) + +___ + +### linkPromptToRegistry + +▸ **linkPromptToRegistry**(`prompt`, `options`): `Promise`\<`LinkAssetToRegistryRes`\> + +Link a published prompt version into a registry portfolio. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `prompt` | `RegistryLinkable` | +| `options` | `LinkPromptToRegistryOptions` | + +#### Returns + +`Promise`\<`LinkAssetToRegistryRes`\> + +#### Defined in + +[weaveClient.ts:591](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L591) ___ @@ -333,7 +389,7 @@ ___ #### Defined in -[weaveClient.ts:208](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L208) +[weaveClient.ts:300](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L300) ___ @@ -353,7 +409,7 @@ ___ #### Defined in -[weaveClient.ts:682](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L682) +[weaveClient.ts:894](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L894) ___ @@ -380,7 +436,7 @@ ___ #### Defined in -[weaveClient.ts:690](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L690) +[weaveClient.ts:902](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L902) ___ @@ -407,7 +463,7 @@ ___ #### Defined in -[weaveClient.ts:686](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L686) +[weaveClient.ts:898](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L898) ___ @@ -427,7 +483,7 @@ ___ #### Defined in -[weaveClient.ts:669](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L669) +[weaveClient.ts:881](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L881) ___ @@ -447,13 +503,13 @@ ___ #### Defined in -[weaveClient.ts:664](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L664) +[weaveClient.ts:876](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L876) ___ ### saveOp -▸ **saveOp**(`op`, `objId?`): `Promise`\<`any`\> +▸ **saveOp**(`op`, `objId?`): `Promise`\<`OpRef`\> #### Parameters @@ -464,17 +520,17 @@ ___ #### Returns -`Promise`\<`any`\> +`Promise`\<`OpRef`\> #### Defined in -[weaveClient.ts:729](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L729) +[weaveClient.ts:941](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L941) ___ ### serializeAudio -▸ **serializeAudio**(`data`, `audioType?`): `Promise`\<`any`\> +▸ **serializeAudio**(`data`, `audioType?`): `Promise`\<`SerializedFileBlob`\> Upload raw audio bytes to the Weave content store and return the `CustomWeaveType` placeholder that can be embedded in a call output. @@ -491,11 +547,11 @@ where the automatic serialization pipeline from `finishCall` is not used. #### Returns -`Promise`\<`any`\> +`Promise`\<`SerializedFileBlob`\> #### Defined in -[weaveClient.ts:616](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L616) +[weaveClient.ts:828](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L828) ___ @@ -516,7 +572,7 @@ ___ #### Defined in -[weaveClient.ts:891](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L891) +[weaveClient.ts:1111](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L1111) ___ @@ -530,4 +586,4 @@ ___ #### Defined in -[weaveClient.ts:121](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveClient.ts#L121) \ No newline at end of file +[weaveClient.ts:211](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L211) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/classes/weaveobject.mdx b/weave/reference/typescript-sdk/classes/weaveobject.mdx index b4af0bfb7c..dd810aa5d8 100644 --- a/weave/reference/typescript-sdk/classes/weaveobject.mdx +++ b/weave/reference/typescript-sdk/classes/weaveobject.mdx @@ -52,7 +52,7 @@ description: "TypeScript SDK reference" #### Defined in -[weaveObject.ts:75](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L75) +[weaveObject.ts:75](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L75) ## Properties @@ -62,7 +62,7 @@ description: "TypeScript SDK reference" #### Defined in -[weaveObject.ts:73](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L73) +[weaveObject.ts:73](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L73) ## Accessors @@ -76,7 +76,7 @@ description: "TypeScript SDK reference" #### Defined in -[weaveObject.ts:100](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L100) +[weaveObject.ts:100](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L100) ___ @@ -90,7 +90,7 @@ ___ #### Defined in -[weaveObject.ts:96](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L96) +[weaveObject.ts:96](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L96) ## Methods @@ -104,4 +104,4 @@ ___ #### Defined in -[weaveObject.ts:77](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/weaveObject.ts#L77) \ No newline at end of file +[weaveObject.ts:77](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveObject.ts#L77) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor.mdx b/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor.mdx index 629fa4be5c..462cee73ff 100644 --- a/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor.mdx +++ b/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor.mdx @@ -27,6 +27,6 @@ addTraceProcessor(processor); #### Defined in -[integrations/openai.agent.ts:612](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/integrations/openai.agent.ts#L612) +[integrations/openai.agent.ts:665](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/integrations/openai.agent.ts#L665) ___ diff --git a/weave/reference/typescript-sdk/functions/createotelextension.mdx b/weave/reference/typescript-sdk/functions/createotelextension.mdx new file mode 100644 index 0000000000..2c9b017f3d --- /dev/null +++ b/weave/reference/typescript-sdk/functions/createotelextension.mdx @@ -0,0 +1,51 @@ +--- +title: "createOtelExtension" +description: "TypeScript SDK reference" +--- + +# createOtelExtension + +▸ **createOtelExtension**(`opts?`): (`pi`: `PiExtensionApi`) => `void` + +Creates a pi coding agent extension that emits OTEL spans for the full +agent lifecycle, conforming to the GenAI semantic conventions. + +When `weave.init(...)` has been called, spans are automatically exported +to the Weave trace server at `/agents/otel/v1/traces`. Otherwise, pass a +custom `tracer` in `opts`. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | `OtelExtensionOptions` | + +#### Returns + +`fn` + +▸ (`pi`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `pi` | `PiExtensionApi` | + +##### Returns + +`void` + +`Example` + +```typescript +const resourceLoader = new DefaultResourceLoader({ + extensionFactories: [createOtelExtension()], +}); +``` + +#### Defined in + +[integrations/piCodingAgent.ts:629](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/integrations/piCodingAgent.ts#L629) + +___ diff --git a/weave/reference/typescript-sdk/functions/endllm.mdx b/weave/reference/typescript-sdk/functions/endllm.mdx new file mode 100644 index 0000000000..0fd2d8b850 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/endllm.mdx @@ -0,0 +1,20 @@ +--- +title: "endLLM" +description: "TypeScript SDK reference" +--- + +# endLLM + +▸ **endLLM**(): `void` + +End the current LLM. No-op if no LLM is active. + +#### Returns + +`void` + +#### Defined in + +[genai/api.ts:102](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L102) + +___ diff --git a/weave/reference/typescript-sdk/functions/endsession.mdx b/weave/reference/typescript-sdk/functions/endsession.mdx new file mode 100644 index 0000000000..329fe2f094 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/endsession.mdx @@ -0,0 +1,20 @@ +--- +title: "endSession" +description: "TypeScript SDK reference" +--- + +# endSession + +▸ **endSession**(): `void` + +End the current Session. No-op if no Session is active. + +#### Returns + +`void` + +#### Defined in + +[genai/api.ts:82](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L82) + +___ diff --git a/weave/reference/typescript-sdk/functions/endturn.mdx b/weave/reference/typescript-sdk/functions/endturn.mdx new file mode 100644 index 0000000000..93337d7fb6 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/endturn.mdx @@ -0,0 +1,20 @@ +--- +title: "endTurn" +description: "TypeScript SDK reference" +--- + +# endTurn + +▸ **endTurn**(): `void` + +End the current Turn. No-op if no Turn is active. + +#### Returns + +`void` + +#### Defined in + +[genai/api.ts:92](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L92) + +___ diff --git a/weave/reference/typescript-sdk/functions/flushotel.mdx b/weave/reference/typescript-sdk/functions/flushotel.mdx new file mode 100644 index 0000000000..be2fa504cb --- /dev/null +++ b/weave/reference/typescript-sdk/functions/flushotel.mdx @@ -0,0 +1,29 @@ +--- +title: "flushOTel" +description: "TypeScript SDK reference" +--- + +# flushOTel + +▸ **flushOTel**(): `Promise`\<`void`\> + +Force-flush any GenAI spans buffered by the active span processor. + +Resolves immediately if `weave.init()` has not been called. Otherwise +delegates to `BasicTracerProvider.forceFlush()`, which waits for the +underlying span processor to drain its queue and complete its OTLP export +round-trip. + +Call before process exit when using `'simple'` or any other processor that +may have in-flight work, or in tests that need to observe exported spans +synchronously. + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[genai/flush.ts:15](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/flush.ts#L15) + +___ diff --git a/weave/reference/typescript-sdk/functions/getcurrentllm.mdx b/weave/reference/typescript-sdk/functions/getcurrentllm.mdx new file mode 100644 index 0000000000..1031469a4c --- /dev/null +++ b/weave/reference/typescript-sdk/functions/getcurrentllm.mdx @@ -0,0 +1,20 @@ +--- +title: "getCurrentLLM" +description: "TypeScript SDK reference" +--- + +# getCurrentLLM + +▸ **getCurrentLLM**(): [`LLM`](../classes/llm) \| `undefined` + +Returns the current LLM, or undefined. + +#### Returns + +[`LLM`](../classes/llm) \| `undefined` + +#### Defined in + +[genai/context.ts:103](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/context.ts#L103) + +___ diff --git a/weave/reference/typescript-sdk/functions/getcurrentsession.mdx b/weave/reference/typescript-sdk/functions/getcurrentsession.mdx new file mode 100644 index 0000000000..4f8cde2269 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/getcurrentsession.mdx @@ -0,0 +1,20 @@ +--- +title: "getCurrentSession" +description: "TypeScript SDK reference" +--- + +# getCurrentSession + +▸ **getCurrentSession**(): [`Session`](../classes/session) \| `undefined` + +Returns the current Session, or undefined. + +#### Returns + +[`Session`](../classes/session) \| `undefined` + +#### Defined in + +[genai/context.ts:93](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/context.ts#L93) + +___ diff --git a/weave/reference/typescript-sdk/functions/getcurrentturn.mdx b/weave/reference/typescript-sdk/functions/getcurrentturn.mdx new file mode 100644 index 0000000000..ad7180424f --- /dev/null +++ b/weave/reference/typescript-sdk/functions/getcurrentturn.mdx @@ -0,0 +1,20 @@ +--- +title: "getCurrentTurn" +description: "TypeScript SDK reference" +--- + +# getCurrentTurn + +▸ **getCurrentTurn**(): [`Turn`](../classes/turn) \| `undefined` + +Returns the current Turn, or undefined. + +#### Returns + +[`Turn`](../classes/turn) \| `undefined` + +#### Defined in + +[genai/context.ts:98](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/context.ts#L98) + +___ diff --git a/weave/reference/typescript-sdk/functions/init.mdx b/weave/reference/typescript-sdk/functions/init.mdx index 473ef29dc6..5eb0fa50fd 100644 --- a/weave/reference/typescript-sdk/functions/init.mdx +++ b/weave/reference/typescript-sdk/functions/init.mdx @@ -13,7 +13,7 @@ Initialize the Weave client, which is required for weave tracing to work. | Name | Type | Description | | :------ | :------ | :------ | -| `project` | `string` | The W&B project name (can be project or entity/project). If you don't specify a W&B team (e.g., 'team/project'), your default entity is used. To find or update your default entity, refer to User Settings at https://docs.wandb.ai/guides/models/app/settings-page/user-settings/#default-team | +| `project` | `string` | The W&B project name (can be project or entity/project). If you don't specify a W&B team (e.g., 'team/project'), your default entity is used. To find or update your default entity, refer to User Settings at https://docs.wandb.ai/platform/app/settings-page/user-settings#default-team | | `settings?` | `SettingsInit` | (Optional) Weave tracing settings | #### Returns @@ -28,6 +28,6 @@ If the initialization fails #### Defined in -[clientApi.ts:83](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/clientApi.ts#L83) +[clientApi.ts:90](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/clientApi.ts#L90) ___ diff --git a/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx b/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx index 0e976ccdbe..c74e1f42e6 100644 --- a/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx +++ b/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx @@ -22,7 +22,7 @@ throwing an error. `Promise`\<`boolean`\> -Promise\<`boolean`\> - true if registration succeeded, false if @openai/agents not available +Promise - true if registration succeeded, false if @openai/agents not available `Example` @@ -73,6 +73,6 @@ addTraceProcessor(processor); #### Defined in -[integrations/openai.agent.ts:674](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/integrations/openai.agent.ts#L674) +[integrations/openai.agent.ts:727](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/integrations/openai.agent.ts#L727) ___ diff --git a/weave/reference/typescript-sdk/functions/login.mdx b/weave/reference/typescript-sdk/functions/login.mdx index 1f4a825313..924d5c1ddd 100644 --- a/weave/reference/typescript-sdk/functions/login.mdx +++ b/weave/reference/typescript-sdk/functions/login.mdx @@ -28,6 +28,6 @@ If the API key is not specified or if the connection to the weave trace server c #### Defined in -[clientApi.ts:23](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/clientApi.ts#L23) +[clientApi.ts:30](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/clientApi.ts#L30) ___ diff --git a/weave/reference/typescript-sdk/functions/op.mdx b/weave/reference/typescript-sdk/functions/op.mdx index 0681c70a13..733b14fafd 100644 --- a/weave/reference/typescript-sdk/functions/op.mdx +++ b/weave/reference/typescript-sdk/functions/op.mdx @@ -26,7 +26,7 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:381](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/op.ts#L381) +[op.ts:381](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/op.ts#L381) ▸ **op**\<`T`\>(`thisArg`, `fn`, `options?`): [`Op`](../type-aliases/op)\<`T`\> @@ -50,7 +50,7 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:386](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/op.ts#L386) +[op.ts:386](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/op.ts#L386) ▸ **op**(`target`, `propertyKey`, `descriptor`): `TypedPropertyDescriptor`\<`any`\> @@ -68,7 +68,7 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:392](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/op.ts#L392) +[op.ts:392](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/op.ts#L392) ▸ **op**\<`T`\>(`value`, `context`): [`Op`](../type-aliases/op)\<`T`\> @@ -91,7 +91,7 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:398](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/op.ts#L398) +[op.ts:398](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/op.ts#L398) ▸ **op**(`options`): `MethodDecorator` @@ -107,6 +107,6 @@ description: "TypeScript SDK reference" #### Defined in -[op.ts:403](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/op.ts#L403) +[op.ts:403](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/op.ts#L403) ___ diff --git a/weave/reference/typescript-sdk/functions/patchrealtimesession.mdx b/weave/reference/typescript-sdk/functions/patchrealtimesession.mdx index 136cc414f0..1c886472ff 100644 --- a/weave/reference/typescript-sdk/functions/patchrealtimesession.mdx +++ b/weave/reference/typescript-sdk/functions/patchrealtimesession.mdx @@ -5,7 +5,7 @@ description: "TypeScript SDK reference" # patchRealtimeSession -▸ **patchRealtimeSession**(): `void` +▸ **patchRealtimeSession**(): `Promise`\<`boolean`\> Manually patch the `RealtimeSession` class from `@openai/agents-realtime` so that every new instance is automatically traced by Weave. @@ -20,18 +20,21 @@ The function is idempotent — safe to call multiple times. #### Returns -`void` +`Promise`\<`boolean`\> + +`true` if the patch was applied (or was already in place), `false` if +`@openai/agents-realtime` could not be loaded. `Example` ```typescript import { patchRealtimeSession } from 'weave'; -patchRealtimeSession(); +await patchRealtimeSession(); // Every new RealtimeSession(...) is now auto-instrumented ``` #### Defined in -[integrations/openai.realtime.agent.ts:797](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/integrations/openai.realtime.agent.ts#L797) +[integrations/openai.realtime.agent.ts:808](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/integrations/openai.realtime.agent.ts#L808) ___ diff --git a/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx b/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx index 98d598e0a4..da6d6c43fe 100644 --- a/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx +++ b/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry.mdx @@ -13,6 +13,6 @@ description: "TypeScript SDK reference" #### Defined in -[clientApi.ts:147](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/clientApi.ts#L147) +[clientApi.ts:155](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/clientApi.ts#L155) ___ diff --git a/weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx b/weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx index 7405e76972..e8ca43922b 100644 --- a/weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx +++ b/weave/reference/typescript-sdk/functions/requirecurrentchildsummary.mdx @@ -13,6 +13,6 @@ description: "TypeScript SDK reference" #### Defined in -[clientApi.ts:159](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/clientApi.ts#L159) +[clientApi.ts:167](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/clientApi.ts#L167) ___ diff --git a/weave/reference/typescript-sdk/functions/runisolated.mdx b/weave/reference/typescript-sdk/functions/runisolated.mdx new file mode 100644 index 0000000000..86b6f44923 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/runisolated.mdx @@ -0,0 +1,45 @@ +--- +title: "runIsolated" +description: "TypeScript SDK reference" +--- + +# runIsolated + +▸ **runIsolated**\<`T`\>(`fn`): `T` + +Run `fn` in a fresh, isolated GenAI state frame. Any Session / Turn / LLM +started inside `fn` lives in this frame only — it does not clash with +sibling `runIsolated` frames running concurrently, and it does not leak +to the outer async chain. + +Use this to safely run parallel GenAI work: + + await Promise.all([ + weave.runIsolated(async () => { ... }), + weave.runIsolated(async () => { ... }), + ]); + +Sequential single-flight usage doesn't require this wrapper — the +process-wide default state handles it. + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fn` | () => `T` | + +#### Returns + +`T` + +#### Defined in + +[genai/context.ts:88](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/context.ts#L88) + +___ diff --git a/weave/reference/typescript-sdk/functions/startllm.mdx b/weave/reference/typescript-sdk/functions/startllm.mdx new file mode 100644 index 0000000000..88fa13190c --- /dev/null +++ b/weave/reference/typescript-sdk/functions/startllm.mdx @@ -0,0 +1,27 @@ +--- +title: "startLLM" +description: "TypeScript SDK reference" +--- + +# startLLM + +▸ **startLLM**(`opts`): [`LLM`](../classes/llm) + +Start an LLM span as a child of the current Turn. Throws if no Turn is +active. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`LLMInit`](../interfaces/llminit) | + +#### Returns + +[`LLM`](../classes/llm) + +#### Defined in + +[genai/api.ts:32](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L32) + +___ diff --git a/weave/reference/typescript-sdk/functions/startsession.mdx b/weave/reference/typescript-sdk/functions/startsession.mdx new file mode 100644 index 0000000000..823aa0675e --- /dev/null +++ b/weave/reference/typescript-sdk/functions/startsession.mdx @@ -0,0 +1,27 @@ +--- +title: "startSession" +description: "TypeScript SDK reference" +--- + +# startSession + +▸ **startSession**(`opts?`): [`Session`](../classes/session) + +Start a new Session and install it as the current session. +Subsequent calls to `startTurn` will pick it up automatically. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`SessionInit`](../interfaces/sessioninit) | + +#### Returns + +[`Session`](../classes/session) + +#### Defined in + +[genai/api.ts:12](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L12) + +___ diff --git a/weave/reference/typescript-sdk/functions/startsubagent.mdx b/weave/reference/typescript-sdk/functions/startsubagent.mdx new file mode 100644 index 0000000000..be962ce4da --- /dev/null +++ b/weave/reference/typescript-sdk/functions/startsubagent.mdx @@ -0,0 +1,26 @@ +--- +title: "startSubagent" +description: "TypeScript SDK reference" +--- + +# startSubagent + +▸ **startSubagent**(`opts`): [`SubAgent`](../classes/subagent) + +Start a SubAgent span. Same parent-resolution rules as `startTool`. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`SubAgentInit`](../interfaces/subagentinit) | + +#### Returns + +[`SubAgent`](../classes/subagent) + +#### Defined in + +[genai/api.ts:66](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L66) + +___ diff --git a/weave/reference/typescript-sdk/functions/starttool.mdx b/weave/reference/typescript-sdk/functions/starttool.mdx new file mode 100644 index 0000000000..6e2bed4418 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/starttool.mdx @@ -0,0 +1,31 @@ +--- +title: "startTool" +description: "TypeScript SDK reference" +--- + +# startTool + +▸ **startTool**(`opts`): [`Tool`](../classes/tool) + +Start a Tool span. Parent resolution (matches the design's "flat by +default, hierarchical if you nest"): +- If an LLM is active, the Tool nests under it. +- Otherwise, the Tool is a sibling under the current Turn. + +Throws if neither a Turn nor an LLM is active. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`ToolInit`](../interfaces/toolinit) | + +#### Returns + +[`Tool`](../classes/tool) + +#### Defined in + +[genai/api.ts:50](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L50) + +___ diff --git a/weave/reference/typescript-sdk/functions/startturn.mdx b/weave/reference/typescript-sdk/functions/startturn.mdx new file mode 100644 index 0000000000..f7b15a3608 --- /dev/null +++ b/weave/reference/typescript-sdk/functions/startturn.mdx @@ -0,0 +1,27 @@ +--- +title: "startTurn" +description: "TypeScript SDK reference" +--- + +# startTurn + +▸ **startTurn**(`opts?`): [`Turn`](../classes/turn) + +Start a new Turn. If a Session is active, the turn inherits its +`conversationId`; otherwise the turn has no conversation id. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`TurnInit`](../interfaces/turninit) | + +#### Returns + +[`Turn`](../classes/turn) + +#### Defined in + +[genai/api.ts:20](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/api.ts#L20) + +___ diff --git a/weave/reference/typescript-sdk/functions/weaveaudio.mdx b/weave/reference/typescript-sdk/functions/weaveaudio.mdx index 749c8d4331..8ddd5f3b79 100644 --- a/weave/reference/typescript-sdk/functions/weaveaudio.mdx +++ b/weave/reference/typescript-sdk/functions/weaveaudio.mdx @@ -28,6 +28,6 @@ const weaveAudio = weaveAudio({ data: audioBuffer }); #### Defined in -[media.ts:62](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L62) +[media.ts:62](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L62) ___ diff --git a/weave/reference/typescript-sdk/functions/weaveimage.mdx b/weave/reference/typescript-sdk/functions/weaveimage.mdx index e81a5c72a1..06231bc667 100644 --- a/weave/reference/typescript-sdk/functions/weaveimage.mdx +++ b/weave/reference/typescript-sdk/functions/weaveimage.mdx @@ -28,6 +28,6 @@ const weaveImage = weaveImage({ data: imageBuffer }); #### Defined in -[media.ts:28](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L28) +[media.ts:28](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L28) ___ diff --git a/weave/reference/typescript-sdk/functions/withattributes.mdx b/weave/reference/typescript-sdk/functions/withattributes.mdx index b4b6cb2a0c..39da730376 100644 --- a/weave/reference/typescript-sdk/functions/withattributes.mdx +++ b/weave/reference/typescript-sdk/functions/withattributes.mdx @@ -38,6 +38,6 @@ await withAttributes({requestId: 'abc'}, async () => { #### Defined in -[clientApi.ts:193](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/clientApi.ts#L193) +[clientApi.ts:201](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/clientApi.ts#L201) ___ diff --git a/weave/reference/typescript-sdk/functions/wrapgooglegenai.mdx b/weave/reference/typescript-sdk/functions/wrapgooglegenai.mdx index e0bd88e73c..c76238c6d3 100644 --- a/weave/reference/typescript-sdk/functions/wrapgooglegenai.mdx +++ b/weave/reference/typescript-sdk/functions/wrapgooglegenai.mdx @@ -25,6 +25,6 @@ description: "TypeScript SDK reference" #### Defined in -[integrations/googleGenAI.ts:223](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/integrations/googleGenAI.ts#L223) +[integrations/googleGenAI.ts:223](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/integrations/googleGenAI.ts#L223) ___ diff --git a/weave/reference/typescript-sdk/functions/wrapopenai.mdx b/weave/reference/typescript-sdk/functions/wrapopenai.mdx index 506a12296c..bead83da73 100644 --- a/weave/reference/typescript-sdk/functions/wrapopenai.mdx +++ b/weave/reference/typescript-sdk/functions/wrapopenai.mdx @@ -37,4 +37,4 @@ const result = await openai.chat.completions.create({ #### Defined in -[integrations/openai.ts:505](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/integrations/openai.ts#L505) \ No newline at end of file +[integrations/openai.ts:703](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/integrations/openai.ts#L703) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/callschema.mdx b/weave/reference/typescript-sdk/interfaces/callschema.mdx index 53387ef4a7..64f060a217 100644 --- a/weave/reference/typescript-sdk/interfaces/callschema.mdx +++ b/weave/reference/typescript-sdk/interfaces/callschema.mdx @@ -40,7 +40,7 @@ Attributes #### Defined in -[generated/traceServerApi.ts:118](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L118) +[generated/traceServerApi.ts:120](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L120) ___ @@ -52,7 +52,7 @@ Deleted At #### Defined in -[generated/traceServerApi.ts:133](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L133) +[generated/traceServerApi.ts:135](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L135) ___ @@ -64,7 +64,7 @@ Display Name #### Defined in -[generated/traceServerApi.ts:107](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L107) +[generated/traceServerApi.ts:109](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L109) ___ @@ -76,7 +76,7 @@ Ended At #### Defined in -[generated/traceServerApi.ts:122](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L122) +[generated/traceServerApi.ts:124](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L124) ___ @@ -88,7 +88,7 @@ Exception #### Defined in -[generated/traceServerApi.ts:124](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L124) +[generated/traceServerApi.ts:126](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L126) ___ @@ -100,7 +100,7 @@ Id #### Defined in -[generated/traceServerApi.ts:101](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L101) +[generated/traceServerApi.ts:103](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L103) ___ @@ -112,7 +112,7 @@ Inputs #### Defined in -[generated/traceServerApi.ts:120](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L120) +[generated/traceServerApi.ts:122](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L122) ___ @@ -124,7 +124,7 @@ Op Name #### Defined in -[generated/traceServerApi.ts:105](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L105) +[generated/traceServerApi.ts:107](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L107) ___ @@ -136,7 +136,7 @@ Output #### Defined in -[generated/traceServerApi.ts:126](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L126) +[generated/traceServerApi.ts:128](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L128) ___ @@ -148,7 +148,7 @@ Parent Id #### Defined in -[generated/traceServerApi.ts:111](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L111) +[generated/traceServerApi.ts:113](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L113) ___ @@ -160,7 +160,7 @@ Project Id #### Defined in -[generated/traceServerApi.ts:103](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L103) +[generated/traceServerApi.ts:105](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L105) ___ @@ -176,7 +176,7 @@ date-time #### Defined in -[generated/traceServerApi.ts:116](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L116) +[generated/traceServerApi.ts:118](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L118) ___ @@ -186,7 +186,7 @@ ___ #### Defined in -[generated/traceServerApi.ts:127](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L127) +[generated/traceServerApi.ts:129](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L129) ___ @@ -198,7 +198,7 @@ Trace Id #### Defined in -[generated/traceServerApi.ts:109](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L109) +[generated/traceServerApi.ts:111](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L111) ___ @@ -210,7 +210,7 @@ Wb Run Id #### Defined in -[generated/traceServerApi.ts:131](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L131) +[generated/traceServerApi.ts:133](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L133) ___ @@ -222,4 +222,4 @@ Wb User Id #### Defined in -[generated/traceServerApi.ts:129](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L129) \ No newline at end of file +[generated/traceServerApi.ts:131](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L131) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/callsfilter.mdx b/weave/reference/typescript-sdk/interfaces/callsfilter.mdx index e939523978..ad386d1a2e 100644 --- a/weave/reference/typescript-sdk/interfaces/callsfilter.mdx +++ b/weave/reference/typescript-sdk/interfaces/callsfilter.mdx @@ -33,7 +33,7 @@ Call Ids #### Defined in -[generated/traceServerApi.ts:196](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L196) +[generated/traceServerApi.ts:198](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L198) ___ @@ -45,7 +45,7 @@ Input Refs #### Defined in -[generated/traceServerApi.ts:188](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L188) +[generated/traceServerApi.ts:190](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L190) ___ @@ -57,7 +57,7 @@ Op Names #### Defined in -[generated/traceServerApi.ts:186](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L186) +[generated/traceServerApi.ts:188](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L188) ___ @@ -69,7 +69,7 @@ Output Refs #### Defined in -[generated/traceServerApi.ts:190](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L190) +[generated/traceServerApi.ts:192](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L192) ___ @@ -81,7 +81,7 @@ Parent Ids #### Defined in -[generated/traceServerApi.ts:192](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L192) +[generated/traceServerApi.ts:194](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L194) ___ @@ -93,7 +93,7 @@ Trace Ids #### Defined in -[generated/traceServerApi.ts:194](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L194) +[generated/traceServerApi.ts:196](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L196) ___ @@ -105,7 +105,7 @@ Trace Roots Only #### Defined in -[generated/traceServerApi.ts:198](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L198) +[generated/traceServerApi.ts:200](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L200) ___ @@ -117,7 +117,7 @@ Wb Run Ids #### Defined in -[generated/traceServerApi.ts:202](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L202) +[generated/traceServerApi.ts:204](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L204) ___ @@ -129,4 +129,4 @@ Wb User Ids #### Defined in -[generated/traceServerApi.ts:200](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/generated/traceServerApi.ts#L200) \ No newline at end of file +[generated/traceServerApi.ts:202](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L202) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/getcallsoptions.mdx b/weave/reference/typescript-sdk/interfaces/getcallsoptions.mdx new file mode 100644 index 0000000000..c7f94b2ee5 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/getcallsoptions.mdx @@ -0,0 +1,112 @@ +--- +title: "Interface: GetCallsOptions" +description: "TypeScript SDK reference" +--- + +[weave](../) / GetCallsOptions + + + +## Table of contents + +### Properties + +- [columns](./getcallsoptions#columns) +- [expandColumns](./getcallsoptions#expandcolumns) +- [filter](./getcallsoptions#filter) +- [includeCosts](./getcallsoptions#includecosts) +- [includeFeedback](./getcallsoptions#includefeedback) +- [limit](./getcallsoptions#limit) +- [offset](./getcallsoptions#offset) +- [query](./getcallsoptions#query) +- [sortBy](./getcallsoptions#sortby) + +## Properties + +### columns + +• `Optional` **columns**: `string`[] + +#### Defined in + +[weaveClient.ts:84](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L84) + +___ + +### expandColumns + +• `Optional` **expandColumns**: `string`[] + +#### Defined in + +[weaveClient.ts:85](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L85) + +___ + +### filter + +• `Optional` **filter**: [`CallsFilter`](./callsfilter) + +#### Defined in + +[weaveClient.ts:77](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L77) + +___ + +### includeCosts + +• `Optional` **includeCosts**: `boolean` + +#### Defined in + +[weaveClient.ts:79](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L79) + +___ + +### includeFeedback + +• `Optional` **includeFeedback**: `boolean` + +#### Defined in + +[weaveClient.ts:80](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L80) + +___ + +### limit + +• `Optional` **limit**: `number` + +#### Defined in + +[weaveClient.ts:81](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L81) + +___ + +### offset + +• `Optional` **offset**: `number` + +#### Defined in + +[weaveClient.ts:82](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L82) + +___ + +### query + +• `Optional` **query**: [`Query`](./query) + +#### Defined in + +[weaveClient.ts:78](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L78) + +___ + +### sortBy + +• `Optional` **sortBy**: [`SortBy`](./sortby)[] + +#### Defined in + +[weaveClient.ts:83](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/weaveClient.ts#L83) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/llminit.mdx b/weave/reference/typescript-sdk/interfaces/llminit.mdx new file mode 100644 index 0000000000..16c4e633bd --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/llminit.mdx @@ -0,0 +1,35 @@ +--- +title: "Interface: LLMInit" +description: "TypeScript SDK reference" +--- + +[weave](../) / LLMInit + + + +## Table of contents + +### Properties + +- [model](./llminit#model) +- [providerName](./llminit#providername) + +## Properties + +### model + +• **model**: `string` + +#### Defined in + +[genai/llm.ts:31](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L31) + +___ + +### providerName + +• `Optional` **providerName**: `string` + +#### Defined in + +[genai/llm.ts:32](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/llm.ts#L32) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/message.mdx b/weave/reference/typescript-sdk/interfaces/message.mdx new file mode 100644 index 0000000000..d1897f3451 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/message.mdx @@ -0,0 +1,68 @@ +--- +title: "Interface: Message" +description: "TypeScript SDK reference" +--- + +[weave](../) / Message + + + +## Table of contents + +### Properties + +- [content](./message#content) +- [parts](./message#parts) +- [role](./message#role) +- [toolCallId](./message#toolcallid) +- [toolName](./message#toolname) + +## Properties + +### content + +• `Optional` **content**: `string` + +#### Defined in + +[genai/types.ts:11](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L11) + +___ + +### parts + +• `Optional` **parts**: [`MessagePart`](../#messagepart)[] + +#### Defined in + +[genai/types.ts:14](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L14) + +___ + +### role + +• **role**: [`Role`](../#role) + +#### Defined in + +[genai/types.ts:10](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L10) + +___ + +### toolCallId + +• `Optional` **toolCallId**: `string` + +#### Defined in + +[genai/types.ts:12](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L12) + +___ + +### toolName + +• `Optional` **toolName**: `string` + +#### Defined in + +[genai/types.ts:13](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L13) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/query.mdx b/weave/reference/typescript-sdk/interfaces/query.mdx new file mode 100644 index 0000000000..ffa85307ce --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/query.mdx @@ -0,0 +1,28 @@ +--- +title: "Interface: Query" +description: "TypeScript SDK reference" +--- + +[weave](../) / Query + + + +Query + +## Table of contents + +### Properties + +- [$expr](./query#$expr) + +## Properties + +### $expr + +• **$expr**: `AndOperation` \| `OrOperation` \| `NotOperation` \| `EqOperation` \| `GtOperation` \| `GteOperation` \| `InOperation` \| `ContainsOperation` + +$Expr + +#### Defined in + +[generated/traceServerApi.ts:817](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L817) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/reasoning.mdx b/weave/reference/typescript-sdk/interfaces/reasoning.mdx new file mode 100644 index 0000000000..f8659766a5 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/reasoning.mdx @@ -0,0 +1,24 @@ +--- +title: "Interface: Reasoning" +description: "TypeScript SDK reference" +--- + +[weave](../) / Reasoning + + + +## Table of contents + +### Properties + +- [content](./reasoning#content) + +## Properties + +### content + +• **content**: `string` + +#### Defined in + +[genai/types.ts:40](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L40) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/sessioninit.mdx b/weave/reference/typescript-sdk/interfaces/sessioninit.mdx new file mode 100644 index 0000000000..fd61d78fa0 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/sessioninit.mdx @@ -0,0 +1,49 @@ +--- +title: "Interface: SessionInit" +description: "TypeScript SDK reference" +--- + +[weave](../) / SessionInit + + + +## Table of contents + +### Properties + +- [agentName](./sessioninit#agentname) +- [model](./sessioninit#model) +- [sessionId](./sessioninit#sessionid) + +## Properties + +### agentName + +• `Optional` **agentName**: `string` + +#### Defined in + +[genai/session.ts:7](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L7) + +___ + +### model + +• `Optional` **model**: `string` + +#### Defined in + +[genai/session.ts:8](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L8) + +___ + +### sessionId + +• `Optional` **sessionId**: `string` + +Conversation ID propagated to every span under this session as + `gen_ai.conversation.id`. Auto-generated if omitted. + +#### Defined in + +[genai/session.ts:11](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/session.ts#L11) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/sortby.mdx b/weave/reference/typescript-sdk/interfaces/sortby.mdx new file mode 100644 index 0000000000..22ab719e91 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/sortby.mdx @@ -0,0 +1,41 @@ +--- +title: "Interface: SortBy" +description: "TypeScript SDK reference" +--- + +[weave](../) / SortBy + + + +SortBy + +## Table of contents + +### Properties + +- [direction](./sortby#direction) +- [field](./sortby#field) + +## Properties + +### direction + +• **direction**: ``"asc"`` \| ``"desc"`` + +Direction + +#### Defined in + +[generated/traceServerApi.ts:851](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L851) + +___ + +### field + +• **field**: `string` + +Field + +#### Defined in + +[generated/traceServerApi.ts:849](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/generated/traceServerApi.ts#L849) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/subagentinit.mdx b/weave/reference/typescript-sdk/interfaces/subagentinit.mdx new file mode 100644 index 0000000000..05d984746b --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/subagentinit.mdx @@ -0,0 +1,35 @@ +--- +title: "Interface: SubAgentInit" +description: "TypeScript SDK reference" +--- + +[weave](../) / SubAgentInit + + + +## Table of contents + +### Properties + +- [model](./subagentinit#model) +- [name](./subagentinit#name) + +## Properties + +### model + +• `Optional` **model**: `string` + +#### Defined in + +[genai/subagent.ts:15](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/subagent.ts#L15) + +___ + +### name + +• **name**: `string` + +#### Defined in + +[genai/subagent.ts:14](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/subagent.ts#L14) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/toolinit.mdx b/weave/reference/typescript-sdk/interfaces/toolinit.mdx new file mode 100644 index 0000000000..14def2aae9 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/toolinit.mdx @@ -0,0 +1,46 @@ +--- +title: "Interface: ToolInit" +description: "TypeScript SDK reference" +--- + +[weave](../) / ToolInit + + + +## Table of contents + +### Properties + +- [args](./toolinit#args) +- [name](./toolinit#name) +- [toolCallId](./toolinit#toolcallid) + +## Properties + +### args + +• `Optional` **args**: `string` + +#### Defined in + +[genai/tool.ts:17](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L17) + +___ + +### name + +• **name**: `string` + +#### Defined in + +[genai/tool.ts:16](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L16) + +___ + +### toolCallId + +• `Optional` **toolCallId**: `string` + +#### Defined in + +[genai/tool.ts:18](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/tool.ts#L18) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/turninit.mdx b/weave/reference/typescript-sdk/interfaces/turninit.mdx new file mode 100644 index 0000000000..8d8b7e38e2 --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/turninit.mdx @@ -0,0 +1,35 @@ +--- +title: "Interface: TurnInit" +description: "TypeScript SDK reference" +--- + +[weave](../) / TurnInit + + + +## Table of contents + +### Properties + +- [agentName](./turninit#agentname) +- [model](./turninit#model) + +## Properties + +### agentName + +• `Optional` **agentName**: `string` + +#### Defined in + +[genai/turn.ts:24](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L24) + +___ + +### model + +• `Optional` **model**: `string` + +#### Defined in + +[genai/turn.ts:25](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L25) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/usage.mdx b/weave/reference/typescript-sdk/interfaces/usage.mdx new file mode 100644 index 0000000000..11920ed98c --- /dev/null +++ b/weave/reference/typescript-sdk/interfaces/usage.mdx @@ -0,0 +1,68 @@ +--- +title: "Interface: Usage" +description: "TypeScript SDK reference" +--- + +[weave](../) / Usage + + + +## Table of contents + +### Properties + +- [cacheCreationInputTokens](./usage#cachecreationinputtokens) +- [cacheReadInputTokens](./usage#cachereadinputtokens) +- [inputTokens](./usage#inputtokens) +- [outputTokens](./usage#outputtokens) +- [reasoningTokens](./usage#reasoningtokens) + +## Properties + +### cacheCreationInputTokens + +• `Optional` **cacheCreationInputTokens**: `number` + +#### Defined in + +[genai/types.ts:35](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L35) + +___ + +### cacheReadInputTokens + +• `Optional` **cacheReadInputTokens**: `number` + +#### Defined in + +[genai/types.ts:36](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L36) + +___ + +### inputTokens + +• `Optional` **inputTokens**: `number` + +#### Defined in + +[genai/types.ts:32](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L32) + +___ + +### outputTokens + +• `Optional` **outputTokens**: `number` + +#### Defined in + +[genai/types.ts:33](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L33) + +___ + +### reasoningTokens + +• `Optional` **reasoningTokens**: `number` + +#### Defined in + +[genai/types.ts:34](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L34) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/weaveaudio.mdx b/weave/reference/typescript-sdk/interfaces/weaveaudio.mdx index fa3eb4a21e..85ec3b2737 100644 --- a/weave/reference/typescript-sdk/interfaces/weaveaudio.mdx +++ b/weave/reference/typescript-sdk/interfaces/weaveaudio.mdx @@ -29,7 +29,7 @@ description: "TypeScript SDK reference" #### Defined in -[media.ts:48](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L48) +[media.ts:48](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L48) ___ @@ -43,7 +43,7 @@ WeaveAudioInput.audioType #### Defined in -[media.ts:44](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L44) +[media.ts:44](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L44) ___ @@ -57,4 +57,4 @@ WeaveAudioInput.data #### Defined in -[media.ts:43](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L43) \ No newline at end of file +[media.ts:43](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L43) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/weaveimage.mdx b/weave/reference/typescript-sdk/interfaces/weaveimage.mdx index c00c10026a..323c2badab 100644 --- a/weave/reference/typescript-sdk/interfaces/weaveimage.mdx +++ b/weave/reference/typescript-sdk/interfaces/weaveimage.mdx @@ -29,7 +29,7 @@ description: "TypeScript SDK reference" #### Defined in -[media.ts:14](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L14) +[media.ts:14](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L14) ___ @@ -43,7 +43,7 @@ WeaveImageInput.data #### Defined in -[media.ts:9](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L9) +[media.ts:9](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L9) ___ @@ -57,4 +57,4 @@ WeaveImageInput.imageType #### Defined in -[media.ts:10](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/media.ts#L10) \ No newline at end of file +[media.ts:10](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/media.ts#L10) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/type-aliases/messagepart.mdx b/weave/reference/typescript-sdk/type-aliases/messagepart.mdx new file mode 100644 index 0000000000..2e32b50473 --- /dev/null +++ b/weave/reference/typescript-sdk/type-aliases/messagepart.mdx @@ -0,0 +1,14 @@ +--- +title: "MessagePart" +description: "TypeScript SDK reference" +--- + +# MessagePart + +Ƭ **MessagePart**: \{ `content`: `string` ; `type`: ``"text"`` } \| \{ `content`: `string` ; `type`: ``"reasoning"`` } \| \{ `arguments?`: `string` ; `toolCallId`: `string` ; `toolName`: `string` ; `type`: ``"tool_call"`` } \| \{ `result?`: `string` ; `toolCallId`: `string` ; `type`: ``"tool_result"`` } \| \{ `fileId`: `string` ; `mimeType?`: `string` ; `modality`: [`Modality`](./modality) ; `type`: ``"file"`` } \| \{ `content`: `string` ; `mimeType`: `string` ; `modality`: [`Modality`](./modality) ; `type`: ``"blob"`` } \| \{ `modality`: [`Modality`](./modality) ; `type`: ``"uri"`` ; `uri`: `string` } + +#### Defined in + +[genai/types.ts:17](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L17) + +___ diff --git a/weave/reference/typescript-sdk/type-aliases/modality.mdx b/weave/reference/typescript-sdk/type-aliases/modality.mdx new file mode 100644 index 0000000000..f2b56af1dc --- /dev/null +++ b/weave/reference/typescript-sdk/type-aliases/modality.mdx @@ -0,0 +1,14 @@ +--- +title: "Modality" +description: "TypeScript SDK reference" +--- + +# Modality + +Ƭ **Modality**: ``"image"`` \| ``"audio"`` \| ``"video"`` \| ``"document"`` + +#### Defined in + +[genai/types.ts:7](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L7) + +___ diff --git a/weave/reference/typescript-sdk/type-aliases/op.mdx b/weave/reference/typescript-sdk/type-aliases/op.mdx index 60ab2ba440..832f9473de 100644 --- a/weave/reference/typescript-sdk/type-aliases/op.mdx +++ b/weave/reference/typescript-sdk/type-aliases/op.mdx @@ -15,6 +15,6 @@ description: "TypeScript SDK reference" #### Defined in -[opType.ts:7](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/opType.ts#L7) +[opType.ts:7](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/opType.ts#L7) ___ diff --git a/weave/reference/typescript-sdk/type-aliases/opdecorator.mdx b/weave/reference/typescript-sdk/type-aliases/opdecorator.mdx index 5fe24e796c..89b05e1275 100644 --- a/weave/reference/typescript-sdk/type-aliases/opdecorator.mdx +++ b/weave/reference/typescript-sdk/type-aliases/opdecorator.mdx @@ -27,19 +27,6 @@ For legacy decorators: #### Defined in -[opType.ts:41](https://github.com/wandb/weave/blob/62f1e46098095776ee29b730ad10b3b3d1a68307/sdks/node/src/opType.ts#L41) - -## Functions - - - - - - - - - - - - +[opType.ts:41](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/opType.ts#L41) +___ diff --git a/weave/reference/typescript-sdk/type-aliases/role.mdx b/weave/reference/typescript-sdk/type-aliases/role.mdx new file mode 100644 index 0000000000..7cca2d9ac1 --- /dev/null +++ b/weave/reference/typescript-sdk/type-aliases/role.mdx @@ -0,0 +1,43 @@ +--- +title: "Role" +description: "TypeScript SDK reference" +--- + +# Role + +Ƭ **Role**: ``"user"`` \| ``"assistant"`` \| ``"system"`` \| ``"tool"`` + +Public data types for the Weave GenAI session SDK. + +#### Defined in + +[genai/types.ts:5](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/types.ts#L5) + +## Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + From f0950ca8b6759bb59e217b57b510827da800cea3 Mon Sep 17 00:00:00 2001 From: drtangible Date: Thu, 28 May 2026 11:38:06 -0500 Subject: [PATCH 2/5] update nav configuration for TypeScript SDK section --- docs.json | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 136 insertions(+), 4 deletions(-) diff --git a/docs.json b/docs.json index 6f1b72afe5..85ba367b47 100644 --- a/docs.json +++ b/docs.json @@ -1146,10 +1146,15 @@ "weave/reference/typescript-sdk/classes/dataset", "weave/reference/typescript-sdk/classes/evaluation", "weave/reference/typescript-sdk/classes/evaluationlogger", + "weave/reference/typescript-sdk/classes/llm", "weave/reference/typescript-sdk/classes/messagesprompt", "weave/reference/typescript-sdk/classes/objectref", "weave/reference/typescript-sdk/classes/scorelogger", + "weave/reference/typescript-sdk/classes/session", "weave/reference/typescript-sdk/classes/stringprompt", + "weave/reference/typescript-sdk/classes/subagent", + "weave/reference/typescript-sdk/classes/tool", + "weave/reference/typescript-sdk/classes/turn", "weave/reference/typescript-sdk/classes/weaveclient", "weave/reference/typescript-sdk/classes/weaveobject" ] @@ -1158,6 +1163,14 @@ "group": "Functions", "pages": [ "weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", + "weave/reference/typescript-sdk/functions/createotelextension", + "weave/reference/typescript-sdk/functions/endllm", + "weave/reference/typescript-sdk/functions/endsession", + "weave/reference/typescript-sdk/functions/endturn", + "weave/reference/typescript-sdk/functions/flushotel", + "weave/reference/typescript-sdk/functions/getcurrentllm", + "weave/reference/typescript-sdk/functions/getcurrentsession", + "weave/reference/typescript-sdk/functions/getcurrentturn", "weave/reference/typescript-sdk/functions/init", "weave/reference/typescript-sdk/functions/instrumentopenaiagents", "weave/reference/typescript-sdk/functions/login", @@ -1165,6 +1178,12 @@ "weave/reference/typescript-sdk/functions/patchrealtimesession", "weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "weave/reference/typescript-sdk/functions/requirecurrentchildsummary", + "weave/reference/typescript-sdk/functions/runisolated", + "weave/reference/typescript-sdk/functions/startllm", + "weave/reference/typescript-sdk/functions/startsession", + "weave/reference/typescript-sdk/functions/startsubagent", + "weave/reference/typescript-sdk/functions/starttool", + "weave/reference/typescript-sdk/functions/startturn", "weave/reference/typescript-sdk/functions/weaveaudio", "weave/reference/typescript-sdk/functions/weaveimage", "weave/reference/typescript-sdk/functions/withattributes", @@ -1177,6 +1196,17 @@ "pages": [ "weave/reference/typescript-sdk/interfaces/callschema", "weave/reference/typescript-sdk/interfaces/callsfilter", + "weave/reference/typescript-sdk/interfaces/getcallsoptions", + "weave/reference/typescript-sdk/interfaces/llminit", + "weave/reference/typescript-sdk/interfaces/message", + "weave/reference/typescript-sdk/interfaces/query", + "weave/reference/typescript-sdk/interfaces/reasoning", + "weave/reference/typescript-sdk/interfaces/sessioninit", + "weave/reference/typescript-sdk/interfaces/sortby", + "weave/reference/typescript-sdk/interfaces/subagentinit", + "weave/reference/typescript-sdk/interfaces/toolinit", + "weave/reference/typescript-sdk/interfaces/turninit", + "weave/reference/typescript-sdk/interfaces/usage", "weave/reference/typescript-sdk/interfaces/weaveaudio", "weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -1184,8 +1214,11 @@ { "group": "Type Aliases", "pages": [ + "weave/reference/typescript-sdk/type-aliases/messagepart", + "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/opdecorator", + "weave/reference/typescript-sdk/type-aliases/role" ] } ] @@ -2460,10 +2493,15 @@ "fr/weave/reference/typescript-sdk/classes/dataset", "fr/weave/reference/typescript-sdk/classes/evaluation", "fr/weave/reference/typescript-sdk/classes/evaluationlogger", + "fr/weave/reference/typescript-sdk/classes/llm", "fr/weave/reference/typescript-sdk/classes/messagesprompt", "fr/weave/reference/typescript-sdk/classes/objectref", "fr/weave/reference/typescript-sdk/classes/scorelogger", + "fr/weave/reference/typescript-sdk/classes/session", "fr/weave/reference/typescript-sdk/classes/stringprompt", + "fr/weave/reference/typescript-sdk/classes/subagent", + "fr/weave/reference/typescript-sdk/classes/tool", + "fr/weave/reference/typescript-sdk/classes/turn", "fr/weave/reference/typescript-sdk/classes/weaveclient", "fr/weave/reference/typescript-sdk/classes/weaveobject" ] @@ -2472,6 +2510,14 @@ "group": "Fonctions", "pages": [ "fr/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", + "fr/weave/reference/typescript-sdk/functions/createotelextension", + "fr/weave/reference/typescript-sdk/functions/endllm", + "fr/weave/reference/typescript-sdk/functions/endsession", + "fr/weave/reference/typescript-sdk/functions/endturn", + "fr/weave/reference/typescript-sdk/functions/flushotel", + "fr/weave/reference/typescript-sdk/functions/getcurrentllm", + "fr/weave/reference/typescript-sdk/functions/getcurrentsession", + "fr/weave/reference/typescript-sdk/functions/getcurrentturn", "fr/weave/reference/typescript-sdk/functions/init", "fr/weave/reference/typescript-sdk/functions/instrumentopenaiagents", "fr/weave/reference/typescript-sdk/functions/login", @@ -2479,6 +2525,12 @@ "fr/weave/reference/typescript-sdk/functions/patchrealtimesession", "fr/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "fr/weave/reference/typescript-sdk/functions/requirecurrentchildsummary", + "fr/weave/reference/typescript-sdk/functions/runisolated", + "fr/weave/reference/typescript-sdk/functions/startllm", + "fr/weave/reference/typescript-sdk/functions/startsession", + "fr/weave/reference/typescript-sdk/functions/startsubagent", + "fr/weave/reference/typescript-sdk/functions/starttool", + "fr/weave/reference/typescript-sdk/functions/startturn", "fr/weave/reference/typescript-sdk/functions/weaveaudio", "fr/weave/reference/typescript-sdk/functions/weaveimage", "fr/weave/reference/typescript-sdk/functions/withattributes", @@ -2491,6 +2543,17 @@ "pages": [ "fr/weave/reference/typescript-sdk/interfaces/callschema", "fr/weave/reference/typescript-sdk/interfaces/callsfilter", + "fr/weave/reference/typescript-sdk/interfaces/getcallsoptions", + "fr/weave/reference/typescript-sdk/interfaces/llminit", + "fr/weave/reference/typescript-sdk/interfaces/message", + "fr/weave/reference/typescript-sdk/interfaces/query", + "fr/weave/reference/typescript-sdk/interfaces/reasoning", + "fr/weave/reference/typescript-sdk/interfaces/sessioninit", + "fr/weave/reference/typescript-sdk/interfaces/sortby", + "fr/weave/reference/typescript-sdk/interfaces/subagentinit", + "fr/weave/reference/typescript-sdk/interfaces/toolinit", + "fr/weave/reference/typescript-sdk/interfaces/turninit", + "fr/weave/reference/typescript-sdk/interfaces/usage", "fr/weave/reference/typescript-sdk/interfaces/weaveaudio", "fr/weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -2498,8 +2561,11 @@ { "group": "Alias de types", "pages": [ + "fr/weave/reference/typescript-sdk/type-aliases/messagepart", + "fr/weave/reference/typescript-sdk/type-aliases/modality", "fr/weave/reference/typescript-sdk/type-aliases/op", - "fr/weave/reference/typescript-sdk/type-aliases/opdecorator" + "fr/weave/reference/typescript-sdk/type-aliases/opdecorator", + "fr/weave/reference/typescript-sdk/type-aliases/role" ] } ] @@ -3774,10 +3840,15 @@ "ja/weave/reference/typescript-sdk/classes/dataset", "ja/weave/reference/typescript-sdk/classes/evaluation", "ja/weave/reference/typescript-sdk/classes/evaluationlogger", + "ja/weave/reference/typescript-sdk/classes/llm", "ja/weave/reference/typescript-sdk/classes/messagesprompt", "ja/weave/reference/typescript-sdk/classes/objectref", "ja/weave/reference/typescript-sdk/classes/scorelogger", + "ja/weave/reference/typescript-sdk/classes/session", "ja/weave/reference/typescript-sdk/classes/stringprompt", + "ja/weave/reference/typescript-sdk/classes/subagent", + "ja/weave/reference/typescript-sdk/classes/tool", + "ja/weave/reference/typescript-sdk/classes/turn", "ja/weave/reference/typescript-sdk/classes/weaveclient", "ja/weave/reference/typescript-sdk/classes/weaveobject" ] @@ -3786,6 +3857,14 @@ "group": "関数", "pages": [ "ja/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", + "ja/weave/reference/typescript-sdk/functions/createotelextension", + "ja/weave/reference/typescript-sdk/functions/endllm", + "ja/weave/reference/typescript-sdk/functions/endsession", + "ja/weave/reference/typescript-sdk/functions/endturn", + "ja/weave/reference/typescript-sdk/functions/flushotel", + "ja/weave/reference/typescript-sdk/functions/getcurrentllm", + "ja/weave/reference/typescript-sdk/functions/getcurrentsession", + "ja/weave/reference/typescript-sdk/functions/getcurrentturn", "ja/weave/reference/typescript-sdk/functions/init", "ja/weave/reference/typescript-sdk/functions/instrumentopenaiagents", "ja/weave/reference/typescript-sdk/functions/login", @@ -3793,6 +3872,12 @@ "ja/weave/reference/typescript-sdk/functions/patchrealtimesession", "ja/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "ja/weave/reference/typescript-sdk/functions/requirecurrentchildsummary", + "ja/weave/reference/typescript-sdk/functions/runisolated", + "ja/weave/reference/typescript-sdk/functions/startllm", + "ja/weave/reference/typescript-sdk/functions/startsession", + "ja/weave/reference/typescript-sdk/functions/startsubagent", + "ja/weave/reference/typescript-sdk/functions/starttool", + "ja/weave/reference/typescript-sdk/functions/startturn", "ja/weave/reference/typescript-sdk/functions/weaveaudio", "ja/weave/reference/typescript-sdk/functions/weaveimage", "ja/weave/reference/typescript-sdk/functions/withattributes", @@ -3805,6 +3890,17 @@ "pages": [ "ja/weave/reference/typescript-sdk/interfaces/callschema", "ja/weave/reference/typescript-sdk/interfaces/callsfilter", + "ja/weave/reference/typescript-sdk/interfaces/getcallsoptions", + "ja/weave/reference/typescript-sdk/interfaces/llminit", + "ja/weave/reference/typescript-sdk/interfaces/message", + "ja/weave/reference/typescript-sdk/interfaces/query", + "ja/weave/reference/typescript-sdk/interfaces/reasoning", + "ja/weave/reference/typescript-sdk/interfaces/sessioninit", + "ja/weave/reference/typescript-sdk/interfaces/sortby", + "ja/weave/reference/typescript-sdk/interfaces/subagentinit", + "ja/weave/reference/typescript-sdk/interfaces/toolinit", + "ja/weave/reference/typescript-sdk/interfaces/turninit", + "ja/weave/reference/typescript-sdk/interfaces/usage", "ja/weave/reference/typescript-sdk/interfaces/weaveaudio", "ja/weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -3812,8 +3908,11 @@ { "group": "型エイリアス", "pages": [ + "ja/weave/reference/typescript-sdk/type-aliases/messagepart", + "ja/weave/reference/typescript-sdk/type-aliases/modality", "ja/weave/reference/typescript-sdk/type-aliases/op", - "ja/weave/reference/typescript-sdk/type-aliases/opdecorator" + "ja/weave/reference/typescript-sdk/type-aliases/opdecorator", + "ja/weave/reference/typescript-sdk/type-aliases/role" ] } ] @@ -5088,10 +5187,15 @@ "ko/weave/reference/typescript-sdk/classes/dataset", "ko/weave/reference/typescript-sdk/classes/evaluation", "ko/weave/reference/typescript-sdk/classes/evaluationlogger", + "ko/weave/reference/typescript-sdk/classes/llm", "ko/weave/reference/typescript-sdk/classes/messagesprompt", "ko/weave/reference/typescript-sdk/classes/objectref", "ko/weave/reference/typescript-sdk/classes/scorelogger", + "ko/weave/reference/typescript-sdk/classes/session", "ko/weave/reference/typescript-sdk/classes/stringprompt", + "ko/weave/reference/typescript-sdk/classes/subagent", + "ko/weave/reference/typescript-sdk/classes/tool", + "ko/weave/reference/typescript-sdk/classes/turn", "ko/weave/reference/typescript-sdk/classes/weaveclient", "ko/weave/reference/typescript-sdk/classes/weaveobject" ] @@ -5100,6 +5204,14 @@ "group": "함수", "pages": [ "ko/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", + "ko/weave/reference/typescript-sdk/functions/createotelextension", + "ko/weave/reference/typescript-sdk/functions/endllm", + "ko/weave/reference/typescript-sdk/functions/endsession", + "ko/weave/reference/typescript-sdk/functions/endturn", + "ko/weave/reference/typescript-sdk/functions/flushotel", + "ko/weave/reference/typescript-sdk/functions/getcurrentllm", + "ko/weave/reference/typescript-sdk/functions/getcurrentsession", + "ko/weave/reference/typescript-sdk/functions/getcurrentturn", "ko/weave/reference/typescript-sdk/functions/init", "ko/weave/reference/typescript-sdk/functions/instrumentopenaiagents", "ko/weave/reference/typescript-sdk/functions/login", @@ -5107,6 +5219,12 @@ "ko/weave/reference/typescript-sdk/functions/patchrealtimesession", "ko/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "ko/weave/reference/typescript-sdk/functions/requirecurrentchildsummary", + "ko/weave/reference/typescript-sdk/functions/runisolated", + "ko/weave/reference/typescript-sdk/functions/startllm", + "ko/weave/reference/typescript-sdk/functions/startsession", + "ko/weave/reference/typescript-sdk/functions/startsubagent", + "ko/weave/reference/typescript-sdk/functions/starttool", + "ko/weave/reference/typescript-sdk/functions/startturn", "ko/weave/reference/typescript-sdk/functions/weaveaudio", "ko/weave/reference/typescript-sdk/functions/weaveimage", "ko/weave/reference/typescript-sdk/functions/withattributes", @@ -5119,6 +5237,17 @@ "pages": [ "ko/weave/reference/typescript-sdk/interfaces/callschema", "ko/weave/reference/typescript-sdk/interfaces/callsfilter", + "ko/weave/reference/typescript-sdk/interfaces/getcallsoptions", + "ko/weave/reference/typescript-sdk/interfaces/llminit", + "ko/weave/reference/typescript-sdk/interfaces/message", + "ko/weave/reference/typescript-sdk/interfaces/query", + "ko/weave/reference/typescript-sdk/interfaces/reasoning", + "ko/weave/reference/typescript-sdk/interfaces/sessioninit", + "ko/weave/reference/typescript-sdk/interfaces/sortby", + "ko/weave/reference/typescript-sdk/interfaces/subagentinit", + "ko/weave/reference/typescript-sdk/interfaces/toolinit", + "ko/weave/reference/typescript-sdk/interfaces/turninit", + "ko/weave/reference/typescript-sdk/interfaces/usage", "ko/weave/reference/typescript-sdk/interfaces/weaveaudio", "ko/weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -5126,8 +5255,11 @@ { "group": "유형 별칭", "pages": [ + "ko/weave/reference/typescript-sdk/type-aliases/messagepart", + "ko/weave/reference/typescript-sdk/type-aliases/modality", "ko/weave/reference/typescript-sdk/type-aliases/op", - "ko/weave/reference/typescript-sdk/type-aliases/opdecorator" + "ko/weave/reference/typescript-sdk/type-aliases/opdecorator", + "ko/weave/reference/typescript-sdk/type-aliases/role" ] } ] From 13778ae63098e090f9db15a3149dfb25e948e41e Mon Sep 17 00:00:00 2001 From: drtangible Date: Thu, 28 May 2026 11:54:37 -0500 Subject: [PATCH 3/5] update breaking screens --- docs.json | 105 +----------------- .../functions/instrumentopenaiagents.mdx | 2 +- .../typescript-sdk/functions/runisolated.mdx | 3 + 3 files changed, 7 insertions(+), 103 deletions(-) diff --git a/docs.json b/docs.json index 85ba367b47..3357e1f911 100644 --- a/docs.json +++ b/docs.json @@ -2493,15 +2493,10 @@ "fr/weave/reference/typescript-sdk/classes/dataset", "fr/weave/reference/typescript-sdk/classes/evaluation", "fr/weave/reference/typescript-sdk/classes/evaluationlogger", - "fr/weave/reference/typescript-sdk/classes/llm", "fr/weave/reference/typescript-sdk/classes/messagesprompt", "fr/weave/reference/typescript-sdk/classes/objectref", "fr/weave/reference/typescript-sdk/classes/scorelogger", - "fr/weave/reference/typescript-sdk/classes/session", "fr/weave/reference/typescript-sdk/classes/stringprompt", - "fr/weave/reference/typescript-sdk/classes/subagent", - "fr/weave/reference/typescript-sdk/classes/tool", - "fr/weave/reference/typescript-sdk/classes/turn", "fr/weave/reference/typescript-sdk/classes/weaveclient", "fr/weave/reference/typescript-sdk/classes/weaveobject" ] @@ -2510,14 +2505,6 @@ "group": "Fonctions", "pages": [ "fr/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", - "fr/weave/reference/typescript-sdk/functions/createotelextension", - "fr/weave/reference/typescript-sdk/functions/endllm", - "fr/weave/reference/typescript-sdk/functions/endsession", - "fr/weave/reference/typescript-sdk/functions/endturn", - "fr/weave/reference/typescript-sdk/functions/flushotel", - "fr/weave/reference/typescript-sdk/functions/getcurrentllm", - "fr/weave/reference/typescript-sdk/functions/getcurrentsession", - "fr/weave/reference/typescript-sdk/functions/getcurrentturn", "fr/weave/reference/typescript-sdk/functions/init", "fr/weave/reference/typescript-sdk/functions/instrumentopenaiagents", "fr/weave/reference/typescript-sdk/functions/login", @@ -2525,12 +2512,6 @@ "fr/weave/reference/typescript-sdk/functions/patchrealtimesession", "fr/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "fr/weave/reference/typescript-sdk/functions/requirecurrentchildsummary", - "fr/weave/reference/typescript-sdk/functions/runisolated", - "fr/weave/reference/typescript-sdk/functions/startllm", - "fr/weave/reference/typescript-sdk/functions/startsession", - "fr/weave/reference/typescript-sdk/functions/startsubagent", - "fr/weave/reference/typescript-sdk/functions/starttool", - "fr/weave/reference/typescript-sdk/functions/startturn", "fr/weave/reference/typescript-sdk/functions/weaveaudio", "fr/weave/reference/typescript-sdk/functions/weaveimage", "fr/weave/reference/typescript-sdk/functions/withattributes", @@ -2543,17 +2524,6 @@ "pages": [ "fr/weave/reference/typescript-sdk/interfaces/callschema", "fr/weave/reference/typescript-sdk/interfaces/callsfilter", - "fr/weave/reference/typescript-sdk/interfaces/getcallsoptions", - "fr/weave/reference/typescript-sdk/interfaces/llminit", - "fr/weave/reference/typescript-sdk/interfaces/message", - "fr/weave/reference/typescript-sdk/interfaces/query", - "fr/weave/reference/typescript-sdk/interfaces/reasoning", - "fr/weave/reference/typescript-sdk/interfaces/sessioninit", - "fr/weave/reference/typescript-sdk/interfaces/sortby", - "fr/weave/reference/typescript-sdk/interfaces/subagentinit", - "fr/weave/reference/typescript-sdk/interfaces/toolinit", - "fr/weave/reference/typescript-sdk/interfaces/turninit", - "fr/weave/reference/typescript-sdk/interfaces/usage", "fr/weave/reference/typescript-sdk/interfaces/weaveaudio", "fr/weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -2561,11 +2531,8 @@ { "group": "Alias de types", "pages": [ - "fr/weave/reference/typescript-sdk/type-aliases/messagepart", - "fr/weave/reference/typescript-sdk/type-aliases/modality", "fr/weave/reference/typescript-sdk/type-aliases/op", - "fr/weave/reference/typescript-sdk/type-aliases/opdecorator", - "fr/weave/reference/typescript-sdk/type-aliases/role" + "fr/weave/reference/typescript-sdk/type-aliases/opdecorator" ] } ] @@ -3840,15 +3807,10 @@ "ja/weave/reference/typescript-sdk/classes/dataset", "ja/weave/reference/typescript-sdk/classes/evaluation", "ja/weave/reference/typescript-sdk/classes/evaluationlogger", - "ja/weave/reference/typescript-sdk/classes/llm", "ja/weave/reference/typescript-sdk/classes/messagesprompt", "ja/weave/reference/typescript-sdk/classes/objectref", "ja/weave/reference/typescript-sdk/classes/scorelogger", - "ja/weave/reference/typescript-sdk/classes/session", "ja/weave/reference/typescript-sdk/classes/stringprompt", - "ja/weave/reference/typescript-sdk/classes/subagent", - "ja/weave/reference/typescript-sdk/classes/tool", - "ja/weave/reference/typescript-sdk/classes/turn", "ja/weave/reference/typescript-sdk/classes/weaveclient", "ja/weave/reference/typescript-sdk/classes/weaveobject" ] @@ -3857,14 +3819,6 @@ "group": "関数", "pages": [ "ja/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", - "ja/weave/reference/typescript-sdk/functions/createotelextension", - "ja/weave/reference/typescript-sdk/functions/endllm", - "ja/weave/reference/typescript-sdk/functions/endsession", - "ja/weave/reference/typescript-sdk/functions/endturn", - "ja/weave/reference/typescript-sdk/functions/flushotel", - "ja/weave/reference/typescript-sdk/functions/getcurrentllm", - "ja/weave/reference/typescript-sdk/functions/getcurrentsession", - "ja/weave/reference/typescript-sdk/functions/getcurrentturn", "ja/weave/reference/typescript-sdk/functions/init", "ja/weave/reference/typescript-sdk/functions/instrumentopenaiagents", "ja/weave/reference/typescript-sdk/functions/login", @@ -3872,12 +3826,6 @@ "ja/weave/reference/typescript-sdk/functions/patchrealtimesession", "ja/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "ja/weave/reference/typescript-sdk/functions/requirecurrentchildsummary", - "ja/weave/reference/typescript-sdk/functions/runisolated", - "ja/weave/reference/typescript-sdk/functions/startllm", - "ja/weave/reference/typescript-sdk/functions/startsession", - "ja/weave/reference/typescript-sdk/functions/startsubagent", - "ja/weave/reference/typescript-sdk/functions/starttool", - "ja/weave/reference/typescript-sdk/functions/startturn", "ja/weave/reference/typescript-sdk/functions/weaveaudio", "ja/weave/reference/typescript-sdk/functions/weaveimage", "ja/weave/reference/typescript-sdk/functions/withattributes", @@ -3890,17 +3838,6 @@ "pages": [ "ja/weave/reference/typescript-sdk/interfaces/callschema", "ja/weave/reference/typescript-sdk/interfaces/callsfilter", - "ja/weave/reference/typescript-sdk/interfaces/getcallsoptions", - "ja/weave/reference/typescript-sdk/interfaces/llminit", - "ja/weave/reference/typescript-sdk/interfaces/message", - "ja/weave/reference/typescript-sdk/interfaces/query", - "ja/weave/reference/typescript-sdk/interfaces/reasoning", - "ja/weave/reference/typescript-sdk/interfaces/sessioninit", - "ja/weave/reference/typescript-sdk/interfaces/sortby", - "ja/weave/reference/typescript-sdk/interfaces/subagentinit", - "ja/weave/reference/typescript-sdk/interfaces/toolinit", - "ja/weave/reference/typescript-sdk/interfaces/turninit", - "ja/weave/reference/typescript-sdk/interfaces/usage", "ja/weave/reference/typescript-sdk/interfaces/weaveaudio", "ja/weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -3908,11 +3845,8 @@ { "group": "型エイリアス", "pages": [ - "ja/weave/reference/typescript-sdk/type-aliases/messagepart", - "ja/weave/reference/typescript-sdk/type-aliases/modality", "ja/weave/reference/typescript-sdk/type-aliases/op", - "ja/weave/reference/typescript-sdk/type-aliases/opdecorator", - "ja/weave/reference/typescript-sdk/type-aliases/role" + "ja/weave/reference/typescript-sdk/type-aliases/opdecorator" ] } ] @@ -5187,15 +5121,10 @@ "ko/weave/reference/typescript-sdk/classes/dataset", "ko/weave/reference/typescript-sdk/classes/evaluation", "ko/weave/reference/typescript-sdk/classes/evaluationlogger", - "ko/weave/reference/typescript-sdk/classes/llm", "ko/weave/reference/typescript-sdk/classes/messagesprompt", "ko/weave/reference/typescript-sdk/classes/objectref", "ko/weave/reference/typescript-sdk/classes/scorelogger", - "ko/weave/reference/typescript-sdk/classes/session", "ko/weave/reference/typescript-sdk/classes/stringprompt", - "ko/weave/reference/typescript-sdk/classes/subagent", - "ko/weave/reference/typescript-sdk/classes/tool", - "ko/weave/reference/typescript-sdk/classes/turn", "ko/weave/reference/typescript-sdk/classes/weaveclient", "ko/weave/reference/typescript-sdk/classes/weaveobject" ] @@ -5204,14 +5133,6 @@ "group": "함수", "pages": [ "ko/weave/reference/typescript-sdk/functions/createopenaiagentstracingprocessor", - "ko/weave/reference/typescript-sdk/functions/createotelextension", - "ko/weave/reference/typescript-sdk/functions/endllm", - "ko/weave/reference/typescript-sdk/functions/endsession", - "ko/weave/reference/typescript-sdk/functions/endturn", - "ko/weave/reference/typescript-sdk/functions/flushotel", - "ko/weave/reference/typescript-sdk/functions/getcurrentllm", - "ko/weave/reference/typescript-sdk/functions/getcurrentsession", - "ko/weave/reference/typescript-sdk/functions/getcurrentturn", "ko/weave/reference/typescript-sdk/functions/init", "ko/weave/reference/typescript-sdk/functions/instrumentopenaiagents", "ko/weave/reference/typescript-sdk/functions/login", @@ -5219,12 +5140,6 @@ "ko/weave/reference/typescript-sdk/functions/patchrealtimesession", "ko/weave/reference/typescript-sdk/functions/requirecurrentcallstackentry", "ko/weave/reference/typescript-sdk/functions/requirecurrentchildsummary", - "ko/weave/reference/typescript-sdk/functions/runisolated", - "ko/weave/reference/typescript-sdk/functions/startllm", - "ko/weave/reference/typescript-sdk/functions/startsession", - "ko/weave/reference/typescript-sdk/functions/startsubagent", - "ko/weave/reference/typescript-sdk/functions/starttool", - "ko/weave/reference/typescript-sdk/functions/startturn", "ko/weave/reference/typescript-sdk/functions/weaveaudio", "ko/weave/reference/typescript-sdk/functions/weaveimage", "ko/weave/reference/typescript-sdk/functions/withattributes", @@ -5237,17 +5152,6 @@ "pages": [ "ko/weave/reference/typescript-sdk/interfaces/callschema", "ko/weave/reference/typescript-sdk/interfaces/callsfilter", - "ko/weave/reference/typescript-sdk/interfaces/getcallsoptions", - "ko/weave/reference/typescript-sdk/interfaces/llminit", - "ko/weave/reference/typescript-sdk/interfaces/message", - "ko/weave/reference/typescript-sdk/interfaces/query", - "ko/weave/reference/typescript-sdk/interfaces/reasoning", - "ko/weave/reference/typescript-sdk/interfaces/sessioninit", - "ko/weave/reference/typescript-sdk/interfaces/sortby", - "ko/weave/reference/typescript-sdk/interfaces/subagentinit", - "ko/weave/reference/typescript-sdk/interfaces/toolinit", - "ko/weave/reference/typescript-sdk/interfaces/turninit", - "ko/weave/reference/typescript-sdk/interfaces/usage", "ko/weave/reference/typescript-sdk/interfaces/weaveaudio", "ko/weave/reference/typescript-sdk/interfaces/weaveimage" ] @@ -5255,11 +5159,8 @@ { "group": "유형 별칭", "pages": [ - "ko/weave/reference/typescript-sdk/type-aliases/messagepart", - "ko/weave/reference/typescript-sdk/type-aliases/modality", "ko/weave/reference/typescript-sdk/type-aliases/op", - "ko/weave/reference/typescript-sdk/type-aliases/opdecorator", - "ko/weave/reference/typescript-sdk/type-aliases/role" + "ko/weave/reference/typescript-sdk/type-aliases/opdecorator" ] } ] diff --git a/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx b/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx index c74e1f42e6..4be9fd0588 100644 --- a/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx +++ b/weave/reference/typescript-sdk/functions/instrumentopenaiagents.mdx @@ -22,7 +22,7 @@ throwing an error. `Promise`\<`boolean`\> -Promise - true if registration succeeded, false if @openai/agents not available +`Promise` - `true` if registration succeeded, `false` if `@openai/agents` not available `Example` diff --git a/weave/reference/typescript-sdk/functions/runisolated.mdx b/weave/reference/typescript-sdk/functions/runisolated.mdx index 86b6f44923..d78e2d59e8 100644 --- a/weave/reference/typescript-sdk/functions/runisolated.mdx +++ b/weave/reference/typescript-sdk/functions/runisolated.mdx @@ -14,10 +14,13 @@ to the outer async chain. Use this to safely run parallel GenAI work: + + ```typescript await Promise.all([ weave.runIsolated(async () => { ... }), weave.runIsolated(async () => { ... }), ]); + ``` Sequential single-flight usage doesn't require this wrapper — the process-wide default state handles it. From 6a91fcac6c1005e69232beec749a9578553a5a84 Mon Sep 17 00:00:00 2001 From: drtangible Date: Thu, 28 May 2026 15:06:08 -0500 Subject: [PATCH 4/5] generate docs from latest --- .../reference/typescript-sdk/classes/turn.mdx | 79 +++++++++++++++++-- .../typescript-sdk/interfaces/turninit.mdx | 4 +- 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/weave/reference/typescript-sdk/classes/turn.mdx b/weave/reference/typescript-sdk/classes/turn.mdx index 3f20b80271..e1f28af8c1 100644 --- a/weave/reference/typescript-sdk/classes/turn.mdx +++ b/weave/reference/typescript-sdk/classes/turn.mdx @@ -40,7 +40,9 @@ try { ### Methods +- [addEvent](./turn#addevent) - [end](./turn#end) +- [setAttribute](./turn#setattribute) - [startLLM](./turn#startllm) - [startSubagent](./turn#startsubagent) - [startTool](./turn#starttool) @@ -54,7 +56,7 @@ try { #### Defined in -[genai/turn.ts:57](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L57) +[genai/turn.ts:60](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L60) ___ @@ -64,10 +66,42 @@ ___ #### Defined in -[genai/turn.ts:58](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L58) +[genai/turn.ts:61](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L61) ## Methods +### addEvent + +▸ **addEvent**(`name`, `attributes?`, `startTime?`): `this` + +Add a named event to the Turn span. Useful for marking non-span moments +such as context compaction, tool-loop detection, or guardrail trips. +No-op after `end()`. Mirrors OTel `Span.addEvent`. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `name` | `string` | +| `attributes?` | `Attributes` | +| `startTime?` | `TimeInput` | + +#### Returns + +`this` + +`Example` + +```ts +turn.addEvent('context_compacted', {removedMessages: 12}); +``` + +#### Defined in + +[genai/turn.ts:152](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L152) + +___ + ### end ▸ **end**(`opts?`): `void` @@ -87,7 +121,38 @@ Close the Turn span. Idempotent. Pass `error` to mark it as failed. #### Defined in -[genai/turn.ts:128](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L128) +[genai/turn.ts:159](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L159) + +___ + +### setAttribute + +▸ **setAttribute**(`key`, `value`): `this` + +Set a single attribute on the Turn span. Useful for stamping running +totals (e.g. cumulative cost, token usage) or other metadata that becomes +known mid-turn. No-op after `end()`. Mirrors OTel `Span.setAttribute`. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `AttributeValue` | + +#### Returns + +`this` + +`Example` + +```ts +turn.setAttribute('gen_ai.usage.input_tokens', totalInputTokens); +``` + +#### Defined in + +[genai/turn.ts:138](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L138) ___ @@ -109,7 +174,7 @@ Start a child LLM span under this Turn. #### Defined in -[genai/turn.ts:101](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L101) +[genai/turn.ts:104](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L104) ___ @@ -131,7 +196,7 @@ Start a child SubAgent span under this Turn. #### Defined in -[genai/turn.ts:119](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L119) +[genai/turn.ts:122](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L122) ___ @@ -153,7 +218,7 @@ Start a child Tool span under this Turn. #### Defined in -[genai/turn.ts:110](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L110) +[genai/turn.ts:113](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L113) ___ @@ -173,4 +238,4 @@ ___ #### Defined in -[genai/turn.ts:61](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L61) \ No newline at end of file +[genai/turn.ts:64](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L64) \ No newline at end of file diff --git a/weave/reference/typescript-sdk/interfaces/turninit.mdx b/weave/reference/typescript-sdk/interfaces/turninit.mdx index 8d8b7e38e2..429a1e13f1 100644 --- a/weave/reference/typescript-sdk/interfaces/turninit.mdx +++ b/weave/reference/typescript-sdk/interfaces/turninit.mdx @@ -22,7 +22,7 @@ description: "TypeScript SDK reference" #### Defined in -[genai/turn.ts:24](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L24) +[genai/turn.ts:27](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L27) ___ @@ -32,4 +32,4 @@ ___ #### Defined in -[genai/turn.ts:25](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L25) \ No newline at end of file +[genai/turn.ts:28](https://github.com/wandb/weave/blob/a383d080ca97801c327ddeac4a2fc17875cabe2f/sdks/node/src/genai/turn.ts#L28) \ No newline at end of file From 7aef6396a2e4c0ca74db534ced15ff8806a168f6 Mon Sep 17 00:00:00 2001 From: dbrian57 Date: Thu, 28 May 2026 16:15:41 -0400 Subject: [PATCH 5/5] Updates the TOC script to traverse the new information architecture --- .../weave/update_weave_toc.py | 219 ++++++++++-------- 1 file changed, 122 insertions(+), 97 deletions(-) diff --git a/scripts/reference-generation/weave/update_weave_toc.py b/scripts/reference-generation/weave/update_weave_toc.py index 9c342273ed..d14e73b4f7 100755 --- a/scripts/reference-generation/weave/update_weave_toc.py +++ b/scripts/reference-generation/weave/update_weave_toc.py @@ -100,115 +100,140 @@ def get_service_api_endpoints(): return sorted(endpoints) +def _iter_nav_dicts(node): + """Yield every dict found while walking a navigation subtree. + + Walks into both 'pages' and 'tabs' arrays, which Mintlify nests + at different depths depending on the navigation shape. + """ + if isinstance(node, dict): + yield node + for child in node.get("pages", []): + yield from _iter_nav_dicts(child) + for child in node.get("tabs", []): + yield from _iter_nav_dicts(child) + elif isinstance(node, list): + for child in node: + yield from _iter_nav_dicts(child) + + +def _find_english_group(docs, group_name): + """Return the first dict with group == group_name inside the English nav. + + Resilient to changes in how `tab` and `group` levels are nested under + `navigation.languages[lang=en]`, so the regen workflow keeps working + even if the Reference / W&B Weave / SDK hierarchy is restructured. + """ + languages = docs.get("navigation", {}).get("languages", []) + en_lang = next( + (lang for lang in languages if lang.get("language") == "en"), + None, + ) + if en_lang is None: + return None + for node in _iter_nav_dicts(en_lang): + if isinstance(node, dict) and node.get("group") == group_name: + return node + return None + + def update_docs_json(python_modules, typescript_items, service_endpoints): """Update the docs.json file with all reference documentation.""" - + # Read current docs.json with open("docs.json", "r") as f: docs = json.load(f) - - # Navigate through the navigation structure - # The structure is: navigation.languages[0].tabs[x].tab="W&B Weave" - navigation = docs.get("navigation", {}) - languages = navigation.get("languages", []) - if not languages: + + if not docs.get("navigation", {}).get("languages"): print("⚠️ No languages found in navigation") return - + updated = False - # Look for English navigation (first language) - for lang in languages: - if lang.get("language") == "en" and "tabs" in lang: - for tab in lang["tabs"]: - if tab.get("tab") == "W&B Weave": - # Find the Reference group - for group in tab.get("pages", []): - if isinstance(group, dict) and group.get("group") == "Reference": - reference_pages = group.get("pages", []) - - # Update Python SDK - for page in reference_pages: - if isinstance(page, dict) and page.get("group") == "Python SDK": - # Always start with the root page - new_pages = ["weave/reference/python-sdk"] - - # Add the grouped modules - if "Core" in python_modules and python_modules["Core"]: - new_pages.append({ - "group": "Core", - "pages": python_modules["Core"] - }) - - if "Trace Server" in python_modules and python_modules["Trace Server"]: - new_pages.append({ - "group": "Trace Server", - "pages": python_modules["Trace Server"] - }) - - if "Trace Server Bindings" in python_modules and python_modules["Trace Server Bindings"]: - new_pages.append({ - "group": "Trace Server Bindings", - "pages": python_modules["Trace Server Bindings"] - }) - - if "Other" in python_modules and python_modules["Other"]: - new_pages.append({ - "group": "Other", - "pages": python_modules["Other"] - }) - - page["pages"] = new_pages - print(f"✓ Updated Python SDK with {sum(len(m) for m in python_modules.values())} modules") - updated = True - - # Update TypeScript SDK - for page in reference_pages: - if isinstance(page, dict) and page.get("group") == "TypeScript SDK": - # Always start with the root page - new_pages = ["weave/reference/typescript-sdk"] - - # Add the categorized items with proper casing - if "classes" in typescript_items and typescript_items["classes"]: - new_pages.append({ - "group": "Classes", - "pages": typescript_items["classes"] - }) - - if "functions" in typescript_items and typescript_items["functions"]: - new_pages.append({ - "group": "Functions", - "pages": typescript_items["functions"] - }) - - if "interfaces" in typescript_items and typescript_items["interfaces"]: - new_pages.append({ - "group": "Interfaces", - "pages": typescript_items["interfaces"] - }) - - if "type-aliases" in typescript_items and typescript_items["type-aliases"]: - new_pages.append({ - "group": "Type Aliases", - "pages": typescript_items["type-aliases"] - }) - - page["pages"] = new_pages - print(f"✓ Updated TypeScript SDK with {sum(len(items) for items in typescript_items.values())} items") - updated = True - - # Note: Service API OpenAPI configuration is managed by sync_openapi_spec.py - # We don't modify it here to preserve the local vs remote spec choice - - break - break - + + # Update Python SDK + python_group = _find_english_group(docs, "Python SDK") + if python_group is not None: + new_pages = ["weave/reference/python-sdk"] + + if "Core" in python_modules and python_modules["Core"]: + new_pages.append({ + "group": "Core", + "pages": python_modules["Core"] + }) + + if "Trace Server" in python_modules and python_modules["Trace Server"]: + new_pages.append({ + "group": "Trace Server", + "pages": python_modules["Trace Server"] + }) + + if "Trace Server Bindings" in python_modules and python_modules["Trace Server Bindings"]: + new_pages.append({ + "group": "Trace Server Bindings", + "pages": python_modules["Trace Server Bindings"] + }) + + if "Other" in python_modules and python_modules["Other"]: + new_pages.append({ + "group": "Other", + "pages": python_modules["Other"] + }) + + python_group["pages"] = new_pages + print(f"✓ Updated Python SDK with {sum(len(m) for m in python_modules.values())} modules") + updated = True + else: + print("⚠️ Could not find 'Python SDK' group in English navigation") + + # Update TypeScript SDK + typescript_group = _find_english_group(docs, "TypeScript SDK") + if typescript_group is not None: + new_pages = ["weave/reference/typescript-sdk"] + + if "classes" in typescript_items and typescript_items["classes"]: + new_pages.append({ + "group": "Classes", + "pages": typescript_items["classes"] + }) + + if "functions" in typescript_items and typescript_items["functions"]: + new_pages.append({ + "group": "Functions", + "pages": typescript_items["functions"] + }) + + if "interfaces" in typescript_items and typescript_items["interfaces"]: + new_pages.append({ + "group": "Interfaces", + "pages": typescript_items["interfaces"] + }) + + if "type-aliases" in typescript_items and typescript_items["type-aliases"]: + new_pages.append({ + "group": "Type Aliases", + "pages": typescript_items["type-aliases"] + }) + + typescript_group["pages"] = new_pages + print(f"✓ Updated TypeScript SDK with {sum(len(items) for items in typescript_items.values())} items") + updated = True + else: + print("⚠️ Could not find 'TypeScript SDK' group in English navigation") + + # Note: Service API OpenAPI configuration is managed by sync_openapi_spec.py + # We don't modify it here to preserve the local vs remote spec choice + if updated: - # Write updated docs.json + # Write updated docs.json. Use ensure_ascii=False so we don't + # mangle non-ASCII characters in localized navigation entries + # (French, Japanese, Korean) into \uXXXX escape sequences. with open("docs.json", "w") as f: - json.dump(docs, f, indent=2) + json.dump(docs, f, indent=2, ensure_ascii=False) print("✓ Updated docs.json with all reference documentation") else: - print("⚠️ Could not find Reference sections to update in docs.json") + print("⚠️ No SDK groups were updated in docs.json. The navigation " + "structure may have changed - inspect docs.json and update " + "this script's group lookup if needed.") def main():