circuit-notion-ai

1.0.0 • Public • Published

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 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.

Development

  1. Clone the repository
  2. Install dependencies: npm install
  3. Build: npm run build
  4. Test: npm test

License

MIT

Package Sidebar

Install

npm i circuit-notion-ai

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

8.1 kB

Total Files

7

Last publish

Collaborators

  • circuitnotion