js-genai  by googleapis

JS/TS SDK for Gemini and Vertex AI

created 7 months ago
944 stars

Top 39.7% on sourcepulse

GitHubView on GitHub
Project Summary

This TypeScript/JavaScript SDK provides access to Google's Gemini models via both the Gemini Developer API and Vertex AI. It's designed for developers building generative AI applications, offering features like streaming responses, function calling, and chat history management.

How It Works

The SDK leverages a modular design, with submodules for managing models (ai.models), caching (ai.caches), chat interactions (ai.chats), file uploads (ai.files), and real-time sessions (ai.live). It supports Gemini 2.0 features and allows integration with external systems through function declarations.

Quick Start & Requirements

  • Installation: npm install @google/genai
  • Prerequisites: Node.js version 18 or later.
  • API Key: Required for Gemini Developer API. Vertex AI requires project and location configuration.
  • Documentation: https://googleapis.github.io/js-genai/

Highlighted Details

  • Supports both Gemini Developer API and Vertex AI.
  • Enables streaming responses for improved interactivity.
  • Facilitates function calling for tool integration.
  • Offers chat history management and file uploads.

Maintenance & Community

This SDK is Google Deepmind's primary offering for generative AI features, with older SDKs (@google/generative_language, @google-cloud/vertexai) no longer receiving new Gemini 2.0+ features.

Licensing & Compatibility

The SDK is developed by Google. Specific licensing details are not explicitly stated in the README, but it is intended for use with Google's AI platforms.

Limitations & Caveats

The SDK is currently in a preview launch stage, meaning it may not be feature-complete and does not come with SLAs or technical support. It is intended for testing environments. API keys should not be exposed in client-side code.

Health Check
Last commit

1 day ago

Responsiveness

1 day

Pull Requests (30d)
66
Issues (30d)
39
Star History
601 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.