User: 
Analise o seguinte conteúdo web em detalhes:
URL: https://www.npmjs.com/package/g4f
Título: g4f - npmGitDownloads
Descrição: GPT4 for free, No API key, no auth required.. Latest version: 1.4.6, last published: a year ago. Start using g4f in your project by running `npm i g4f`. There are 9 other projects in the npm registry using g4f.

Por favor forneça:
1. Um resumo do conteúdo da página
2. Tópicos principais discutidos
3. Entidades mencionadas (pessoas, organizações, locais)
4. Insights de OSINT relevantes neste conteúdo
5. Possíveis fontes adicionais de informação baseadas neste conteúdo
6. Recomendações para investigações adicionais

Conteúdo da página:
G4F
GPT4FREE is a package that simplifies interaction with various Artificial Intelligence models, eliminating the need for an API Key or any other authorization method to access these chat completions and image generation models.
This package can be used in both Typescript and CommonJS/ModuleJS environments.
📚 Table of Contents


🛠️ Installation

Using NPM
Using yarn



🎯 Examples


📤 Chat completion


⚙️ Basic usage

Simple fetch
Give your instructions
Follow up on the conversation context


✏️ RESUME: Conversation roles

🔩 Add configurable options

Basic Options
Advanced Options
What's the difference?



📝 Streaming

Basic usage
How to handle streamable data?
Stream on postprocessing


✏️ RESUME: Configurable options
🚀 Chat completion providers
📚 Chat completion models



📡 Translation

Usage
Options
Languages supported



📷 Image Generation (BETA)

Cartoon style example
Paint style example
Realistic style example
✏️ RESUME: Image generation options
✏️ RESUME: Image generation provider options
🤖 Image generation models
🎨 Image generation styles
✒️ Image generation sampling methods
🧮 Number type options
🖼️ Image generation providers
⚠️ Advice






🤝 Contribute


🛠️ Installation

Using npm:
npm install g4f

Using yarn:
yarn add g4f


🎯 Examples

📤 Chat completion
With the chatCompletion function, you will be able to obtain a textual response to a conversation with some context, using providers and models designed for this task. In addition, you will be able to manipulate the answer before converting it to a stream or force the AI to give you a certain answer by generating several retries.

⚙️ Basic usage

Simple fetch
It will capture the messages and the context, and any provider will respond with a string.
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "user", content: "Hi, what's up?"}
];
g4f.chatCompletion(messages).then(console.log);
// Hello! I'm here to help you with anything you need. What can I do for you today? 😊
Note: The conversation needs to include at least one message with the role user to provide a proper answer.

Give your instructions
You can provide your own instructions for the conversation before it starts using the system role.
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "system", content: "You're an expert bot in poetry."},
    { role: "user", content: "Hi, write me something."}
];
g4f.chatCompletion(messages).then(console.log);
/*
Sure, I can write you a poem. Here is a short one: 
The Wind:
The wind is a curious thing,
It can make you dance and sing,
It can make you feel alive,
And help you thrive.
...
*/

Follow up on the conversation context
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "system", content: "You're a math teacher."},
    { role: "user", content: "How much is 2 plus 2?" },
    { role: "assistant", content: "2 plus 2 equals 4." },
    { role: "user", content: "You're really good at math!" },
    { role: "assistant", content: "Thank you! I'm glad I could help you with your math question." },
    { role: "user", content: "What was the first question I asked you?" }
];

g4f.chatCompletion(messages).then(console.log);
// The first question you asked me was "How much is 2 plus 2?".
Note: AI responses use the assistant role and an appropriate conversation structure alternates between the user and the assistant, as seen in the previous example.

✏️ RESUME: Conversation roles



Role
Description




system
Used for providing instructions and context prior to the conversation.


user
Used to identify user messages


assistant
Used to identify AI messages




🔩 Add configurable options

Basic options
You can select any provider, model, debug mode and a proxy URL if you want.
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "user", content: "Hi, what's up?"}
];
const options = {
    provider: g4f.providers.GPT,
    model: "gpt-3.5-turbo",
    debug: true,
    proxy: ""
};

(async() => {
	const text = await g4f.chatCompletion(messages, options);	
	console.log(text);
})();
/*
[provider] » √  success   Provider found: GPT
[model] » √  success   Using the model: gpt-3.5-turbo
[provider] » √  success   Data was successfully fetched from the GPT provider

In the realm of words, where verses dance and rhyme,
I shall craft a poem, a moment frozen in time.
With ink as my brush, I paint a vivid scene,
Where dreams and emotions intertwine, serene.
Through lines and stanzas, I'll weave a tale,
Of love, of loss, of hope that will never fail.
So close your eyes, and let your heart unfurl,
As I conjure a poem, a gift for your soul to swirl. 💕🌹
*/
Note: You can specify the provider, model, debug, and proxy options according to your needs; they are entirely optional.

Advanced options
You can force an expected response using retry, and manipulate the final response using output.
const { G4F } = require("g4f");
const g... [conteúdo truncado]

