Skip to content

NameError: uninitialized class variable @@provider #103

@andreibondarev

Description

@andreibondarev

I ran into an issue when attempting to run 'SupportArticle.embed!' via the Rails console.

I get the following error:

SupportArticle Load (9.3ms)  SELECT "support_articles".* FROM "support_articles" ORDER BY "support_articles"."id" ASC LIMIT $1  [["LIMIT", 1000]]
NameError: uninitialized class variable @@provider in SupportArticle

from /Users/williamahlering/.gem/ruby/3.2.2/gems/langchainrb_rails-0.1.10/lib/langchainrb_rails/active_record/hooks.rb:52:in `class_variable_get'

I followed the setup instructions to add pgvector and successfully migrated the db to add the 'embedding' vector column to my model 'SupportArticle'. I've also set my ENV["OPENAI_API_KEY"] which I can see correctly in the rails console, as well.

My gemfile includes the following:

gem 'pgvector'
gem 'neighbor'
gem "langchainrb_rails", "~> 0.1.10"
gem "ruby-openai", "~> 7.1"
gem 'ollama-ai', '~> 1.3.0'

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