cordova-plugin-deepseek-ai

0.0.2 • Public • Published

cordova-plugin-deepseek-ai

The DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the DeepSeek API.

cp

cordova plugin add cordova-plugin-deepseek-ai
  • Installation capacitor
npm i cordova-plugin-deepseek-ai

Plugin methode

sendRequest


          const options = {
           apiUrl: "https://api.deepseek.com/chat/completions", // Replace with the actual API endpoint
           apiKey: "YOUR_API_KEY", // YOUR_API_KEY
           prompt: "hai",
           maxTokens: 100, // 100
           temperature: 0.7, // 0.7
          }

         cordova.plugins.CordovaDeepSeekPlugin.sendRequest(options,
           function(result){

           console.log(JSON.stringify(result))

           }, function(error){

           console.error(error)

           })


sendRequestAdvanced

var deepseekOptions = {
        apiUrl: "https://api.deepseek.com/chat/completions", // DeepSeek or OpenAi API request url endpoint
        apiKey: "YOUR_DEEPSEEK_API_KEY",
        model: "deepseek-chat",
        messages: [
            { role: "system", content: "You are a helpful assistant." },
            { role: "user", content: "Hello!" }
        ]
    };

var openAiOptions = {
    apiUrl: "https://api.openai.com/v1/chat/completions",
    apiKey: "sk-your-api-key-here",
    model: "gpt-4o-mini",
    messages: [
        { role: "system", content: "You are a helpful assistant" },
        { role: "user", content: "Hello!" }
    ],
    temperature: 0.7,
    max_tokens: 500,
    top_p: 0.9
};

    cordova.plugins.CordovaDeepSeekPlugin.sendRequestAdvanced(openAiOptions,
    function(response) {
       console.log(JSON.stringify(response))
    }, function(error) {
       console.error(error)
    });

New feature requests:

PayPal
ko-fi

Support platform:

  • Android
  • IOS

Package Sidebar

Install

npm i cordova-plugin-deepseek-ai

Weekly Downloads

0

Version

0.0.2

License

ISC

Unpacked Size

25.4 kB

Total Files

10

Last publish

Collaborators

  • emi-indo