Skip to content

RubyLLM::Modalities.new possible being used in RubyLLM::Models first. #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Eric-Guo
Copy link

@Eric-Guo Eric-Guo commented May 14, 2025

When I working on #168, I found if using below

chat = RubyLLM.chat(
  model: 'dify-api', # Your custom deployment name
  provider: :dify,                # MUST specify provider
  assume_model_exists: true         # Bypass registry check
)

I will got

/Users/guochunzhong/git/oss/ruby_llm/lib/ruby_llm/models.rb:60:in 'RubyLLM::Models.resolve': uninitialized constant RubyLLM::Modalities (NameError)

                             RubyLLM::Modalities.new({ input: %w[text image], output: %w[text] }),
                                    ^^^^^^^^^^^^
Did you mean?  RubyLLM::Models
	from /Users/guochunzhong/git/oss/ruby_llm/lib/ruby_llm/chat.rb:64:in 'RubyLLM::Chat#with_model'
	from /Users/guochunzhong/git/oss/ruby_llm/lib/ruby_llm/chat.rb:23:in 'RubyLLM::Chat#initialize'
	from /Users/guochunzhong/git/oss/ruby_llm/lib/ruby_llm.rb:42:in 'Class#new'
	from /Users/guochunzhong/git/oss/ruby_llm/lib/ruby_llm.rb:42:in 'RubyLLM.chat'
	from (irb):1:in '<main>'
	from <internal:kernel>:168:in 'Kernel#loop'
	from bin/console:23:in '<main>'

Which RubyLLM::Modalities.new({ input: %w[text image], output: %w[text] }) used before class ModelInfo used.

So I guess it should be move out from original place.

@Eric-Guo Eric-Guo force-pushed the move_Modalities_class branch 2 times, most recently from d5668e1 to 96f6b2b Compare May 15, 2025 23:40
@Eric-Guo Eric-Guo force-pushed the move_Modalities_class branch from 96f6b2b to 068c5fd Compare May 17, 2025 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants