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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anti_client-1.2.0.tar.gz | 18.3 kB | Without provenance | Details for anti_client-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anti_client-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for anti_client-1.2.0-py3-none-any.whl |
Total release size: 37.6 kB
Release files / anti_client-1.2.0.tar.gz
| Download URL | anti_client-1.2.0.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9ec4c73876060d2786c8b0992ab66f863c8073fad3e07409779db42414c33b1
|
|
BLAKE2b-256 checksum How to use checksums |
3ef43719885b75d44c9c8897ae14205662959e228856209aebfb699c65050f32
|
| 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.2.0-py3-none-any.whl
| Download URL | anti_client-1.2.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6465c6596b521b1fd2864856013149345ff51a9b99d5c10950c6c12f56038ccd
|
|
BLAKE2b-256 checksum How to use checksums |
3087739b50e33abd0929c1d26941d08688025aff40faefa946a3a425aa9900fc
|
| 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.2.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.