1

I've been working on a Langchain/Pinecone integration for a bit here, and this code was previously working for me. It seems to have broke sometime in the past month or so. Here's a stripped down version that I can run via rails runner:

begin
  llm_options = { completion_model_name: "gpt-4-1106-preview", chat_completion_model_name: "gpt-4-1106-preview" }   
  llm = Langchain::LLM::OpenAI.new(api_key: ENV["OPENAI_ACCESS_TOKEN"], default_options: llm_options)

  client = Langchain::Vectorsearch::Pinecone.new(api_key: ENV["PINECONE_API_KEY"],
                                                 index_name: "development-topic-test",
                                                 environment: "us-east-1-aws",
                                                 llm: llm)

  result = client.ask(question: "how do you reverse an array in ruby?", namespace: "topic-markets")
  puts result.inspect

rescue => e
  puts "RESCUED: #{e}"
end

This results in the output:

RESCUED: unknown keyword: :prompt

Things I've checked:

  • Environment variables are correct
  • The environment is correct and the index name exists in my Pinecone environment
  • The namespace exists in that Pinecone index
  • Also tried GPT model "gpt-4-turbo-preview" -- yielded the same result
  • Tried running the same code in a staging environment with different configuration values -- yielded the same result

Any ideas?

If I had to guess, an API method got changed somewhere, and some code has not been updated yet.

2
  • 1
    Note: I was on langchainrb gem version 0.9.0 when experiencing this error. Commented Feb 19, 2024 at 20:08
  • 1
    Add that to the question -- don't bury it in a comment Commented Feb 19, 2024 at 20:20

1 Answer 1

1

For anyone out there who comes across this, the answer was as simple as updating the gem(s).

I performed a bundle update in my rails app which updated the following gems to:

  • langchainrb (0.9.2)
  • pinecone (1.0.1)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.