JSPM

circuit-notion-ai

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q36485F
    • License MIT

    JavaScript client for CircuitNotion AI API with Python-style syntax

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