Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Wandb Weave WeaveClient Get Calls

From Leeroopedia
Knowledge Sources
Domains Observability, Data_Retrieval
Last Updated 2026-02-14 00:00 GMT

Overview

Concrete tool for querying traced calls from the backend provided by the Wandb Weave library.

Description

WeaveClient.get_calls() retrieves traced call records with support for filtering, sorting, pagination, field projection, cost/feedback inclusion, and scorer-based filtering. Returns a CallsIter that supports iteration, slicing, and conversion to pandas.

Usage

Call this method on the WeaveClient instance (returned by weave.init()) to programmatically query traced calls.

Code Reference

Source Location

  • Repository: wandb/weave
  • File: weave/trace/weave_client.py
  • Lines: L527-603

Signature

def get_calls(
    self,
    *,
    filter: CallsFilterLike | None = None,
    limit: int | None = None,
    offset: int | None = None,
    sort_by: list[SortByLike] | None = None,
    query: QueryLike | None = None,
    include_costs: bool = False,
    include_feedback: bool = False,
    include_storage_size: bool = False,
    include_total_storage_size: bool = False,
    columns: list[str] | None = None,
    expand_columns: list[str] | None = None,
    return_expanded_column_values: bool = True,
    scored_by: str | list[str] | None = None,
    page_size: int = DEFAULT_CALLS_PAGE_SIZE,
) -> CallsIter:
    """Retrieve a list of traced calls for this project.

    Args:
        filter: High-level filter for narrowing results.
        limit: Maximum number of calls to return.
        offset: Number of calls to skip (pagination).
        sort_by: List of fields to sort by.
        query: Mongo-like expression for advanced filtering.
        include_costs: Include token/cost info.
        include_feedback: Include feedback metadata.
        columns: Specific fields to return (performance optimization).
        scored_by: Filter by scorer name or ref URI.
        page_size: Number of calls fetched per page.

    Returns:
        CallsIter: Iterator over Call objects.
    """

Import

import weave

client = weave.init("my-team/my-project")
# use client.get_calls(...)

I/O Contract

Inputs

Name Type Required Description
filter None No Filter by op names, parent IDs, trace IDs
limit None No Maximum results
offset None No Skip N results (pagination)
sort_by None No Sort fields
query None No Mongo-like expression
include_costs bool No Include token/cost info (default False)
include_feedback bool No Include feedback (default False)
columns None No Specific fields to return
scored_by list[str] | None No Filter by scorer
page_size int No Page size (default 1000)

Outputs

Name Type Description
return CallsIter Paginated iterator over Call objects (supports slicing, .to_pandas())

Usage Examples

Query Calls

import weave

client = weave.init("my-team/my-project")

# Get recent calls for a specific op
calls = client.get_calls(
    filter={"op_names": ["my_model"]},
    limit=100,
    columns=["inputs", "output", "summary"],
)

for call in calls:
    print(call.op_name, call.output)

# Convert to DataFrame for analysis
df = calls.to_pandas()

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment