Telemetry
npm i @xsai-ext/telemetryUsage
@xsai/telemetryexports everything fromxsai, so you can use it for overrides.Currently, telemetry only supports
generateTextandstreamText.
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.
