β™ŠοΈ GemiNews πŸ—žοΈ

Demo 1: Embeddings + Recommendation Demo 2: Bella RAGa Demo 3: NewRetriever Demo 4: Assistant function calling

β™Š Stats as a partial

β™Š Gemini and Langchain interesting stuff (by partial arg - better)
πŸ”‘ Key Value
πŸ”‘ 1. Small Values
🌱 RAILS_ENV production
πŸ”‘ Rails.application.credentials.env.class ActiveSupport::OrderedOptions
πŸ”‘ Rails.application.credentials.env.keys NEWSAPI_COM_KEY,NEWSAPI_COM_KEY_RICC,GCP_KEY_PATH,GCP_SA,NEWSCATCHER_API,DATABASE_URL_PROD,PROJECT_ID,BUCKET_NAME,GEMINI_KEY,GEMINI_KEY2_SOLO_PER_GEMINEWS,SHOW_DEMOZ,GEMINI_API_KEY_BIG_QUOTA
πŸ”‘ Rails.application.credentials['ricc-passwords']['fake-pwd'] Siamo in PROD
πŸ”‘ Rails.application.credentials['ricc-passwords']['NEWSAPI_COM_KEY'].first(5) 3aae0
πŸ”‘ Rails.application.credentials['ricc-passwords']['description'] Riccardo se qiesto funziona siamo a cavallo per usare CRun - tutte le chiavi vanno qui tranne la master key
🌱 ENV-like keys (sorted) BUCKET_NAME,DATABASE_URL_PROD,GCP_KEY_PATH,GCP_SA,GEMINI_API_KEY_BIG_QUOTA,GEMINI_KEY,GEMINI_KEY2_SOLO_PER_GEMINEWS,NEWSAPI_COM_KEY,NEWSAPI_COM_KEY_RICC,NEWSCATCHER_API,PROJECT_ID,SHOW_DEMOZ
🌱 ENV-like keys [:NEWSAPI_COM_KEY, :NEWSAPI_COM_KEY_RICC, :GCP_KEY_PATH, :GCP_SA, :NEWSCATCHER_API, :DATABASE_URL_PROD, :PROJECT_ID, :BUCKET_NAME, :GEMINI_KEY, :GEMINI_KEY2_SOLO_PER_GEMINEWS, :SHOW_DEMOZ, :GEMINI_API_KEY_BIG_QUOTA]
🌱 ENV-like PROJECT_ID palladius-genai
🌱 ENV-like BUCKET_NAME palladius-genai-gemini-news-crawler
πŸŒ±πŸ” RailsCredEnv [:NEWSAPI_COM_KEY, :NEWSAPI_COM_KEY_RICC, :GCP_KEY_PATH, :GCP_SA, :NEWSCATCHER_API, :DATABASE_URL_PROD, :PROJECT_ID, :BUCKET_NAME, :GEMINI_KEY, :GEMINI_KEY2_SOLO_PER_GEMINEWS, :SHOW_DEMOZ, :GEMINI_API_KEY_BIG_QUOTA]
πŸŒ±πŸ” RailsCredEnv[BUCKET_NAME] palladius-genai-gemini-news-crawler
πŸ§ͺ AR Config dev[0].url postgresql://.../gemini-news-dev?pool=5
Newest Article (local time) 2024-10-26 22:00:00 +0000 (26 days ago)
πŸ… @freshest_article_cached πŸ—žοΈ Letters to the editor: Democratic governments are ignoring will of the people on sanctioning Israel
proiva link css Your Link Text
# πŸ—Ώ Articles with Fake Embeddings (title_embedding) 6202
# πŸ—Ώ Articles with Proper Embeddings (article_embedding) 6202
# πŸ—Ώ Articles without Embeddings (no article_embedding) 14
# πŸ—Ώ Articles without new v2 Embeddings 6176 / 6216
# ⏺️ Articles 6216
# ⏺️ ArticleTags 8591
# ⏺️ Categories 2807
πŸ”‘ 2. Big Values
Your Link Text 3 - Your Link Text 4 gemini Your Link Text 4b ricc

β™Š Gemini and Langchain info

