Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-docs-2661.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Sometimes, large trace data is cut off in the Weave UI. This happens because the default trace output is a raw, custom Python object that Weave can’t serialize. This page shows how to expose the full trace data so it displays in the UI. To prevent large trace data from being cut off, define a to_dict method that returns a dictionary of strings containing all trace data. Because Weave can serialize dictionaries, this approach gives the UI access to the full object state. The following example shows the pattern:
import weave

class MyObj:
    def __init__(self, x: int):
        self.x = x

    def __repr__(self):
        return f"MyObj(x={self.x})"

    def to_dict(self):
        return {"x": self.x}

@weave.op()
def make_my_obj():
    x = "s" * 10_000
    return MyObj(x)
With this to_dict method in place, Weave can serialize the object and display its contents in the trace UI instead of truncating the raw representation.
Trace Data