xsAI v0.1 is now available! Read Announcement
xsAI0.2.0-beta.1

xsfetch

extra-small Fetch API with auto retry.

install sizeminified sizeminzipped size
npm i xsfetch

Usage

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',
})
Edit on GitHub

Last updated on

On this page