Gemini and Langchain interesting stuff (simply @title - WORSE)
πŸ”‘ Key Value
πŸ”‘ 1. Small Values
Langchain::VERSION 0.13.1
APP_VERSION 0.3.59
ENV_PROJECT_ID palladius-genai
GeminiAuthenticated βœ… (Aladeen)
VertexAuthenticated βœ… (Aladeen)
VertexAuthTokenLength (should be 1024 if it works) 1024
GeminiLLMAuthenticated βœ… (Aladeen)
VertexLLMAuthenticated βœ… (Aladeen)
GeminiLLM #<Langchain::LLM::GoogleGemini:0x00003e397abfa580>
VertexLLM #<Langchain::LLM::GoogleVertexAI:0x00003e397b1278f0>
PalmLLM #<Langchain::LLM::GooglePalm:0x00003e397abfa080>
LLMs ["#<Langchain::LLM::GoogleVertexAI:0x00003e397b1278f0>", "#<Langchain::LLM::GoogleGemini:0x00003e397abfa580>", "#<Langchain::LLM::GooglePalm:0x00003e397abfa080>"]
AreLLMsAuthenticated [true, true, true]
VertexLLM.authorizer.token_type access_token
VertexLLM.fetch_access_token.first(10) ya29.c.c0A
OllamaLLM #<Langchain::LLM::Ollama:0x00003e397abf6e80>
NewsRetriever #<Langchain::Tool::NewsRetriever:0x00003e397abe1a30>
NewsRetrieverENV #<Langchain::Tool::NewsRetriever:0x00003e397abe1bc0>
NewsRetriever_key_initials api_key="ee798
NewsRetrieverENV_key_initials undefined method `[]' for nil:NilClass
bundle info langchainrb (path only) Path: /usr/local/bundle/ruby/3.2.0/gems/langchainrb-0.13.1
bundle info googleauth (path only) Path: /usr/local/bundle/ruby/3.2.0/gems/googleauth-1.11.0
πŸ”‘ 2. Big Values
PalmLLM.client.list_models
{"models"=>[{"name"=>"models/chat-bison-001", "version"=>"001", "displayName"=>"PaLM 2 Chat (Legacy)", "description"=>"A legacy text-only model optimized for chat conversations", "inputTokenLimit"=>4096, "outputTokenLimit"=>1024, "supportedGenerationMethods"=>["generateMessage", "countMessageTokens"], "temperature"=>0.25, "topP"=>0.95, "topK"=>40}, {"name"=>"models/text-bison-001", "version"=>"001", "displayName"=>"PaLM 2 (Legacy)", "description"=>"A legacy model that understands text and generates text as an output", "inputTokenLimit"=>8196, "outputTokenLimit"=>1024, "supportedGenerationMethods"=>["generateText", "countTextTokens", "createTunedTextModel"], "temperature"=>0.7, "topP"=>0.95, "topK"=>40}, {"name"=>"models/embedding-gecko-001", "version"=>"001", "displayName"=>"Embedding Gecko", "description"=>"Obtain a distributed representation of a text.", "inputTokenLimit"=>1024, "outputTokenLimit"=>1, "supportedGenerationMethods"=>["embedText", "countTextTokens"]}]}
bundle config local.lanchainrb
Settings for `local.lanchainrb` in order of priority. The top value will be used
You have not configured a value for `local.lanchainrb`
bundle info langchainrb</b> (you can fix with <b>bundle config --delete local.lanchainrb</b>
  * langchainrb (0.13.1)
	Summary: Build LLM-backed Ruby applications with Ruby's Langchain.rb
	Homepage: https://rubygems.org/gems/langchainrb
	Documentation: https://rubydoc.info/gems/langchainrb
	Source Code: https://github.com/andreibondarev/langchainrb
	Changelog: https://github.com/andreibondarev/langchainrb/CHANGELOG.md
	Path: /usr/local/bundle/ruby/3.2.0/gems/langchainrb-0.13.1
bundle info googleauth
  * googleauth (1.11.0)
	Summary: Google Auth Library for Ruby
	Homepage: https://github.com/googleapis/google-auth-library-ruby
	Source Code: https://github.com/googleapis/google-auth-library-ruby
	Changelog: https://github.com/googleapis/google-auth-library-ruby/blob/main/CHANGELOG.md
	Bug Tracker: https://github.com/googleapis/google-auth-library-ruby/issues
	Path: /usr/local/bundle/ruby/3.2.0/gems/googleauth-1.11.0
	Reverse Dependencies: 
		gemini-ai (3.2.0) depends on googleauth (~> 1.8)
		google-apis-core (0.15.0) depends on googleauth (~> 1.9)
		google-cloud-storage (1.51.0) depends on googleauth (~> 1.9)

πŸ€„ Ruby and Bundle info

Ruby, Rails, ENV and bundle
πŸ”‘ Key Value
πŸ”‘ 1. Small Values
APP_VERSION 0.3.59
Rails.version 7.1.3.2
RUBY_VERSION 3.2.2
Rails.root /rails
Google::Auth::GCECredentials.on_gce? βœ… (Aladeen)
RAC RailsCredEnvObj #<ActiveSupport::EncryptedConfiguration:0x00003e397b123e80>
RAC RailsCredEnv {:NEWSAPI_COM_KEY=>"ee7986b14e2149a8ba3ba833871f6580", :NEWSAPI_COM_KEY_RICC=>"3aae0071eaf04d8e9ee42f61fa61f3fa", :GCP_KEY_PATH=>"private/geminews-gcs-readwriter-key.json", :GCP_SA=>"geminews-gcs-readwriter@palladius-genai.iam.gserviceaccount.com", :NEWSCATCHER_API=>"0E1-lZS3cRz9wTRjKQufoSAu4HlmEQ63", :DATABASE_URL_PROD=>"postgresql://geminews-crawler-prod:Nfp4F6ECy5qqAmpt@34.65.100.166/gemini-news-prod?pool=5", :PROJECT_ID=>"palladius-genai", :BUCKET_NAME=>"palladius-genai-gemini-news-crawler", :GEMINI_KEY=>"AIzaSyAAg-UyJJzbDOFHIBVJBfcc2-qD8TEsJoA", :GEMINI_KEY2_SOLO_PER_GEMINEWS=>"AIzaSyDplCDY6ZyhEWlmOzwcNPfcndnudtt1UFM", :SHOW_DEMOZ=>true, :GEMINI_API_KEY_BIG_QUOTA=>"AIzaSyCOvyPCtWKTkcOfRnekU7ER4yV_YTc9xhQ"}
RAC Credentials.env.PROJECT_ID palladius-genai
RAC Credentials.env[:PROJECT_ID] palladius-genai
πŸ”‘πŸŒ± ENV[PALM_API_KEY_GEMINI] (first 5 chars) AIzaS
πŸ”‘πŸŒ± ENV[GEMINI_KEY] (first 5 chars) AIzaS
πŸ”‘πŸŒ± ENV[NEWS_API_KEY] (first 5 chars) πŸ€·πŸΌβ€β™€οΈ
πŸ”‘πŸŒ± ENV[NEWSAPI_COM_KEY_RICC] (first 5 chars) πŸ€·πŸΌβ€β™€οΈ
πŸ”‘πŸŒ± ENV[NEWSCATCHER_API] (first 5 chars) πŸ€·πŸΌβ€β™€οΈ
πŸ”‘πŸŒ± ENV[RAILS_MASTER_KEY] (first 5 chars) e7aa0
πŸ”‘πŸŒ± ENV[DATABASE_URL_DEV] (first 5 chars) postg
πŸ”‘πŸŒ± ENV[DATABASE_URL_PROD] (first 5 chars) postg
πŸ”‘ 2. Big Values
bundle config
Settings are listed in order of priority. The top value will be used.
app_config
Set via BUNDLE_APP_CONFIG: "/usr/local/bundle"

bin_path
Set via BUNDLE_BIN_PATH: "/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.10/libexec/bundle"

deployment
Set via BUNDLE_DEPLOYMENT: true

gemfile
Set via BUNDLE_GEMFILE: "/rails/Gemfile"

path
Set via BUNDLE_PATH: "/usr/local/bundle"

silence_root_warning
Set via BUNDLE_SILENCE_ROOT_WARNING: true

without
Set via BUNDLE_WITHOUT: [:development]

☁️ GCP side

Currently working on more important stuff - hence pausing this. TODO: `webapp/app/views/pages/_gcp_gcsstuff.html.erb`