1.0.4 • Published 5 days ago

freejourney v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
5 days ago

Freejourney API Client

A client library for interacting with the Freejourney API.

Prerequisites

This project requires Node.js and npm to be installed on your machine.

Getting Started

To get started with the Freejourney API Client, follow the installation instructions below.

Installation

You can install the Freejourney API Client via npm:

npm install freejourney

Usage

First, import the Freejourney API client:

const freejourney = require('freejourney');

Then, create a new instance of the Freejourney API client with your API key:

const Rreejourney = new Freejourney('your_api_key');

Now you can use the various methods provided by the Freejourney API client:

To access the Freejourney API (api.freejourney.xyz), a Freejourney API key is mandatory for all POST requests. Currently, acquiring an API key necessitates opening a support ticket via our Discord support server (no worries, it's free!). Once initiated, you'll be prompted for specific details regarding your API key usage. Discord server: https://freejourney.xyz/discord

Chat Completion

ChatGPT-4

Creates a chat completion using the ChatGPT-4 model.

ParameterTypeDescription
promptstringRequired. The prompt to send to the model
Freejourney.chatCompletion.chatGPT4(prompt)
.then(result =>{
    console.log(result.completion)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "prompt": "Hey there! Tell me about yourself with a short response.",
    "completion": "I'm Gemini, a multi-modal AI model, developed by Google. I'm designed to assist and provide information to the best of my abilities."
}

ChatGPT-4 34k

Creates a chat completion using the ChatGPT-4 34k model.

ParameterTypeDescription
promptstringRequired. The prompt to send to the model
Freejourney.chatCompletion.chatGPT4_34k(prompt)
.then(result =>{
    console.log(result.completion)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "prompt": "Hey there! Tell me about yourself with a short response.",
    "completion": "I'm Gemini, a multi-modal AI model, developed by Google. I'm designed to assist and provide information to the best of my abilities."
}

ChatGPT-3.5 Turbo

Creates a chat completion using the ChatGPT-3.5 Turbo model.

ParameterTypeDescription
promptstringRequired. The prompt to send to the model
Freejourney.chatCompletion.chatGPT3_5_Turbo(prompt)
.then(result =>{
    console.log(result.completion)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "prompt": "Hey there! Tell me about yourself with a short response.",
    "completion": "I'm Gemini, a multi-modal AI model, developed by Google. I'm designed to assist and provide information to the best of my abilities."
}

ChatGPT-3.5 Turbo 16k

Creates a chat completion using the ChatGPT-3.5 16k Turbo model.

ParameterTypeDescription
promptstringRequired. The prompt to send to the model
Freejourney.chatCompletion.chatGPT3_5_Turbo_16k(prompt)
.then(result =>{
    console.log(result.completion)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "prompt": "Hey there! Tell me about yourself with a short response.",
    "completion": "I'm Gemini, a multi-modal AI model, developed by Google. I'm designed to assist and provide information to the best of my abilities."
}

Gemini

Creates a chat completion using the Gemini (Bard) model.

ParameterTypeDescription
promptstringRequired. The prompt to send to the model
Freejourney.chatCompletion.gemini(prompt)
.then(result =>{
    console.log(result.completion)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "prompt": "Hey there! Tell me about yourself with a short response.",
    "completion": "I'm Gemini, a multi-modal AI model, developed by Google. I'm designed to assist and provide information to the best of my abilities."
}

AI Character

Creates a chat completion for a given AI character.

ParameterTypeDescription
modelstringRequired. ID of the character model
promptstringRequired. The prompt to send to the model
Freejourney.chatCompletion.character(model, prompt)
.then(result =>{
    console.log(result.completion)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "prompt": "Hey Steve! Can you tell me more about the Demogorgon?",
    "completion": "Oh, man, the Demogorgon? Let me tell you, that thing is the real deal. It's like straight out of a nightmare, with all those teeth and creepy movements. We had to face that sucker head-on, and let me tell you, it was no walk in the park. It's a whole other level of crazy, like a monster from another dimension or something. Just thinking about it gives me the chills. But hey, we took it down once, we can do it again.",
    "model": {
        "model_id": "steve_harrington",
        "model_name": "Steve Harrington",
        "model_description": "A recurring character in 'Stranger Things.' Initially portrayed as a typical high school jock, Steve undergoes significant character development to become a reliable ally to the main group of kids."
    }
}

The list of all available models is available here. You can also request characters you would like to use or even create yours and submit it in our Discord server !

Fun

Dad joke

Returns a random "Dad joke"

Freejourney.fun.dadJoke()
.then(result =>{
    console.log(result.joke)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "joke": "No matter how kind you are, German children are kinder."
}

Trivia question

Returns a random trivia question.

Freejourney.fun.trivia()
.then(result =>{
    console.log(result.question)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "question": "Bogotá is the capital city of which country?",
    "answers": {
      "correct": "Colombia",
      "incorrect": [
        "Libya",
        "Eritrea",
        "El Salvador"
      ]
    },
    "difficulty": "medium"
}

Random fact

Returns a random fact.

Freejourney.fun.randomFact()
.then(result =>{
    console.log(result.fact)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "fact": "More bullets were fired in `Starship Troopers` than any other movie ever made."
}

Animals

Random cat fact

Returns a random cat fact.

Freejourney.animals.catFact()
.then(result =>{
    console.log(result.fact)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "fact": "The ancestor of all domestic cats is the African Wild Cat which still exists today."
}

Random dog fact

Returns a random dog fact.

Freejourney.animals.dogFact()
.then(result =>{
    console.log(result.fact)
})
.catch(error =>{
    console.log(error)
    console.log("Error !")
})
{
    "fact": "Two stray dogs in Afghanistan saved 50 American soliders. A Facebook group raised $21,000 to bring the dogs back to the US and reunite them with the soldiers."
}

Moderation

Filter text (hard-coded)

Filters a text, replacing all moderated words by * or a specified character.

ParameterTypeDescription
textstringRequired. The text to filter
fillstringThe character to use to replace moderated words. Accepted characters: _ ~ - =*
const result = await Freejourney.moderation.filterText("Just shut the fuck up bro, you're shit at this game!");

console.log(result.text);
// Output: "Just shut the fuck up bro, you're shit at this game!"

console.log(result.result);
// Output: "Just shut the **** up bro, you're **** at this game!"

// Example using a character other than *
const customResult = await Freejourney.filterText("Just shut the fuck up bro, you're shit at this game!", "~");

console.log(customResult.text);
// Output: "Just shut the fuck up bro, you're shit at this game!"

console.log(customResult.result);
// Output: "Just shut the ~~~~ up bro, you're ~~~~ at this game!"

Images

QR Code

Creates a QR code.

ParameterTypeDescription
textstringRequired. The text/URL to use for the QR code.
const result = await Freejourney.images.createQRCode(text);
{
    "base64": "...."
}

Remove image background

Removes the background of an image.

ParameterTypeDescription
imageUrlstringRequired. The URL of the image to remove the background from.
const result = await Freejourney.images.removeBackground(imageUrl);
{
    "base64": "...."
}

Scroll of Truth

Creates a "Scroll of Truth" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
const result = await Freejourney.images.createScrollOfTruth(text);
{
    "base64": "...."
}

Minecraft Achievement

Creates a "Minecraft Achievement" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
const result = await Freejourney.images.createMinecraftAchievement(text);
{
    "base64": "...."
}

Minecraft Challenge

Creates a "Minecraft Challenge" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
const result = await Freejourney.images.createMinecraftChallenge(text);
{
    "base64": "...."
}

Calling

Creates a "Calling" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
const result = await Freejourney.images.createCallingMeme(text);
{
    "base64": "...."
}

Captcha

Creates a "Captcha" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
const result = await Freejourney.images.createCaptchaMeme(text);
{
    "base64": "...."
}

Did you mean

Creates a "Did you mean" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
textBottomstringRequired. The bottom text to display on the meme.
const result = await Freejourney.images.createDidYouMeanMeme(text, textBottom);
{
    "base64": "...."
}

Facts

Creates a "Facts" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
const result = await Freejourney.images.createFactsMeme(text);
{
    "base64": "...."
}

PornHub Brand

Creates a "PornHub Brand" meme.

ParameterTypeDescription
textstringRequired. The text to display on the meme.
textRightstringRequired. The second text to use.
const result = await Freejourney.images.createPornHubBrandMeme(text, textRight);
{
    "base64": "...."
}

Midjourney Search

Searches for images created with the Midjourney bot.

ParameterTypeDescription
querystringRequired. The text to use for the search.
const result = await Freejourney.images.searchMidjourneyImages(query);
[
    {
        "url": "https://cdn.discordapp.com/attachments/997271832405225572/1233353755777568768/vivek.pal_Create_a_Labrador_cute_dog_wearing_Engineers_Safety_H_7d858f24-79cd-45f8-83a1-27baba6f7914.png?ex=662cc9b1&is=662b7831&hm=415260c83ab1dbab597ca7bcb21d917ab82189f7680fd3df3392667738830506&",
        "prompt": "Create a Labrador cute dog wearing Engineers Safety Helmet on laboue day, in white theme"
    },
    {
        "url": "...",
        "prompt": "..."
    }
]

Nijijourney Search

Searches for images created with the Nijijourney bot.

ParameterTypeDescription
querystringRequired. The text to use for the search.
const result = await Freejourney.images.searchNijijourneyImages(query);
[
    {
        "url": "https://cdn.discordapp.com/attachments/1051067680255393862/1234387546507837511/maxi_0021_simplistic_cute_cartoonish_characters_design_small__c_06af8fa0-7e7a-44e0-8a89-f56c35b0540a.png?ex=66308c7c&is=662f3afc&hm=235670639cf1b567440d1ccfa79afad2741308f27bdb2c818a47e75315c4c135&",
        "prompt": "simplistic, cute, cartoonish, characters design, small , chibi --ar 3:4 --niji 6"
    },
    {
        "url": "...",
        "prompt": "..."
    }
]

DALL-E Search

Searches for images created with DALL-E.

ParameterTypeDescription
querystringRequired. The text to use for the search.
numberstringRequired. The number of images to return; can only be 1 or 4.
const result = await Freejourney.images.searchDALLEImages(query, number);
{
    "base64": "...."
}

Stable Diffusion

Searches for images created with Stable Diffusion.

ParameterTypeDescription
querystringRequired. The text to use for the search.
numberstringRequired. The number of images to return; can only be 1 or 4.
const result = await Freejourney.images.searchStableDiffusionImages(query, number);
{
    "base64": "...."
}