A short description of the SBAI package
Project description
sbai (Simple Broader AI)
A Python package to simplify interactions with OpenAI and Google Gemini APIs.
Installation
pip install sbai
Features
- Easy-to-use interfaces for ChatGPT and Gemini
- Configurable model parameters
- Optional conversation memory
- Support for system instructions
Usage
ChatGPT Integration
from sbai import ChatGPT
# Initialize with OpenAI API key
client = ChatGPT(
api_key="your_openai_api_key",
model="gpt-4o-mini",
memory=True
)
# Send a prompt
response = client.prompt("Write a haiku about AI")
print(response)
# Clear conversation history
client.clear_history()
Gemini Integration
from sbai import Gemini
# Initialize with Google API key
client = Gemini(
api_key="your_google_api_key",
model="gemini-2.0-flash-exp",
instructions="Be concise and helpful"
)
# Send a prompt
response = client.prompt("Explain quantum computing")
print(response)
# Clear conversation history
client.clear_history()
Configuration Options
ChatGPT
api_key: Your OpenAI API key (required)model: OpenAI model to use (default: "gpt-4o-mini")temperature: Sampling temperature (0-1, default: 0)top_p: Nucleus sampling parameter (0-1, default: 0)instructions: System-level instructionsmax_token: Maximum tokens in response (default: 200)memory: Enable conversation memory (default: False)memory_limit: Maximum messages in memory (default: 5)
Gemini
api_key: Your Google API key (required)model: Gemini model to use (default: "gemini-2.0-flash-exp")temperature: Sampling temperature (0-1, default: 0)top_p: Nucleus sampling parameter (0-1, default: 0)max_token: Maximum tokens in response (default: 200)memory: Enable conversation memory (default: False)instructions: System-level instructions
Requirements
- Python 3.8+
openailibrarygoogle-generativeailibrary
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sbai-0.1.1.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
sbai-0.1.1-py3-none-any.whl
(3.4 kB
view details)
File details
Details for the file sbai-0.1.1.tar.gz.
File metadata
- Download URL: sbai-0.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e94896a1c63f4e40f6ad501ff28a13c727398b22cfc4560e6a7a8dc978368c85
|
|
| MD5 |
b853bfae17b815b2362db35c87d48e6d
|
|
| BLAKE2b-256 |
30d3c09f563362e281f6934d5407892c517b0eb56910a20bd4e79929828bd9cc
|
File details
Details for the file sbai-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sbai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e15fd5d4e6dab1413ce391a1618bc60764188d4f2931ed62631af3de53741102
|
|
| MD5 |
b733b6cc2579f5712c53d712c5ced797
|
|
| BLAKE2b-256 |
54828812a21e3998843ef0944a5b44a4757ae1cabd376a9a107d7ac4052383b4
|