SkillAgentSearch skills...

Ai21

This is an AI21 Studio npm package to support javascript and typescript developers in building scalable & efficient applications powered by AI21's state of the art language models

Install / Use

/learn @officialyenum/Ai21
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AI 21

<p align="center"><a href="https://studio.ai21.com/overview" target="_blank"><img src="https://lh3.googleusercontent.com/NIxR42H8Dw-Eduv8vQMxmev5ZXskc7mzU1tqJHHiVxFPGGxp2z-olNA8PtNzD8wJscI5j6n4xLz3cqaTeWWLotKwRyGIsTXJa2zYU3XwvDc85_mHaA" width="400"></a></p> <div align="center"> This is an AI21 Studio npm package to support javascript and typescript developers in building scalable & efficient applications powered by AI21's state of the art language models that can process any language comprehension or generation task. No NLP expertise needed.
> Fully documented for TS and JS
</div> <div align="center">

npm version Test Status Gitpod Ready-to-Code npm downloads Known Vulnerabilities Downloads last commit codecov GitHub Quality license MIT Size

</div>

Table of Contents

Technologies

  • Node JS - Node.js® is an open-source, cross-platform JavaScript runtime environment.
  • AI21 LABS - AI21 Labs is an AI lab & product company whose mission is to re-imagine the way we read and write by making the machine a thought partner to humans.

Requirements

Getting Started

  • Please click here to register on AI21 Studio if you do not already have an account
  • Click on your profile image and Go To your account details to get your api key
<p align="center"><a href="https://studio.ai21.com/overview" target="_blank"><img src="https://res.cloudinary.com/yenum-dev/image/upload/v1677065723/chuckymagic/ai21-get-key-image_hmxmse.png" width="400"></a></p>

📦 Installation

  • Using npm
    npm i @officialyenum/ai21 axios
    
  • Using Yarn
    yarn add @officialyenum/ai21 axios
    
  • Using pnpm
    pnpm add @officialyenum/ai21 axios
    
  • Using unpkg
      <script src="https://unpkg.com/browse/axios@1.3.4/"></script>
      <script src="https://unpkg.com/browse/@officialyenum/ai21@@1.2.0/lib/cjs/index.min.js"></script>
    
    
  • Using cdn jsdelivr
      <script src="https://cdn.jsdelivr.net/npm/axios@1.3.4/dist/axios.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/@officialyenum/ai21@@1.2.0/lib/cjs/index.min.js"></script>
    
    

⚙️ Usage

How to import

  1. ES Modules
     // Javascript Sample
     import { AI21 } from "@officialyenum/ai21";
    
     // Typescript Sample
     import { AI21 } from "@officialyenum/ai21";
    
  2. Common JS
     // Javascript Sample
     const { AI21 } = require("@officialyenum/ai21");
    

How to construct

  • Ways to construct
  1. Initialize

    // Javascript Sample
    const token = "pDsubXXXXXXXXXXXXXXXXXXXXXXYSg8y"; // pass your AI21 Labs AI Token Here
    const ai = new AI21(token);
    
    // Typescript Sample
    const token = process.env.AI21_TOKEN  as string; // pass your AI21 Labs AI Token Here
    const ai = new AI21(token);
    
  2. Summarize

    // Javascript Sample
     const data = {
         text: "Olives, wheat and grapes have been the staple foods of the Mediterranean world, with seafood, above meat, as the preferred protein source. Fish and shellfish were used often since ancient times by wealthy classes as a kind of social marker, not only as a gastronomic delight, but also as a way to stay healthier. This paper reviews thoroughly how seafood has been present in the dietary practices of the Mediterranean people since ancient Egyptians up to the gastronomic discourse of some celebrated contemporary chefs. Preferences for particular tastes and flavors, local traditions, myths and religious rites (such Lent, Shabbat and Ramadan that prohibited eating some foods and allowed others) as well as cultural exchanges between countries and civilizations (with the incorporation of new ingredients and culinary techniques), have shaped the Mediterranean culinary customs along the history. Such traditions are reflected in many ancient writings, culinary literature and cookbooks. We will analyze some of these sources with special attention to those excerpts, anecdotes, cookbooks, recipes, cooks and even characters related to seafood. Knowledge and learning from our rich Mediterranean culinary heritage are important aspects to bear in mind. Whereas some contemporary celebrity chefs (and probably many diners) are not fully aware of such culinary legacy, others like Ferran Adri`a have recently recognized the importance of studying the past as a driver for creation and gastronomic innovation.",
         type: "wikipedia_article", // financial_report, academic_paper
     }
     const resp = await ai.summarize(data);
     console.log(resp);
     // status : success | failed
     // message : "Summaries Retrieved Successfully" | error message
     // data : {
     //  summaries : [
     //      {text : "Olives, wheat and grapes have been the staple foods of the Mediterranean world, with seafood as the preferred protein source.\nThis paper reviews how seafood has been present in the dietary practices of the Mediterranean people since ancient Egyptians up to the gastronomic discourse of some celebrated contemporary chefs.\nSome contemporary celebrity chefs are not fully aware of the rich Mediterranean culinary heritage."}
     //  ]
     // }
     //
    
     // Typescript Sample
     const data:ISummaryBody = {
         text: "Olives, wheat and grapes have been the staple foods of the Mediterranean world, with seafood, above meat, as the preferred protein source. Fish and shellfish were used often since ancient times by wealthy classes as a kind of social marker, not only as a gastronomic delight, but also as a way to stay healthier. This paper reviews thoroughly how seafood has been present in the dietary practices of the Mediterranean people since ancient Egyptians up to the gastronomic discourse of some celebrated contemporary chefs. Preferences for particular tastes and flavors, local traditions, myths and religious rites (such Lent, Shabbat and Ramadan that prohibited eating some foods and allowed others) as well as cultural exchanges between countries and civilizations (with the incorporation of new ingredients and culinary techniques), have shaped the Mediterranean culinary customs along the history. Such traditions are reflected in many ancient writings, culinary literature and cookbooks. We will analyze some of these sources with special attention to those excerpts, anecdotes, cookbooks, recipes, cooks and even characters related to seafood. Knowledge and learning from our rich Mediterranean culinary heritage are important aspects to bear in mind. Whereas some contemporary celebrity chefs (and probably many diners) are not fully aware of such culinary legacy, others like Ferran Adri`a have recently recognized the importance of studying the past as a driver for creation and gastronomic innovation.",
         type: "wikipedia_article", // financial_report, academic_paper
     }
     const resp:AIResponse | undefined = await ai.summarize(data);
     console.log(resp);
     // status : success | failed
     // message : "Summaries Retrieved Successfully" | error message
     // data : {
     //  summaries : [
     //      {text : "Olives, wheat and grapes have been the staple foods of the Mediterranean world, with seafood as the preferred protein source.\nThis paper reviews how seafood has been present in the dietary practices of the Mediterranean people since ancient Egyptians up to the gastronomic discourse of some celebrated contemporary chefs.\nSome contemporary celebrity chefs are not fully aware of the rich Mediterranean culinary heritage."}
     //  ]
     // }
     //
    
  3. S

Related Skills

View on GitHub
GitHub Stars17
CategoryCustomer
Updated2y ago
Forks1

Languages

JavaScript

Security Score

75/100

Audited on Mar 29, 2024

No findings