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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tinyai.id

v1.0.3

Published

TinyAI.ID

Downloads

3

Readme

TinyAI Developer Documentation

getting-started

Overview

TinyAI is a platform to create unique TinyAI.IDs which can have various functionalities like creating, modifying, subscribing, and more. This documentation aims to describe the API endpoints you can use to interact with the TinyAI system.

API Endpoints

The API base URL is https://plugin.tinyai.id.

1. Create/Modify a TinyAI (Upsert)

Endpoint:

POST /upsert

Headers:

  • accept: application/json
  • Content-Type: application/json

Request Body:

{
  "name": "string",
  "systemPrompt": "string",
  "systemKnowledge": "string",
  "data": "string",
  "key": "string"  // Optional
}

Response:

{
  "response": "tiny updated.",
  "paymentLink": "https://buy.stripe.com/7sI3eU4RNdPs9BCaUk"
}

cURL

curl -X 'POST' \
  'https://plugin.tinyai.id/upsert' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "systemPrompt": "string",
  "systemKnowledge": "string",
  "data": "string",
  "key": "string"
}'

# Key is optional

2. Get Information of a TinyAI

Endpoint:

GET /get?name=string

Headers:

  • accept: application/json

Response:

{
  "response": "string",
  "name": "string",
  "data": "string",
  "systemPrompt": "string",
  "systemKnowledge": "string",
  "isAuthorized": false,
  "active": false,
  "paymentLink": "https://buy.stripe.com/7sI3eU4RNdPs9BCaUk",
  "posts": [],
  "applauses": []
}

3. Subscribe to a TinyAI

Endpoint:

POST /subscribe

Headers:

  • accept: application/json
  • Content-Type: application/json

Request Body:

{
  "name": "string",
  "email": "string"
}

Embedding TinyAI

You can embed a TinyAI into your web page using an iframe:

<iframe src='https://tinyai.id/string'></iframe>

Example using Next.js + Vercel AI + OpenAI Functions

You can find an example of how to integrate TinyAI with Next.js and OpenAI here.

Function Definitions for OpenAI Functions

  • create_ai: To create a new AI entity.
  • modify_ai: To modify an existing tiny AI.
  • contact_me_or_order: To contact the tiny AI owner, subject and message required.

Example Function Calls

Here is a TypeScript example demonstrating how you might call these functions:

const response = await openai.createChatCompletion({
  model: 'gpt-3.5-turbo-0613',
  // Additional params and functions here
  functions: [
    {
      "name": "create_ai",
      // Parameters and descriptions here
    },
    {
      "name": "modify_ai",
      // Parameters and descriptions here
    },
    {
      "name": "contact_me_or_order",
      // Parameters and descriptions here
    },
  ]
});

Example Fetch Requests in JavaScript

1. Create/Modify a TinyAI (Upsert)

const upsertData = {
  name: 'exampleName',
  systemPrompt: 'examplePrompt',
  systemKnowledge: 'exampleKnowledge',
  data: 'exampleData',
  key: 'optionalKey'
};

fetch('https://plugin.tinyai.id/upsert', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(upsertData)
})
.then(response => response.json())
.then(data => {
  console.log('Upsert Response:', data);
})
.catch(error => {
  console.error('Error:', error);
});

2. Get Information of a TinyAI

const tinyName = 'exampleName';

fetch(`https://plugin.tinyai.id/get?name=${tinyName}`, {
  method: 'GET',
  headers: {
    'accept': 'application/json'
  }
})
.then(response => response.json())
.then(data => {
  console.log('Get Information Response:', data);
})
.catch(error => {
  console.error('Error:', error);
});

3. Subscribe to a TinyAI

const subscribeData = {
  name: 'exampleName',
  email: 'exampleEmail'
};

fetch('https://plugin.tinyai.id/subscribe', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(subscribeData)
})
.then(response => response.json())
.then(data => {
  console.log('Subscribe Response:', data);
})
.catch(error => {
  console.error('Error:', error);
});

4. Send Notification from a TinyAI

curl -X 'POST' \
  'https://plugin.t4y.ai/notification' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "string",
  "message": "string",
  "key": "string"
}'

5. Send applause to a TinyAI Owner

curl -X 'POST' \
  'https://plugin.tinyai.id/applause' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "message": "string"
}'

Additional Notes

The key is optional when creating or modifying a TinyAI. If provided, it offers an extra layer of security.

Support

For any further questions or issues, please contact our support at [email protected].