m50 / ha-fallback-conversation

HomeAssistant Assist Fallback Conversation Agent
MIT License
21 stars 3 forks source link

Feature Requeset: Google Search #9

Closed schniepp closed 2 weeks ago

schniepp commented 3 weeks ago

Would it be difficult to add the following option: whenever the first word is "google", forward the remainder to a google search, otherwise, go to the fallback agent.

By the way, thanks for doing all that! Totally amazing work!

t0bst4r commented 3 weeks ago

Do you use the default built-in "Home Assistant" Conversation agent as your primary agent? If yes, you could just create an automation with a sentence trigger.

With that you can also use wildcards. (e.g. google {stuffToGoogle}).

Then you can make any service call within your automation to google stuff and use openai service calls to generate an answer.

schniepp commented 3 weeks ago

Ow wow, that's pretty amazing! I did not realize that this was possible with built-in HA functionality already! I was aware that wildcards were possible for the answers (sensor information, etc.), but I didn't realize that we could use such broad wildcards with the questions!

Thanks so much for responding to this so quickly! I am totally enjoying what you created with this integration!

m50 commented 2 weeks ago

This was a feature I had considered at one point, but since changed my mind on it, because of what @t0bst4r mentioned.

I don't think it makes sense to include in a conversation agent called "Fallback". It may make sense however, to have a different conversation agent that is capable of calling other conversation agents based on a keyword.

But what you are asking for I don't think is handled best with a conversation agent.

mkammes commented 1 week ago

Just thought I'd add this alternative solution @schniepp :

If you have Extended OpenAI installed, you can alter/update the Function (under Config) and put in your Google API keys (API and CX) in the function. Now, when Extended OpenAI is triggered (ostensibly as your failover) you now have Internet access.

This post has the function code....but you do need to provide your own Google API key and CX Valiues: https://github.com/jekalmin/extended_openai_conversation/issues/212 .

Do you see a benefit of this route vs the sentence triggers, @m50 and @t0bst4r ?