Skip to content

Cordova Plugin for using OpenAI's GPT apis. Supports GPT-3, ChatGPT, and GPT-4. ( Requires third party services https://openai.com/ that charge money )

License

Notifications You must be signed in to change notification settings

EMI-INDO/emi-indo-cordova-plugin-open-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emi-indo-cordova-plugin-open-ai

Cordova Plugin for using OpenAI's GPT apis. Supports GPT-3, ChatGPT, and GPT-4. ( Requires third party services https://openai.com/ that charge money )

💰Sponsor this project

PayPal

Features

  • Completions ( model: text-davinci-003 )

Coming soon Features

  • chat completion ( model: gpt-3.5-turbo ) ( Finished )
  • edit ( model: text-davinci-edit-001 )
  • Images generations
  • Speech to text

Installation

cordova plugin add emi-indo-cordova-plugin-open-ai

Or

cordova plugin add https://github.com/EMI-INDO/emi-indo-cordova-plugin-open-ai

Remove

cordova plugin rm emi-indo-cordova-plugin-open-ai

Completions

Example - index.html:

let _Completion = () => {
    cordova.plugins.emiOpenAiPlugin.completions(  
	apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",  // apiKey https://platform.openai.com/
	timeOut = 0, //set this to 60, If error Failed to load response due to timeout
    prompt = "Hi? make me html code", // string
    max_tokens = 4000,
    temperature = 0,
	
    (result) => { alert(result) },
    (error) => { alert(error)

    
    });
}

// call _Completion();

result

2023-04-26_171947

chat

Example - index.html:

let _chat = () => {
    cordova.plugins.emiOpenAiPlugin.chat(  
	apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",  // apiKey https://platform.openai.com/
	timeOut = 0, //set this to 60, If error Failed to load response due to timeout
    role = "user", // The role of the author of this message. One of system, user, or assistant.
    content = "Make me coffee",
	
    (result) => { alert(result) },
    (error) => { alert(error)

    
    });
}

// call _chat();

About

Cordova Plugin for using OpenAI's GPT apis. Supports GPT-3, ChatGPT, and GPT-4. ( Requires third party services https://openai.com/ that charge money )

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published