Package Exports
- circuit-notion-ai
- circuit-notion-ai/dist/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 (circuit-notion-ai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CircuitNotion AI JavaScript Client
A JavaScript client library for the CircuitNotion AI API with Python-style syntax.
Installation
npm install circuit-notion-ai
Usage
import { CNAI } from 'circuit-notion-ai';
// Initialize client (Python-style)
const client = CNAI.Client({ api_key: "your_api_key_1" });
// Generate content (Python-style)
async function main() {
try {
const response = await client.models.generate_content({
model: "circuit-2-turbo",
contents: "explain simply how to beat procrastination",
temperature: 0.7,
max_tokens: 200
});
console.log(response.txt);
} catch (error) {
console.error("Error:", error);
}
}
main();
API Reference
CNAI.Client({ api_key })
Creates a new client instance.
client.models.generate_content(params)
Generates content using the specified model.
Parameters:
model
(string): The model name to usecontents
(string|array): Input content for generationtemperature
(number, optional): Controls randomnessmax_tokens
(number, optional): Maximum number of tokens to generate
Returns: Promise that resolves to a Response object with a txt
property.
Development
- Clone the repository
- Install dependencies:
npm install
- Build:
npm run build
- Test:
npm test
License
MIT