Open palladius opened 2 months ago
(of course this can be generalized to OpenAI et al, I just battle tested it for Gemini and I know it works for it.)
Better demo:
$ ruby 06-llm-news-test.rb
I, [2024-09-03T14:56:42.792026 #3162375] INFO -- : [Langchain.rb] [Langchain::Assistant]: Sending a call to Langchain::LLM::GoogleGemini
I, [2024-09-03T14:56:44.696304 #3162375] INFO -- : [Langchain.rb] [Langchain::Tool::NewsRetriever]: Retrieving top news headlines
I, [2024-09-03T14:56:45.153318 #3162375] INFO -- : [Langchain.rb] [Langchain::Assistant]: Sending a call to Langchain::LLM::GoogleGemini
- ๐ง [user] ๐ฌ Whats going on in Italy?
- ๐ค [mode] โถ๏ธ๐ ๏ธ [1/1] Request: {"name"=>"langchain_tool_news_retriever__get_top_headlines", "args"=>{"country"=>"it"}}
- ๐ข [func] โ๏ธ๐ ๏ธ langchain_tool_news_retriever__get_top_headlines => {"status":"ok","totalResults":34,"articles":[{"source":{"id":"google-news","name":"Google News"},"author":"Corriere della Sera","title":"Teo Teocoli su Adriano Celentano: ยซEravamo amicissimi, da cinque anni non mi risponde piรน al telefonoยป - Corriere della Sera","description":null,"url":"https://news.google.com/rss/articles/CBMinAJBVV95cUxON3k5TjYxR3VTQVN6Rk0yNEFJN2dKLVZXUlE2N0F2U0xUVEtUa2RVaDdEUGYxR2J1VUh2NzBBZ0pYaDROZU5TcmNlaDlZVEIxUHVjVjdXeUg5Mk9qXy1RVE5tRnNIbnlhMVVkSGF6NERKbGNIWkNJak84cUhyQ1ZIRThOUFJXMFJtUTFOSnpZMlJTTHg1czV0bDl0WS1HbFNBVHdoWkQyLWt4clhFLVVldHFfNTZVTjFSRW50R3czaElKQUNlWF9FRjlhVXV6YjhNWWlsX2wya0tjUEo0TTRLVExCRC05QjNLQllZNEFFdUJVMUs0UzNRRVNtb0hoTEFwNVFvXzdEeXRxM2x6ZUJEOEk4RldzZ0RoYVFIZQ?oc=5","urlToImage":null,"publishedAt":"2024-09-02T11:26:19Z","content":null},{"source":{"id":"google-news","name":"Google News"},"author":"Il Fatto Quotidiano","title":"Morta la bimba di 9 anni che fu rimpatriata con un volo militare dalla Thailandia dopo un interventoโฆ - Il Fatto Quotidiano","description":null,"url":"https://news.google.com/rss/articles/CBMi9AFBVV95cUxQZzNZZTlVRTQxWkxiZFZrYnlvcWFFazY3aUFMNnAtT3pFYmlZSlhaU3Y1TEFsNktfdUJBNkFXWm9kOHNZZkN0Y2x6YlRjU2ZCY1BCSDY4T08wQ0RrMmJ2Uzhjd1ZhZnYwV1FVcUxINzBYR283dzBaN2JVSmNEQV90NW5nTXMwSzlfZmwteFkyVmtEQTVQdVY2VFpSVzFtOVhMVGZmRkxmbFB3V1N3SGUwb3JCWktrcEtjWjhnOWhZRXZ1R1FsY1FVXzVBcUZuU3ZUaUR0T2hkVXZYU3NzVzY4SmxCMTNxbjJoWWYwQmgwRXo2VDFV0gH6AUFVX3lxTE9KUjJycFRfQnA5V3FCN01FOVRXQllUMUJGbDhmb0JBLWp2eDloV1RhVkFkNjFPUnpTaTJGdC1uQVhhYzA1cElYcExna25Zc1FFN0xoNXRsVDlIOVFsZ0ZDTXRDX1R0NmRHX3dTd2E5YnhRZ1JUdzBQSk1oUkppMTIxMHdCbnEyTHZQZ24wWEZjRWlMZ1RKZkgwMjlaUFNuRUtubkdjeFBtVWRISDhfcWN3dzhPNy1XTjJKR085dWFmNUhPcmJ6NE52RVB3VVJlZFlaUGVCMVNrR2RGLThwOThPRVZZVmxZZWNfVUtxRjMxdTdBdnZjMGJNUHc?oc=5","urlToImage":null,"publishedAt":"2024-09-02T10:55:20Z","content":null},{"source":{"id":"google-news","name":"Google News"},"author":"Corriere della Sera","title":"Charles Leclerc, il bacio con la fidanzata Alexandra dopo la vittoria. Chi รจ la compagna da 1 milione di follower - Corriere della Sera","description":null,"url":"https://news.google.com/rss/articles/CBMipgJBVV95cUxQMm8tTlF2SjNrdGVleGtXWm11Y19ZZkFLSTBaNDgwUGllenlQNGZBVTNMOE4zQkdWak5RUnVkOFZjM2lUUmREZXdUamdNUXpDMnNYYlhCYXZkUVAxeHBNT0lmM2RueFRycXN1VHp6b3JFbS00NW1peFZVZFZHSlRoYVp6bjJNWHRMb2kyZl81NkRwUWt3LU44X0p1VGZQVVJFNHVwUGVuMTlVUGpudHR2WC1jZDVRV1pPUHJEVmljUHp4Vkw0R0ozaUFLbzlJUllONkVNUmxpS0dseGRFT290bzZXZmpsNV9QeWRVNXktVXJCY19CRGkwMGU0RExINTFGeGtENmN1WXVPZ3BnOVhwU3BmWWNYei1KRE1vRngtWmd6U2J2WWfSAasCQVVfeXFMTVlrQS1Sd1NWLVFYdzBQakxVUG9OMFdMWklXS2k5b09TX2FuM0RVOXo1Qk9pR2RMZ2tCcUlCNEVGX0JOaGY1RlE3YzZyS0pibnk1MGNTUFVyWFJPUWJMdEpZb0dHV1p1QjAwUUxIZlFlUXk3b2hIR1Z0cDJwUlVxd3hDOHdZb0g1TC10QTFoYkMwTkJXS1hObGlEeHFCaWp1a2NTNlhpZkpPU1QzX3dCWS1LMTBSQkcwWlNraWYyR3BaNmZrZTZLUl9ZTkZaXzd2d1hleTNwcnVrdEtJd2ttNjdMa0huY2ZvTnpWdjRnZDRKTFdmLUFBT2FReFdCc1M1ZVBpT2U5NTVIX3ItY0Q1ZTJ5NUl1X282Uk9qVHNDVmJHQjVxckNDcEZTcTA?oc=5","urlToImage":null,"publishedAt":"2024-09-02T10:38:54Z","content":null},{"source.. (๐คฅ redacted)
- ๐ค [mode] ๐ฌ Here are some of the top headlines in Italy:
* Teo Teocoli talks about Adriano Celentano: "We were very close friends, for five years he hasn't answered my phone calls anymore." - Corriere della Sera
* 9-year-old girl who was repatriated with a military flight from Thailand after surgery dies... - Il Fatto Quotidiano
* Charles Leclerc, the kiss with his girlfriend Alexandra after the victory. Who is the partner with 1 million followers - Corriere della Sera
* Israel, general strike underway: blocked roads and arrests. LIVE - Sky Tg24
* West Nile virus, first positive donor in the Cremona area - OglioPoNews
The end.
Shows the colorfulness.
Andrei if you like the idea I can change gem (from colorize to rainbow) and send a fix. You tell me
Andrei if you like the idea I can change gem (from colorize to rainbow) and send a fix. You tell me
We're already using the rainbow gem!
Let me rephrase it. Would you like it if I add a generic pretty_print()
for a GoogleMessage or better any LLM BaseMessage in a PR?
If you find it silly or useless i wont spend that 30m doing it.
Maybe this can help your demo Andrei. I've done this for my demo in Verona and 4mo after its still good code :)
Demo: