Module: batteries/logging-integrations
Integrations with external logging services. Currently only Weights and Biases is supported. You can see examples package for an example with OpenTelemetry.
Functions
WeightsAndBiasesTracer
▸ WeightsAndBiasesTracer(«destructured»
, «destructured»
): Element
<any
>
Weights and Biases logging integration for AI.JSX.
The tracer allows for the creation of a trace tree that can be visualized in the
Weights and Biases UI. To use it, wrap your application in a WeightsAndBiasesTracer
component.
InitOptions, such as project name, can be passed to the WeightsAndBiasesTracer
component.
Note
Make sure to
- Set the
WANDB_API_KEY
environment variable (in Node environments) andsessionStorage.getItem("WANDB_API_KEY")
(in browser environments); - Run
await wandb.finish()
after rendering is done.
See
https://docs.wandb.ai/ref/js/ for more info.
Example
await wandb.init()
console.log(
await AI.createRenderContext().render(
<WeightsAndBiasesTracer log={wandb.log}>
<CharacterGenerator />
</WeightsAndBiasesTracer>
)
);
await wandb.finish();
Parameters
Name | Type |
---|---|
«destructured» | Object |
› children | Node |
› log | (_ : Record <string , unknown >, step? : number , commit? : boolean ) => any |
«destructured» | ComponentContext |
Returns
Element
<any
>