Skip to content
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

WebRetriever with GoogleAPI not working #6247

Closed
1 task done
bilgeyucel opened this issue Nov 7, 2023 · 2 comments
Closed
1 task done

WebRetriever with GoogleAPI not working #6247

bilgeyucel opened this issue Nov 7, 2023 · 2 comments
Labels
topic:retriever type:bug Something isn't working

Comments

@bilgeyucel
Copy link
Contributor

Describe the bug
WebRetriever doesn't work with GoogleAPI when I provide engine_id through search_engine_kwargs

Error message

...
TypeError: WebRetriever.__init__() got an unexpected keyword argument 'search_engine_kwargs'

Expected behavior
Error message says that WebRetriever has no init argument but it has.

To Reproduce

from haystack.nodes import PromptNode, WebRetriever, PromptTemplate
from haystack.pipelines import WebQAPipeline

web_prompt = """
Synthesize a comprehensive answer from the following most relevant paragraphs and the given question.
Provide a clear and concise answer, no longer than 10-20 words.
\n\n Paragraphs: {documents} \n\n Question: {query} \n\n Answer:
"""

web_prompt_node = PromptNode(
    "gpt-3.5-turbo", default_prompt_template=PromptTemplate(prompt=web_prompt), api_key=openai_api_key
)

web_retriever = WebRetriever(
    api_key=search_api_key, 
    search_engine_provider="GoogleAPI", 
    search_engine_kwargs={"engine_id": engine_id}
)
pipeline = WebQAPipeline(retriever=web_retriever, prompt_node=web_prompt_node)
result = pipeline.run("Why was Jamie Foxx recently hospitalized?")
print(result)

or Colab nb to reproduce is here

FAQ Check

System:

  • OS: Google Colab, MacOS
  • GPU/CPU: CPU and GPU
  • Haystack version (commit or version number): 1.21.2
@bilgeyucel bilgeyucel added type:bug Something isn't working topic:retriever labels Nov 7, 2023
@anakin87
Copy link
Member

anakin87 commented Nov 7, 2023

Similar issue: #6003

Related PR: #5805

@bilgeyucel it would be great if you could check if the PR solved this issue (by installing Haystack from main).

@bilgeyucel
Copy link
Contributor Author

bilgeyucel commented Nov 7, 2023

Hi @anakin87, it seems like the main issue is solved with on the main branch, thank you for the information 🙌
However, the issue mentioned in #6003 Exception: Exception while running node 'Shaper': 'score'
Enable debug logging to see the data that was passed when the pipeline failed
persists. So, I'll close this one but add that info to #6003.

@bilgeyucel bilgeyucel closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:retriever type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants