Skip to main content

Google AI Search - Python Client

PyPI version Python 3.12+ License: MIT

Unofficial Python client for Google AI Search with support for multiple independent chat sessions using browser automation.

Features

✨ Key Features:

  • 🤖 Interact with Google AI Search using Python
  • 💬 Create multiple independent chat sessions
  • 🖼️ Send images along with text messages
  • 🌐 Browser-based automation with Playwright

Installation

pip install google-ai-search-chat

From GitHub (Latest Development Version)

pip install git+https://github.com/yourusername/google-ai-search-chat.git

From Source

git clone https://github.com/yourusername/google-ai-search-chat.git
cd google-ai-search-chat
pip install -e .

Browser Driver Setup

The library uses Playwright for browser automation. Install required browsers:

playwright install chromium

Quick Start

Basic Usage

from google_ai_search_chat import GoogleAISession

# Create a session
session = GoogleAISession(user_data_dir=r"C:\chrome-profile", headless=False)

# Create a new chat
chat = session.new_chat()

# Send a message and get response
response = chat.send_message("Hello, what's the weather like?")
print(response)

# Create another independent chat in a new tab
chat2 = session.new_chat()
response2 = chat2.send_message("What is Python?")
print(response2)

# Cleanup
session.close()

Sending Images

from google_ai_search_chat import GoogleAISession

session = GoogleAISession(user_data_dir=r"C:\chrome-profile")
chat = session.new_chat()

# Send image with message
with open("image.jpg", "rb") as f:
    response = chat.send_message("What's in this image?", f.read())
    print(response)

session.close()

Headless Mode

# Headless mode (no browser window shown)
session = GoogleAISession(user_data_dir=r"C:\chrome-profile", headless=True)
chat = session.new_chat()
response = chat.send_message("Test message")
session.close()

API Reference

GoogleAISession

Main class for managing browser sessions and multiple chats.

GoogleAISession(user_data_dir: str = r"C:\chrome-profile", headless: bool = True)

Parameters:

  • user_data_dir (str): Path to Chrome profile directory for cookie persistence
  • headless (bool): Run browser in headless mode (default: True)

Methods:

  • new_chat() -> ChatGoogleAI: Create a new independent chat session
  • close_all_chats() -> None: Close all open chats
  • close() -> None: Close all chats and the browser session

ChatGoogleAI

Represents a single chat session.

Methods:

  • send_message(message: str, photo: bytes | None = None) -> str: Send a message (with optional image)
  • close() -> None: Close the chat

Requirements

  • Python 3.12+
  • Chromium browser (installed via Playwright)
  • At least 500MB disk space for browser installation

Metadata

Release files for google-ai-search-chat 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for google-ai-search-chat 0.1.8
File Size Uploaded Provenance Actions
google_ai_search_chat-0.1.8.tar.gz 6.0 kB Without provenance Details for google_ai_search_chat-0.1.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for google-ai-search-chat 0.1.8
File Interpreter ABI Platform Actions
google_ai_search_chat-0.1.8-py3-none-any.whl Python 3 none any Details for google_ai_search_chat-0.1.8-py3-none-any.whl

Total release size: 13.2 kB

Release files / google_ai_search_chat-0.1.8.tar.gz

Download URL google_ai_search_chat-0.1.8.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
354040995e963a102bd0bdf9b2a0aba9ee621d13829d200e1fe01ff1c64393a5
BLAKE2b-256 checksum
How to use checksums
53270cd10b453e18c5d209fc0ce41e55b3cdd86381ed4ee6fec72bc5541c374f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / google_ai_search_chat-0.1.8-py3-none-any.whl

Download URL google_ai_search_chat-0.1.8-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8de805013489d9e947c73f2d9e7bdaee13c76fb207175e4f6dccd4f4104249c5
BLAKE2b-256 checksum
How to use checksums
86f30373457d5e67fe15f0bf2b2051c9718b77612c2841b6c30b05d1d5f03815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for google-ai-search-chat 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page