UNPKG

plugai

Version:

PlugAI is a library that provides interfaces to various AI models like Gemini, DeepSeek, and OpenAI.

54 lines (35 loc) 1.16 kB
# PlugAI PlugAI is a library that provides interfaces to various AI models like Gemini, DeepSeek, and OpenAI. ## Installation ```bash npm install plugai ``` ## Usage ### Importing the Models ```typescript import { Gemini } from './models/gemini'; import { DeepSeek } from './models/deepseek'; import { OpenAI } from './models/openai'; ``` ### Creating Instances ```typescript const gemini = new Gemini('your-gemini-api-key'); const deepSeek = new DeepSeek('your-deepseek-api-key'); const openAI = new OpenAI('your-openai-api-key'); ``` ### Making Requests Each model has a `request` method that accepts input data and an optional URL parameter. If the URL is not provided, the default URL will be used. #### Gemini ```typescript const geminiResponse = await gemini.request({ query: 'your-query' }, 'optional-custom-url'); ``` #### DeepSeek ```typescript const deepSeekResponse = await deepSeek.request({ query: 'your-query' }, 'optional-custom-url'); ``` #### OpenAI ```typescript const openAIResponse = await openAI.request({ prompt: 'your-prompt' }, 'optional-custom-url'); ``` ## License This project is licensed under the ISC License.