xsAI v0.4 "AIAIAI" is now available! Read Announcement
xsAI0.4.2

Telemetry

install sizeminified sizeminzipped size
npm i @xsai-ext/telemetry

Usage

@xsai/telemetry exports everything from xsai, so you can use it for overrides.

Currently, telemetry only supports generateText and streamText.

Simply switch the import.

- import { generateText, streamText } from 'xsai'
+ import { generateText, streamText } from '@xsai-ext/telemetry'

You can also configure additional telemetry options:

import {  } from '@xsai-ext/telemetry'
import {  } from 'node:process'

const  = 'You\'re a helpful assistant.'

const {  } = await ({
  : .!,
  : 'https://api.openai.com/v1/',
  : [
    {
      : , 
      : 'system'
    },
    {
      : 'Why is the sky blue?',
      : 'user'
    }
  ],
  : 'gpt-4o',
  : { 
    : { 
      'gen_ai.agent.name': 'weather-assistant', 
      'gen_ai.agent.description': , 
    }, 
  }, 
})

xsAI Telemetry is based on GenAI Attributes.

On this page