Package Exports
- mycelium-api-wrapper
- mycelium-api-wrapper/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mycelium-api-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mycelium AI API Wrapper
A simple wrapper for the Mycelium AI API to facilitate interaction with the API.
Installation
You can install the package using npm:
npm install mycelium-api-wrapper
Usage
const mycelium = require('mycelium-api-wrapper');
async function main() {
try {
const catImage = await mycelium.RandomCatImage();
console.log('Random Cat Image:', catImage);
const duckImage = await mycelium.RandomDuckImage();
console.log('Random Duck Image:', duckImage);
const gptResponse = await mycelium.gpt('Prompt text', 'Your-API-Token');
console.log('GPT Response:', gptResponse);
const dalleResponse = await mycelium.dalle('DALL-E Prompt', 'Your-API-Token');
console.log('DALL-E Response:', dalleResponse);
const moderationResponse = await mycelium.moderateContent('Text to moderate', 'Your-API-Token');
console.log('Moderation Response:', moderationResponse);
} catch (error) {
console.error('Error:', error);
}
}
main();
Please replace 'Your-API-Token'
with your actual API token in the code example.
API
RandomCatImage()
Fetches a random cat image URL.
RandomDuckImage()
Fetches a random duck image URL.
gpt(prompt, token)
Generates a response using the GPT-3.5 model.
dalle(prompt, token)
Generates an image URL using the DALL-E model.
moderateContent(text, token)
Moderates text content
Links
License
This project is licensed under the ISC License