pitchai-gpt (lib_agents)
Reusable GPT helpers and the Fast Streaming Agent runtime that power AFASAsk deployments. The package bundles two major pieces of functionality:
lib_agents.gpt/lib_agents.gpt_root: async GPT helpers with smart prompt loading, Gemini/OpenRouter/Groq/Azure routing, and streaming support.lib_agents.fast_streaming_agent_root: the Fast Streaming Agent runtime for dataframe-aware copilots, including dataframe loading, semantic-layer hooks, and templated UI helpers.
Both modules are designed to be shared between repositories (e.g. AFASAsk and AI Price Crawler) so they can evolve in one place and be installed through PyPI. The distribution on PyPI is called pitchai-gpt, but it exposes the lib_agents Python package to avoid breaking existing imports.
Installation
uv pip install pitchai-gpt
# or
pip install pitchai-gpt
Environment variables
The GPT helpers expect API keys/endpoints to be provided through environment variables (or by passing api_key= directly when instantiating GPT). The most commonly used variables are:
| Provider | Variables |
|---|---|
| Azure OpenAI | AZURE_OPENAI_API_KEY, AZURE_OPENAI_GPT4O_ENDPOINT, AZURE_OPENAI_GPT4O_MINI_ENDPOINT, AZURE_OPENAI_O3_ENDPOINT, AZURE_OPENAI_GPT5_MINI_ENDPOINT, AZURE_OPENAI_API_VERSION |
| Gemini | GEMINI_API_KEY_GENERAL or GEMINI_API_KEY, optional GEMINI_API_BASE_URL |
| Groq | GROQ_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
The streaming agent runtime reads configuration from YAML/JSON prompt files, optionally loads .env files via python-dotenv, and integrates with Pandas/Polars. Make sure your application provides any referenced config modules (e.g. configs.server_config, libs.lib_utils).
Usage
from lib_agents.gpt.gpt import GPT
gpt = GPT(
sys_msg="You are a concise assistant.",
user_msg="Say READY",
model="gemini-2.0-flash",
)
response, *_ = asyncio.run(gpt.run())
print(response)
For streaming agents see lib_agents.fast_streaming_agent_root.main.FastStreamingAgent and the demos under apps/web_app.
Development
This project uses Hatch via uv for building and publishing. See docs/uv_pypi_publish.md in the monorepo for a step-by-step release checklist.
Metadata
Release files for pitchai-gpt 0.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 |
|---|---|---|---|---|
| pitchai_gpt-0.2.0.tar.gz | 104.3 kB | Without provenance | Details for pitchai_gpt-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pitchai_gpt-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pitchai_gpt-0.2.0-py3-none-any.whl |
Total release size: 230.8 kB
Release files / pitchai_gpt-0.2.0.tar.gz
| Download URL | pitchai_gpt-0.2.0.tar.gz |
|---|---|
| Size | 104.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73661e0f6364915ef2ee5ffecc9dc361827418f7d7ede22664677991eaf06853
|
|
BLAKE2b-256 checksum How to use checksums |
a6d3bd61b406a9c439183ad9e1a44359e285713730965b8abee136510102aafa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.21
|
Release files / pitchai_gpt-0.2.0-py3-none-any.whl
| Download URL | pitchai_gpt-0.2.0-py3-none-any.whl |
|---|---|
| Size | 126.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ffdbffc5f6c488a7954788da899c4e70d698c9b17a55950b8566ca39814db6e
|
|
BLAKE2b-256 checksum How to use checksums |
105de0b5f3020c460008157f6b7ca3d356795f3d8fa859e7b35ac3b3ca7534f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.21
|
Security for pitchai-gpt 0.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.