Skip to content

llm.py directly imports google.generativeai instead of using LazyLoader #127

@fschuh

Description

@fschuh

At the top of dsrag/llm.py we can find this:

import google.generativeai as genai

The correct approach should be to have it use dsrag.utils.imports.LazyLoader as the rest of the code does.
The current version seems like a mistake and forces everybody to install that dependency even though we might not need it.

There already appears to be some LazyLoaders in dsrag/utils/imports.py for google, but it just isn't being used in llm.py:

genai = LazyLoader("google.generativeai", "google-generativeai")
genai_new = LazyLoader("google.genai", "google-genai")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions