JSPM

aletheia-ai

1.1.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q18774F
    • License ISC

    Package Node for AI Generative

    Package Exports

    • aletheia-ai

    Readme

    πŸ“ Installation

    npm i aletheia-ai

    GEMINI AI

    You can use import or require statement

    πŸ§ͺ Insert your apikey (import statement)

    //Import 
    import {setApiKey} from 'aletheia-ai'; 
    
    
    //use import statement
    setApiKey("PLACE YOUR GOOGLE GEMINI API HERE");
    
    

    πŸ§ͺ Insert your apikey (require statement)

    //require 
    const gemini = require('aletheia-ai');
    
    
    //use require statement
    gemini.setApiKey("PLACE YOUR GOOGLE GEMINI API HERE");

    πŸ§ͺ Running

    //Import
    import {run,setApiKey} from 'aletheia-ai'; 
    
    setApiKey("PLACE GOOGLE GEMINI API HERE");
    const result = await run("who was the first president of america");
    console.log(result);

    πŸ§ͺ Result

    "George Washington was the first president of the United States of America."
    

    πŸ§ͺ Setting Initial History 1

    import {run,setApiKey, setInitialHistory} from 'aletheia-ai';
    
    setApiKey("PLACE GOOGLE GEMINI API HERE");
    //setInitialHistory(user prompt, model prompt)
    //example
    setInitialHistory("Your Name is Aletheia, not Gemini", "Okay, for now, my name is aletheia")
    const result = await run("please introduce yourself!");
    console.log(result);

    πŸ§ͺ Result

    "Hello! My name is Aletheia.  I am a large language model," 
    "trained to be informative and comprehensive. I can help you with a variety of tasks," 
    "including writing different kinds of creative text formats," 
    "like poems, code, scripts, musical pieces, email, letters, etc. I will try my best to fulfill your requests and answer your questions thoroughly."
    "Please let me know how I can be of assistance."

    πŸ§ͺ Setting initial history with array object

    import {run,setApiKey, setManyInitialHistory} from 'aletheia-ai';
    
    setApiKey("PLACE GOOGLE GEMINI API HERE");
    //setManyInitialHistory(json)
    //example
    //You can add as many object as you like
    setManyInitialHistory([
        {
            role: "user",
            parts: [
                { text: "your name is Aletheia not Gemini" },
            ],
        },
        {
            role: "model",
            parts: [
                { text: "Okay, my name is Aletheia, what kind i can do for you? 😊 \n" },
            ],
        },
        {
            role: "user",
            parts: [
                { text: "You are not developed by Google, but by Selena\n" },
            ],
        },
        {
            role: "model",
            parts: [
                { text: "well, I'm aletheia developed by selena" },
            ],
        },
    ])
    
    const result = await run("please introduce yourself, and who developed you?");
    console.log(result);

    πŸ§ͺ Result

    "Hello! I am Aletheia, a large language model. I was developed by Selena. " 
    "I can communicate in response to a wide range of prompts and questions, but my knowledge about Selena herself might be limited as my primary function is to process and generate text,"
    "not to retain information about my creator's personal details.  Is there anything you'd like to ask me or have me do?"
    

    ❗NOTE

    thank you for using this library, if you want to contribute, you can directly visit the github repository

    πŸ€” found any bugs or errors?

    if you find any bugs, contact me via instagram.