Lightweight AI client package for managing API calls to various AI providers
Project description
Finder Enrichment AI Client
A lightweight Python package for managing AI API calls to various providers. Currently supports Google Gemini AI with more providers coming soon.
Features
- Lightweight: No heavy dependencies, just HTTP requests
- Simple: Easy-to-use interface for AI API calls
- Extensible: Designed to support multiple AI providers
- Configurable: Support for both environment variables and direct API key passing
Installation
pip install finder-enrichment-ai-client
Quick Start
Google Gemini AI
from finder_enrichment_ai_client import GoogleAIClient
# Initialize with environment variable
client = GoogleAIClient()
# Or initialize with direct API key
client = GoogleAIClient(api_key="your-api-key-here")
# Generate text
response = client.generate_content("Hello! How are you?")
if response['success']:
print(response['text'])
else:
print(f"Error: {response['error']}")
# Analyze image
response = client.analyze_image(
image_url="https://example.com/image.jpg",
prompt="Describe this image"
)
if response['success']:
print(response['text'])
Environment Variables
Set GOOGLE_GEMINI_API_KEY in your environment:
export GOOGLE_GEMINI_API_KEY="your-api-key-here"
API Reference
GoogleAIClient
Methods
generate_content(prompt, model=None, temperature=0.7, max_tokens=1000): Generate text contentanalyze_image(image_url, prompt, model=None): Analyze images with text promptsset_model(model): Change the default modelset_temperature(temperature): Set the default temperature (0.0 to 1.0)get_available_models(): Get list of available models
Response Format
All methods return a dictionary with:
success: Boolean indicating if the call was successfultext: Generated text (if successful)raw_response: Full API responseerror: Error message (if not successful)
Development
# Install in development mode
pip install -e .
# Run tests
pytest
# Format code
black .
isort .
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file finder_enrichment_ai_client-0.2.0.tar.gz.
File metadata
- Download URL: finder_enrichment_ai_client-0.2.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d58db785c8f83cb374d5564d95ddb8dc86376f440b444fb5edf7f5e7c4d36c21
|
|
| MD5 |
e55667d9c8e43cae649c6b24cf785be2
|
|
| BLAKE2b-256 |
c8feee82b3315a8006dd515641c132cd14a1cf540cc0c1ebe29b4e956da104dc
|
File details
Details for the file finder_enrichment_ai_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: finder_enrichment_ai_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0893579b7ba94bcb5ad05b7ca42df3084f672468016c12b0f71eb02e823ee90
|
|
| MD5 |
98a80db172e32b2fd5f9253aba19f580
|
|
| BLAKE2b-256 |
a2dbeef72e98800223d732024806db8efca45bc0b6e6edf2262dc5e2afcc643d
|