BoxcarsAI / boxcars

Building applications with composability using Boxcars with LLM's. Inspired by LangChain.
MIT License
430 stars 39 forks source link

VectorAnswer always return error "Query must a string" #90

Closed xleotranx closed 1 year ago

xleotranx commented 1 year ago

I found a bug when I use VectorAnswer. There might be an incorrect method call in lib/boxcars/boxcar/vector_answer.rb.

 def get_search_content(question, count: 1)
      search = Boxcars::VectorSearch.new(embeddings: embeddings, vector_documents: vector_documents)
      results = search.call query: question, count: count
      @search_content = get_search_content(results)
    end

The line @search_content = get_search_content(results) should be corrected to @search_content = get_results_content(results).

I have made the necessary changes, and it is working correctly on my local environment.

ntabernacle commented 1 year ago

+1

francis commented 1 year ago

@xleotranx - you are welcome to put up a PR for this, but if you don't feel like it, I can do it too. Nice find!

xleotranx commented 1 year ago

HI @francis , i have just make a pull request here https://github.com/BoxcarsAI/boxcars/pull/91

jaigouk commented 1 year ago

not directly related to the vector search but i found extra issues. i am working on that https://github.com/jaigouk/boxcars/pull/2

francis commented 1 year ago

@jaigouk - will you push this to us when you have it working?