Trace
A high level implementation of Trace
for Weight & Biases Prompts.
Trace
Manage and log a trace - a collection of spans their metadata and hierarchy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
(str) The name of the root span. |
required |
kind |
str
|
(str, optional) The kind of the root span. |
None
|
status_code |
str
|
(str, optional) The status of the root span, either "error" or "success". |
None
|
status_message |
str
|
(str, optional) Any status message associated with the root span. |
None
|
metadata |
dict
|
(dict, optional) Any additional metadata for the root span. |
None
|
start_time_ms |
int
|
(int, optional) The start time of the root span in milliseconds. |
None
|
end_time_ms |
int
|
(int, optional) The end time of the root span in milliseconds. |
None
|
inputs |
dict
|
(dict, optional) The named inputs of the root span. |
None
|
outputs |
dict
|
(dict, optional) The named outputs of the root span. |
None
|
model_dict |
dict
|
(dict, optional) A json serializable dictionary containing the model architecture details. |
None
|
Source code in wandb_addons/prompts/tracer.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
add_child(child)
Add a child span to the current span of the trace.
Source code in wandb_addons/prompts/tracer.py
add_inputs_and_outputs(inputs, outputs)
Add a result to the span of the current trace.
Source code in wandb_addons/prompts/tracer.py
add_metadata(metadata)
Add metadata to the span of the current trace.
Source code in wandb_addons/prompts/tracer.py
log(name)
Log the trace to a wandb run