Objects
An Object is versioned, serializable data. Weave automatically versions objects when they change and creates an immutable history. Objects include:- Datasets: Collections of examples for evaluation
- Models: Configurations and parameters for your LLM logic
- Prompts: Versioned prompt templates
Publish an object
Weave’s serialization layer saves and versions objects.- Python
- TypeScript
Get an object back
After publishing, you can fetch a stored object using its reference.- Python
- TypeScript
weave.publish() returns a Ref. Call .get() on any Ref to get the object back.You can construct a ref and then fetch the object back.Delete an object
If you no longer need a specific version of an object, you can remove it using its ref.- Python
- TypeScript
To delete a version of an object, call Accessing a deleted object returns an error. Resolving an object that references a deleted object returns a
.delete() on the object’s ref.DeletedRef in place of the deleted object.Construct object refs
Refs uniquely identify a stored object and version. The following sections describe the URI structure and the ways you can construct a ref. In Weave, a fully qualified object ref URI looks like this:[YOUR-TEAM-NAME]: W&B entity (username or team name)[YOUR-PROJECT-NAME]: W&B project[OBJECT-NAME]: object name[OBJECT-VERSION]: either a version hash, a string likev0orv1, or an alias like:latest. All objects have the:latestalias.
weave.ref([NAME]): retrieves the:latestversion of an object. Requires callingweave.init(...).weave.ref([NAME]:[VERSION]): retrieves the specified version of an object. Requires callingweave.init(...).weave.ref([FULLY-QUALIFIED-REF-URI]): retrieves the object located at the specified fully qualified object ref URI. Doesn’t require callingweave.init().