User: 
Analise o seguinte conteúdo web em detalhes:
URL: https://www.npmjs.com/package/g4f
Título: g4f - npmGitDownloads
Descrição: GPT4 for free, No API key, no auth required.. Latest version: 1.4.6, last published: a year ago. Start using g4f in your project by running `npm i g4f`. There are 9 other projects in the npm registry using g4f.

Por favor forneça:
1. Um resumo do conteúdo da página
2. Tópicos principais discutidos
3. Entidades mencionadas (pessoas, organizações, locais)
4. Insights de OSINT relevantes neste conteúdo
5. Possíveis fontes adicionais de informação baseadas neste conteúdo
6. Recomendações para investigações adicionais

Conteúdo da página:
G4F
GPT4FREE is a package that simplifies interaction with various Artificial Intelligence models, eliminating the need for an API Key or any other authorization method to access these chat completions and image generation models.
This package can be used in both Typescript and CommonJS/ModuleJS environments.
📚 Table of Contents


🛠️ Installation

Using NPM
Using yarn



🎯 Examples


📤 Chat completion


⚙️ Basic usage

Simple fetch
Give your instructions
Follow up on the conversation context


✏️ RESUME: Conversation roles

🔩 Add configurable options

Basic Options
Advanced Options
What's the difference?



📝 Streaming

Basic usage
How to handle streamable data?
Stream on postprocessing


✏️ RESUME: Configurable options
🚀 Chat completion providers
📚 Chat completion models



📡 Translation

Usage
Options
Languages supported



📷 Image Generation (BETA)

Cartoon style example
Paint style example
Realistic style example
✏️ RESUME: Image generation options
✏️ RESUME: Image generation provider options
🤖 Image generation models
🎨 Image generation styles
✒️ Image generation sampling methods
🧮 Number type options
🖼️ Image generation providers
⚠️ Advice






🤝 Contribute


🛠️ Installation

Using npm:
npm install g4f

Using yarn:
yarn add g4f


🎯 Examples

📤 Chat completion
With the chatCompletion function, you will be able to obtain a textual response to a conversation with some context, using providers and models designed for this task. In addition, you will be able to manipulate the answer before converting it to a stream or force the AI to give you a certain answer by generating several retries.

⚙️ Basic usage

Simple fetch
It will capture the messages and the context, and any provider will respond with a string.
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "user", content: "Hi, what's up?"}
];
g4f.chatCompletion(messages).then(console.log);
// Hello! I'm here to help you with anything you need. What can I do for you today? 😊
Note: The conversation needs to include at least one message with the role user to provide a proper answer.

Give your instructions
You can provide your own instructions for the conversation before it starts using the system role.
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "system", content: "You're an expert bot in poetry."},
    { role: "user", content: "Hi, write me something."}
];
g4f.chatCompletion(messages).then(console.log);
/*
Sure, I can write you a poem. Here is a short one: 
The Wind:
The wind is a curious thing,
It can make you dance and sing,
It can make you feel alive,
And help you thrive.
...
*/

Follow up on the conversation context
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "system", content: "You're a math teacher."},
    { role: "user", content: "How much is 2 plus 2?" },
    { role: "assistant", content: "2 plus 2 equals 4." },
    { role: "user", content: "You're really good at math!" },
    { role: "assistant", content: "Thank you! I'm glad I could help you with your math question." },
    { role: "user", content: "What was the first question I asked you?" }
];

g4f.chatCompletion(messages).then(console.log);
// The first question you asked me was "How much is 2 plus 2?".
Note: AI responses use the assistant role and an appropriate conversation structure alternates between the user and the assistant, as seen in the previous example.

✏️ RESUME: Conversation roles



Role
Description




system
Used for providing instructions and context prior to the conversation.


user
Used to identify user messages


assistant
Used to identify AI messages




🔩 Add configurable options

Basic options
You can select any provider, model, debug mode and a proxy URL if you want.
const { G4F } = require("g4f");
const g4f = new G4F();
const messages = [
    { role: "user", content: "Hi, what's up?"}
];
const options = {
    provider: g4f.providers.GPT,
    model: "gpt-3.5-turbo",
    debug: true,
    proxy: ""
};

(async() => {
	const text = await g4f.chatCompletion(messages, options);	
	console.log(text);
})();
/*
[provider] » √  success   Provider found: GPT
[model] » √  success   Using the model: gpt-3.5-turbo
[provider] » √  success   Data was successfully fetched from the GPT provider

In the realm of words, where verses dance and rhyme,
I shall craft a poem, a moment frozen in time.
With ink as my brush, I paint a vivid scene,
Where dreams and emotions intertwine, serene.
Through lines and stanzas, I'll weave a tale,
Of love, of loss, of hope that will never fail.
So close your eyes, and let your heart unfurl,
As I conjure a poem, a gift for your soul to swirl. 💕🌹
*/
Note: You can specify the provider, model, debug, and proxy options according to your needs; they are entirely optional.

Advanced options
You can force an expected response using retry, and manipulate the final response using output.
const { G4F } = require("g4f");
const g... [conteúdo truncado]

Assistant: