Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

🔍 GL Smart Search SDK 🐍

PyPI Latest Release License

Python SDK for GL Smart Search v2: web search and connector integrations (GitHub, Google Drive, Gmail, Google Calendar).

v1 clients (search, deep_research, authentication email modules) are not included in this package. Use the legacy smart-search-sdk PyPI artifact if you still depend on v1.

Requirements

  • Python 3.11+ (tested on 3.11–3.13)

Installation

pip install gl-smart-search-sdk

GDP Labs internal registry:

pip install gl-smart-search-sdk --index-url https://glsdk.gdplabs.id/gen-ai-internal/simple/
import asyncio
import os

from gl_smart_search_sdk.web.client import WebSearchClient
from gl_smart_search_sdk.web.models import GetWebSearchResultsRequest


async def main() -> None:
    client = WebSearchClient(base_url=os.environ["GL_SMARTSEARCH_BASE_URL"])
    await client.authenticate(token=os.environ["GL_SMARTSEARCH_TOKEN"])

    request = GetWebSearchResultsRequest(
        query="What is retrieval-augmented generation?",
        result_type="snippets",
        size=5,
    )
    response = await client.search_web(request)
    print(response)


asyncio.run(main())

Quick start — Connectors

import asyncio
import os

from gl_smart_search_sdk.connector.client import ConnectorClient
from gl_smart_search_sdk.connector.models import AppName, ConnectorRequest


async def main() -> None:
    client = ConnectorClient(base_url=os.environ["GL_SMARTSEARCH_BASE_URL"])
    await client.authenticate(token=os.environ["GL_SMARTSEARCH_TOKEN"])

    request = ConnectorRequest(query="meetings next week")
    response = await client.search_connector(
        app_name=AppName.GOOGLE_CALENDAR,
        gl_token=os.environ["GL_CONNECTORS_USER_TOKEN"],
        request=request,
    )
    print(response)


asyncio.run(main())

Environment variables

Variable Required Description
GL_SMARTSEARCH_BASE_URL Yes API base URL
GL_SMARTSEARCH_TOKEN Yes* Bearer token for API calls
GL_SMARTSEARCH_USER_IDENTIFIER CLI User id (CLI / credential flows)
GL_SMARTSEARCH_USER_SECRET CLI User secret (CLI / credential flows)
GL_CONNECTORS_USER_TOKEN Connectors GL Connectors user token
GL_CONNECTORS_DEFAULT_CALLBACK_URL Connectors OAuth callback URL (optional)

* Required for SDK clients unless passed explicitly to authenticate().

Load variables with python-dotenv or your platform’s secret manager before creating clients.

CLI

The package includes the gl-smart-search CLI (web and connector subcommands).

poetry run gl-smart-search --help
poetry run gl-smart-search status

See gl_smart_search_sdk/cli/README.md for full command reference.

Examples

Non-interactive scripts live in the repository under python/examples/:

  • web_search.py — web search, URLs, fetch, snippets, keypoints
  • connector_search.py — connector search and management

API overview (v2)

WebSearchClient

  • search_web — search with snippets, keypoints, or summary
  • search_web_urls — return relevant URLs
  • search_web_map — site map for a base URL
  • fetch_web_page — fetch page content
  • get_web_page_snippets — snippets from a URL
  • get_web_page_keypoints — key points from a URL

ConnectorClient

  • search_connector — search a connected app
  • connect_connector — start connector OAuth flow
  • disconnect_connector — remove connector integration

All clients extend BaseGLSmartSearchClient (authentication, HTTP, streaming helpers).

Documentation

Development

cd python/gl-smart-search-sdk
poetry install
poetry run pytest
poetry run gl-smart-search --version

Metadata

Release files for gl-smart-search-sdk 0.0.17b2

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

Built distribution (wheel)

Table of built distributions (wheels) for gl-smart-search-sdk 0.0.17b2
File Interpreter ABI Platform
gl_smart_search_sdk-0.0.17b2-py3-none-any.whl Python 3 none any Details

Release files / gl_smart_search_sdk-0.0.17b2-py3-none-any.whl

Download URL gl_smart_search_sdk-0.0.17b2-py3-none-any.whl
Size 50.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6010701dbf848c764d26703ce2766f6627824c79554568c2f9db2d052f8f474b
BLAKE2b-256 checksum
How to use checksums
552510f54af0e03a26376f148263e55a9ccdb2e67a055d45b020e022be4acee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via poetry/2.1.4 CPython/3.12.14 Linux/5.10.0-32-cloud-amd64
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