Package Exports
- aletheia-ai
Readme
π Installation
npm i aletheia-aiGEMINI 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.