Skip to main content

anti-client

A full-featured Python client library for interacting with the internal Anrigravity API (Gemini).

Features

  • OAuth 2.0 Authentication: Built-in authentication flow with token caching (~/.anti-api/accounts.json).
  • Function Calling: Complete support for tool execution by agents.
  • Streaming: Native streaming capabilities, seamlessly integrated with function calling.
  • Resource Management: Automated model discovery, quota checking, and precise usage statistics.

Installation

Install the package directly from the source directory:

pip install .

Usage Example

import asyncio
from anti_client import Client, Agent, Tool

# 1. Define Tools
def get_weather(city: str) -> str:
    """Retrieve weather information for a specific city."""
    return f"The weather in {city} is clear and sunny."

weather_tool = Tool(
    name="get_weather",
    description="Retrieve the current weather for a specified city.",
    parameters={
        "type": "object",
        "properties": {
            "city": {"type": "string", "description": "The name of the city."}
        },
        "required": ["city"],
    },
    func=get_weather
)

async def main():
    # 2. Initialize Client using an async context manager
    # (Triggers OAuth flow if tokens are missing)
    async with Client() as client:

        # 3. Initialize Agent
        agent = Agent(
            client=client,
            model="gemini-3.1-pro-low",
            system_prompt="You are a helpful assistant.",
            tools=[weather_tool]
        )

        # 4. Generate Response
        response = await agent.run("Hello! What's the weather like in London?", stream=False)

        print("Response:", response.text)
        print("Tokens Used:", response.usage.total_tokens)

if __name__ == "__main__":
    asyncio.run(main())

Metadata

Release files for anti-client 1.1.0

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

Source distribution (sdist)

Source distribution for anti-client 1.1.0
File Size Uploaded Provenance Actions
anti_client-1.1.0.tar.gz 17.4 kB Without provenance Details for anti_client-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anti-client 1.1.0
File Interpreter ABI Platform Actions
anti_client-1.1.0-py3-none-any.whl Python 3 none any Details for anti_client-1.1.0-py3-none-any.whl

Total release size: 35.9 kB

Release files / anti_client-1.1.0.tar.gz

Download URL anti_client-1.1.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
317609c05fab6f2a96025a8ecd7cb1d74cb1ad365f7d0d7ff7b6aed36d9ff2f7
BLAKE2b-256 checksum
How to use checksums
b41324f82570b8699d154b7688f6d5303ce29e054f11227e7b4e4857fae8879e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / anti_client-1.1.0-py3-none-any.whl

Download URL anti_client-1.1.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81483e775fff66b99b35252561ebdd6d62bf07a8112e1785bdc98b26e4fdccd9
BLAKE2b-256 checksum
How to use checksums
1a19ed7a73754d1eb3a68f74f0f4efb29e0492c892734e7d4d548db0f662ec00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for anti-client 1.1.0

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