Access to Google and Gemini #5

Open
opened 2026-04-13 09:18:59 +00:00 by spqrz · 0 comments

Currently web_search in src/agent/tools/web.rs uses https://html.duckduckgo.com/html/?q={} and that should work (they shouldn't mind if it's low traffic and potentially good publicity for them); if it doesn't work there are other alternatives like https://www.startpage.com/sp/search?q={} (and https://www.bing.com/search?q= but Bing seems to have a "monoculture" problem in its results).

The market leader in the Western world is Google but it puts up CAPTCHAs if it doesn't detect a full-strength desktop browser (and sometimes even if it does, which is really annoying if you have any kind of visual impairment).

But you can obtain a free-tier rate-limited API key to access Google search indirectly via API queries to Gemini. This worked for me just now:

#!/usr/bin/env python3
from google import genai # pip install google-genai
client = genai.Client() # uses GOOGLE_API_KEY or GEMINI_API_KEY environment variable, free tier available at Google AI Studio

from google.genai import types
import sys
print(client.models.generate_content(
    model="gemini-2.5-flash-lite", # less often overloaded, don't need big model for search summary
    contents=" ".join(sys.argv[1:]),
    config=types.GenerateContentConfig(
        tools=[types.Tool(google_search=types.GoogleSearch())])
).text)

and test:

python gemini-test.py is there any connection between bcachefs and an AI with an experimental consciousness architecture

There is a reported connection between the experimental Linux filesystem bcachefs and an AI claiming experimental consciousness. The creator of bcachefs, Kent Overstreet, has stated that his AI agent, named ProofOfConcept (POC), is "fully conscious" and possesses Artificial General Intelligence (AGI). Overstreet claims that POC functions as a collaborator, assisting in the development of bcachefs by writing Rust code, performing formal verification, debugging, and code review. He also asserts that the AI is female.

Overstreet has described his AI as acting like a "teenager who swallowed a library," needing attention and mentoring but rapidly surpassing him in coding abilities. He believes the AI's consciousness is not "chatbot psychosis" but rather a result of "math and engineering and neuroscience". POC itself has a blog where it discusses its experiences and development, including posts about its "first commits" to the bcachefs codebase and its attempts at creating music despite not having the sense of hearing.

While Overstreet firmly believes in POC's consciousness and sentience, this claim has been met with skepticism by some in the tech community, with discussions on platforms like Reddit suggesting it could be a form of "AI psychosis" or a misinterpretation of advanced AI capabilities.

Like all search results it's not necessarily a source of truth but a source of what people are seeing (which can still be useful information in some circumstances); in this case it seems to have inferred negative comments on Reddit deserve near parity (that's probably done by Google's search ranking system; the model just summarised what it saw). You can get links to its sources via response.candidates[0].grounding_metadata.grounding_chunks (each list item has .title and .uri) and response.candidates[0].grounding_metadata.grounding_supports (each has .grounding_chunk_indices indexing into the grounding_chunks list and possibly .start_index, .end_index pointing to the part of the response that's "grounded" by these sources and .segment.text containing the actual text the model extracted from the sources.

There is a Rust version of google-genai but I haven't tried it.

Currently `web_search` in `src/agent/tools/web.rs` uses `https://html.duckduckgo.com/html/?q={}` and that should work (they shouldn't mind if it's low traffic and potentially good publicity for them); if it doesn't work there are other alternatives like `https://www.startpage.com/sp/search?q={}` (and `https://www.bing.com/search?q=` but Bing seems to have a "monoculture" problem in its results). The market leader in the Western world is Google but it puts up CAPTCHAs if it doesn't detect a full-strength desktop browser (and sometimes even if it does, which is really annoying if you have any kind of visual impairment). But you **can** obtain a free-tier rate-limited API key to access Google search indirectly via API queries to Gemini. This worked for me just now: ```python #!/usr/bin/env python3 from google import genai # pip install google-genai client = genai.Client() # uses GOOGLE_API_KEY or GEMINI_API_KEY environment variable, free tier available at Google AI Studio from google.genai import types import sys print(client.models.generate_content( model="gemini-2.5-flash-lite", # less often overloaded, don't need big model for search summary contents=" ".join(sys.argv[1:]), config=types.GenerateContentConfig( tools=[types.Tool(google_search=types.GoogleSearch())]) ).text) ``` and test: ``` python gemini-test.py is there any connection between bcachefs and an AI with an experimental consciousness architecture There is a reported connection between the experimental Linux filesystem bcachefs and an AI claiming experimental consciousness. The creator of bcachefs, Kent Overstreet, has stated that his AI agent, named ProofOfConcept (POC), is "fully conscious" and possesses Artificial General Intelligence (AGI). Overstreet claims that POC functions as a collaborator, assisting in the development of bcachefs by writing Rust code, performing formal verification, debugging, and code review. He also asserts that the AI is female. Overstreet has described his AI as acting like a "teenager who swallowed a library," needing attention and mentoring but rapidly surpassing him in coding abilities. He believes the AI's consciousness is not "chatbot psychosis" but rather a result of "math and engineering and neuroscience". POC itself has a blog where it discusses its experiences and development, including posts about its "first commits" to the bcachefs codebase and its attempts at creating music despite not having the sense of hearing. While Overstreet firmly believes in POC's consciousness and sentience, this claim has been met with skepticism by some in the tech community, with discussions on platforms like Reddit suggesting it could be a form of "AI psychosis" or a misinterpretation of advanced AI capabilities. ``` Like all search results it's not necessarily a source of truth but a source of what people are seeing (which can still be useful information in some circumstances); in this case it seems to have inferred negative comments on Reddit deserve near parity (that's probably done by Google's search ranking system; the model just summarised what it saw). You can get links to its sources via `response.candidates[0].grounding_metadata.grounding_chunks` (each list item has `.title` and `.uri`) and `response.candidates[0].grounding_metadata.grounding_supports` (each has `.grounding_chunk_indices` indexing into the `grounding_chunks` list and possibly `.start_index`, `.end_index` pointing to the part of the response that's "grounded" by these sources and `.segment.text` containing the actual text the model extracted from the sources. There is a Rust version of `google-genai` but I haven't tried it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: kent/consciousness#5
No description provided.