xsfetch
extra-small Fetch API with auto retry.
npm i xsfetchUsage
createFetch
import { } from 'xsfetch'
const = ({
: 3,
: 1000,
})createFetch with generateText
import { } from '@xsai/generate-text'
import { } from 'node:process'
import { } from 'xsfetch'
const = ({
: 3,
: 1000,
})
const { } = await ({
: .!,
: 'https://api.openai.com/v1/',
,
: [
{
: 'You\'re a helpful assistant.',
: 'system'
},
{
: 'Why is the sky blue?',
: 'user'
}
],
: 'gpt-4o',
})