npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@botly-ai/sdk

v1.0.4

Published

A TypeScript SDK for building AI agents with tool calling, multiple providers, and structured callbacks.

Readme

@botly-ai/sdk

🔗 Site oficial: https://botly.com.br

SDK TypeScript para criar assistentes de IA com ferramentas (tools) de forma simples, tipada e extensível — ideal para backends Node.js e aplicações NestJS.

O @botly-ai/sdk abstrai a comunicação com provedores de LLM (ex: OpenAI) e facilita:

  • Gerenciamento de mensagens
  • Execução de tools com callbacks
  • Tipagem forte em TypeScript
  • Fluxos com segunda resposta automática do modelo

Instalação

pnpm add @botly-ai/sdk
# ou
npm install @botly-ai/sdk
# ou
yarn add @botly-ai/sdk

Uso básico (Node.js / TypeScript)

Exemplo de uso simples em um arquivo TypeScript, sem dependência de frameworks.

import { Botly } from "@botly-ai/sdk";

const messages: { role: 'user' | 'assistant'; content: string }[] = [];

async function run() {
    const client = new Botly({
        apiKey: process.env.OPENAI_API_KEY ?? '',
        provider: 'openai',
        model: 'gpt-4o-mini',
        temperature: 0.7,
        systemPrompt: 'You are a helpful assistant that can answer questions and help with tasks.',
    });

    messages.push({ role: 'user', content: 'How many users do we have?' });

    const response = await client.response({
        input: [...messages],
        secondResponseCallback: true,
        tools: [
            {
                name: 'get_user_count',
                description: 'Get the number of users in the database',
                fields: [
                    {
                        name: 'user_type',
                        type: 'string',
                        description: 'The type of user to get the count of',
                    },
                ],
                async callback({ user_type }: { user_type: string }) {
                    console.log('User type:', user_type);

                    return {
                        count: 1000,
                    };
                },
            },
            {
                name: 'create_new_user',
                description: 'Create a new user in the database',
                fields: [
                    { name: 'name', type: 'string' },
                    { name: 'email', type: 'string' },
                    { name: 'phone', type: 'string' },
                ],
                async callback({ name, email, phone }: { name: string; email: string; phone: string }) {
                    console.log(name, email, phone);

                    return {
                        message: 'User created successfully',
                    };
                },
            },
        ],
    });

    messages.push({ role: 'assistant', content: response.output_text ?? '' });

    console.log(response.output_text);
}

run();

Conceitos principais

Botly Client

const client = new Botly({
  apiKey: process.env.OPENAI_API_KEY!,
  provider: 'openai',
  model: 'gpt-4o-mini',
  temperature: 0.7,
  systemPrompt: 'You are a helpful assistant',
});

Opções principais:

  • apiKey: chave do provedor
  • provider: provedor de LLM (openai, etc.)
  • model: modelo utilizado
  • temperature: nível de criatividade
  • systemPrompt: prompt base do agente

Messages (input)

O histórico de mensagens segue o padrão:

{
  name: 'get_user_count',
  description: 'Get the number of users stored in the system',
  fields: [
    {
      name: 'user_type',
      type: 'string',
      description: 'The type of user to get the count of (e.g. admin, customer, guest)',
    }
  ],
  async callback(args) {
    // args is already a parsed JSON object
    // matching the schema defined in `fields`
    const { user_type } = args;

    return { count: 1000 };
  }
}

Você controla totalmente o estado da conversa.


Tools (Function Calling)

Cada tool possui:

  • name
  • description
  • fields (schema de entrada)
  • callback assíncrono
{
  name: 'get_user_count',
  fields: [
    { name: 'user_type', type: 'string' }
  ],
  async callback(args) {
    return { count: 1000 };
  }
}

O modelo decide quando chamar a tool, e o @botly-ai/sdk executa o callback automaticamente.


secondResponseCallback

secondResponseCallback: true

Quando ativado:

  1. O modelo chama a tool
  2. O callback é executado
  3. O resultado volta para o modelo
  4. O modelo gera uma segunda resposta final

Ideal para fluxos naturais e conversacionais.


Retorno

const response = await client.response(...);

response.output_text;

Você também pode acessar o objeto completo (Output) se precisar de mais controle.


Requisitos

  • Node.js >= 18
  • TypeScript recomendado

Licença

MIT