GraphQL::Schema::Argument::InvalidDefaultValueError #253
-
The CodeI am trying to use this gem for the first time, and my code looks like this: class QueryService
require "langchain"
def initialize
@client = Langchain::Vectorsearch::Weaviate.new(
url: Rails.application.credentials.weaviate[:url],
api_key: Rails.application.credentials.weaviate[:api_key],
index_name: "langchain_test",
llm: Langchain::LLM::OpenAI.new(api_key: Rails.application.credentials.openai[:api_key])
)
@client.create_default_schema
end
def add_texts(texts: [])
@client.add_texts(
texts: texts
)
end
def ask(question)
@client.ask(
question: question
)
end
def search(text)
@client.similarity_search(
query: text,
k: 1
)
end
end The IssueRunning qs.ask('What does Bob like?') or qs.search('cheese') I get the following error: /Users/my_username/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/graphql-2.0.24/lib/graphql/schema/argument.rb:357:in `validate_default_value': `GetObjectsLangchain_testHybridInpObj.fusionType` has an invalid default value: `0` isn't accepted by `FusionEnum`; update the default value or the argument type. (GraphQL::Schema::Argument::InvalidDefaultValueError) The QuestionI don't know anything about GraphQL and, as I said before, this gem is new to me. Am I doing something wrong? Or should I open an Issue? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I am using the latest version of this gem from RubyGems.org (0.6.5). |
Beta Was this translation helpful? Give feedback.
-
@therealrodk When specifying the ...
index_name: "Langchain_test"
... Take a look at this note right here: https://github.com/andreibondarev/langchainrb/blob/main/lib/langchain/vectorsearch/weaviate.rb#L28-L30 |
Beta Was this translation helpful? Give feedback.
-
I think @obie was seeing a similar issue:
|
Beta Was this translation helpful? Give feedback.
-
@therealrodk This issue was happening on the Weaviate side. They had fixed it and released a new version: 1.20.2. Please update your Weaviate version and try again! |
Beta Was this translation helpful? Give feedback.
@therealrodk This issue was happening on the Weaviate side. They had fixed it and released a new version: 1.20.2.
Please update your Weaviate version and try again!