A JavaScript client library for the CircuitNotion AI API with Python-style syntax.
npm install circuit-notion-ai
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();
Creates a new client instance.
Generates content using the specified model.
Parameters:
-
model
(string): The model name to use -
contents
(string|array): Input content for generation -
temperature
(number, optional): Controls randomness -
max_tokens
(number, optional): Maximum number of tokens to generate
Returns: Promise that resolves to a Response object with a txt
property.
- Clone the repository
- Install dependencies:
npm install
- Build:
npm run build
- Test:
npm test
MIT