gpti js
2.1.8
이 패키지는 다양한 GPT 모델과의 상호 작용을 단순화하여 GPT에 액세스하기 위해 토큰이나 기타 방법이 필요하지 않습니다. 또한 DALL·E, Prodia 등 세 가지 인공 지능을 사용하여 이미지를 생성할 수 있습니다. 일부는 프리미엄이고 다른 일부는 무료이며 모두 제한이나 제한이 없습니다.
NPM을 통해 패키지를 설치할 수 있습니다.
npm i gpti
Patreon을 통해 내 API 코드를 구매하면 모든 모델에 제한 없이 번거로움 없이 제한 없이 사용할 수 있습니다.
GPTI는 다양한 요구 사항을 충족하기 위해 다양한 인공 지능 모델에 대한 액세스를 제공합니다. 현재 사용 가능한 모델은 다음과 같습니다.
프리미엄 모델에 액세스하려면 자격 증명을 입력하세요. 여기를 클릭하면 얻을 수 있습니다.
// import { nexra } from "gpti";
// const { nexra } = require("gpti");
const { nexra } = require ( "gpti" ) ;
nexra ( "user-xxxxxxxx" , "nx-xxxxxxx-xxxxx-xxxxx" ) ;
// import { gpt } from "gpti";
const { gpt } = require ( "gpti" ) ;
let data = await gpt . v1 ( {
messages : [
{
role : "assistant" ,
content : "Hello! How are you today?"
} ,
{
role : "user" ,
content : "Hello, my name is Yandri."
} ,
{
role : "assistant" ,
content : "Hello, Yandri! How are you today?"
}
] ,
prompt : "Can you repeat my name?" ,
model : "GPT-4" ,
markdown : false
} ) ;
console . log ( data ) ;
경험을 향상하려면 API에서 사용 가능한 모델 중 하나를 선택하세요.
gpt-3.5-turbo를 사용하여 스트리밍을 통해 실시간 응답을 생성할 수 있다는 점만 빼면 매우 유사합니다.
// import { gpt } from "gpti";
const { gpt } = require ( "gpti" ) ;
let messages = [
{
"role" : "assistant" ,
"content" : "Hello! How are you today?"
} ,
{
"role" : "user" ,
"content" : "Hello, my name is Yandri."
} ,
{
"role" : "assistant" ,
"content" : "Hello, Yandri! How are you today?"
} ,
{
"role" : "user" ,
"content" : "Can you repeat my name?"
}
] ;
let data = await gpt . v2 ( {
messages : messages ,
markdown : false ,
stream : false
} ) ;
console . log ( data ) ;
/*
// Streaming
gpt.v2({
messages: messages,
stream: true,
markdown: false,
results: (err, data) => {
console.log(err, data);
}
});
*/
GPT-4는 제가 직접 향상시켰으나 기술적 복잡성으로 인해 오류가 발생할 수 있습니다. 온라인 쿼리의 정확성에 전적으로 의존할 때는 주의를 기울이는 것이 좋습니다.
// import { gpt } from "gpti";
const { gpt } = require ( "gpti" ) ;
let data = await gpt . web ( {
prompt : "Are you familiar with the movie Wonka released in 2023?" ,
markdown : false
} ) ;
console . log ( data ) ;
// import { gpt } from "gpti";
const { gpt } = require ( "gpti" ) ;
let history = [
{
"role" : "user" ,
"content" : "Hello! How are you? Could you tell me your name?"
}
] ;
let data = await gpt . v3 ( {
messages : history ,
markdown : false ,
stream : false
} ) ;
console . log ( data ) ;
/*
// Streaming
gpt.v3({
messages: history,
stream: true,
markdown: false,
results: (err, data) => {
console.log(err, data);
}
});
*/
// import { bing } from "gpti";
const { bing } = require ( "gpti" ) ;
let history = [
{
role : "assistant" ,
content : "Hello! How can I help you today? ?"
} ,
{
role : "user" ,
content : "Hi, tell me the names of the movies released in 2023."
} ,
{
role : "assistant" ,
content : "Certainly! Here are some movies that were released in 2023:nn1. **About My Father** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n2. **The Little Mermaid** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n3. **Fast X** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n4. **Spider-Man: Across the Spider-Verse** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n5. **The Machine** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n6. **Book Club: The Next Chapter** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n7. **Guardians of the Galaxy Vol. 3** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n8. **John Wick: Chapter 4** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n9. **Are You There God? It's Me, Margaret** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n10. **Evil Dead Rise** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n11. **The Super Mario Bros. Movie** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n12. **Love Again** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n13. **Kandahar** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n14. **Dungeons & Dragons: Honor Among Thieves** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n15. **Shin Kamen Rider** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n16. **Knights of the Zodiac** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n17. **The Pope's Exorcist** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n18. **Shazam! Fury of the Gods** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n19. **All That Breathes** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n20. **Sailor Moon Cosmos** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n21. **Hypnotic** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n22. **Sound of Freedom** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n23. **The Boogeyman** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n24. **Chicken Run: Dawn of the Nugget** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n25. **A Lot of Nothing** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n26. **Followers** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n27. **Big George Foreman** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n28. **Asterix & Obelix: The Middle Kingdom** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n29. **Ant-Man and the Wasp: Quantumania** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n30. **Transformers: Rise of the Beasts** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n31. **Follow Her** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n32. **Prom Pact** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n33. **God Is a Bullet** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n34. **Still: A Michael J. Fox Movie** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n35. **Nefarious** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n36. **Nanny Dearest** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n37. **Monica** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n38. **Wild Life** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n39. **Palm Trees and Power Lines** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n40. **What's Love Got to Do with It?** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n41. **Creed III** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n42. **One True Loves** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n43. **BlackBerry** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n44. **Suzume** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n45. **Rock Dog 3: Battle the Beat** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n46. **Gridman Universe** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n47. **Digimon Adventure 02: The Beginning** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n48. **Woman of the Photographs** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n49. **El Tonto** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)n50. **Seriously Red** [^1^](https://editorial.rottentomatoes.com/guide/best-movies-of-2023/)nnI hope this helps! Let me know if you have any other questions."
} ,
{
role : "user" ,
content : "Can you tell me how many movies you've told me about?"
}
] ;
let data = await bing ( {
messages : history ,
conversation_style : "Balanced" ,
markdown : false ,
stream : false
} ) ;
console . log ( data ) ;
/*
// Streaming
bing({
messages: history,
conversation_style: "Balanced",
stream: true,
markdown: false,
results: (err, data) => {
console.log(err, data);
}
});
*/
매개변수 | 기본 | 설명 |
---|---|---|
대화 스타일 | 균형 잡힌 | "Balanced", "Creative" 및 "Precise" 사이에서 사용할 수 있습니다. |
가격 인하 | 거짓 | 대화를 연속 스트림으로 변환하거나 마크다운으로 변환하지 않을 수 있습니다. |
개울 | 거짓 | 실시간 응답을 선호하는지 여부를 선택할 수 있는 옵션이 제공됩니다. |
// import { llama } from "gpti";
const { llama } = require ( "gpti" ) ;
let history = [
{
"role" : "user" ,
"content" : "Hello! How are you? Could you tell me your name?"
}
] ;
let data = await llama ( {
messages : history ,
markdown : false ,
stream : false
} ) ;
console . log ( data ) ;
/*
// Streaming
llama({
messages: history,
stream: true,
markdown: false,
results: (err, data) => {
console.log(err, data);
}
});
*/
// import { blackbox } from "gpti";
const { blackbox } = require ( "gpti" ) ;
let history = [
{
"role" : "user" ,
"content" : "Hello! How are you? Could you tell me your name?"
}
] ;
let data = await blackbox ( {
messages : history ,
markdown : false ,
stream : false
} ) ;
console . log ( data ) ;
/*
// Streaming
blackbox({
messages: history,
stream: true,
markdown: false,
results: (err, data) => {
console.log(err, data);
}
});
*/
다양한 이미지 생성 모델을 사용하는 방법을 알아보려면 여기에서 설명서를 확인하세요.
// import { imageai } from "gpti";
const { imageai } = require ( "gpti" ) ;
let data = await imageai ( {
prompt : "cat color red" ,
model : "dalle" ,
response : "url" | "base64" ,
data : { }
} ) ;
console . log ( data ) ;
현재 일부 모델에는 액세스하려면 자격 증명이 필요하지만 다른 모델은 무료입니다. 자세한 내용과 예제는 전체 설명서를 참조하세요.
API가 실패할 경우 표시되는 오류 코드입니다.
암호 | 오류 | 설명 |
---|---|---|
400 | BAD_REQUEST | 모든 매개변수가 올바르게 입력되지 않았습니다. |
500 | INTERNAL_SERVER_ERROR | 서버에 오류가 발생했습니다. |
200 | API가 문제 없이 작동했습니다. | |
403 | 금지됨 | API 자격 증명이 유효하지 않습니다. |
401 | 승인되지 않은 | API 자격 증명이 필요합니다 |