Closed itsderek23 closed 9 months ago
@itsderek23 - the logic for the Google Search is pretty simplistic. It is just looking for a key pair and then returns the first one present. Adding multiple to pick from and then having an LLM pick sounds like a good idea. Feel free to put up a PR, or leave this be and I will get to it eventually. It does sound more useful.
Sounds good - I'll play w/this a bit and share what I come up with.
I've noticed that quite a few queries executed via the serpapi return a valid answer box, but the
GoogleSearch
boxcar returns a snippet from an organic result instead. If searching for realtime information (ex: weather, current time, financial info) this snippet result is usually incorrect.For example, if I run the following:
The JSON response contains:
...which is correct. However, none of the
ANSWER_LOCATIONS
with ananswer_box
will match this:...so it instead grabs a snippet from an organic result (which is cached and incorrect):
While trying out queries for different types of realtime information, I've found that the answer box format can very quite a bit. I've actually had my best results by passing the
answer_box
back to the engine and asking it to parse the JSON.For example the results below are all correct but fail w/the GoogleSearch boxcar:
Curious if you have thoughts on this? I've thought of creating new Boxcar, for example,
GoogleAnswerBox
that is dedicated to just this function.