Skip to content

Add Gemini embedding support to config parser #3

Description

@hd719

Problem

The README documents Gemini as a supported embedding provider, but config.ts hardcodes provider: 'openai' in the parsed output and uses the openai SDK exclusively. The assertAllowedKeys on embedding config doesn't include provider as a valid key, so passing provider: 'gemini' would throw.

Current behavior

  • config.ts type: provider: 'openai' (literal)
  • assertAllowedKeys allows only ['apiKey', 'model'] — no provider key
  • Embeddings class instantiates new OpenAI() unconditionally
  • vectorDimsForModel only has OpenAI model dimensions

Proposal

  1. Add 'provider' to allowed embedding keys
  2. Expand the MemoryConfig type to provider: 'openai' | 'gemini'
  3. Add a GeminiEmbeddings class (using @google/generative-ai or REST API)
  4. Add Gemini model dimensions to EMBEDDING_DIMENSIONS (text-embedding-004: 768, embedding-001: 768)
  5. Factory pattern in register() to pick the right embeddings client

Impact

Unblocks users who want free-tier Gemini embeddings as documented in the README.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions