Skip to main content

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 content
  • analyze_image(image_url, prompt, model=None): Analyze images with text prompts
  • set_model(model): Change the default model
  • set_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 successful
  • text: Generated text (if successful)
  • raw_response: Full API response
  • error: 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

finder_enrichment_ai_client-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finder_enrichment_ai_client-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file finder_enrichment_ai_client-0.1.0.tar.gz.

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 87f45b8a67b549ee7ef85f3271be43cec70a2da11fa85ad0eb38ab48b90dcd80
MD5 2c90e480b6c2ff1534a2abb656c80266
BLAKE2b-256 da94b4a880268dd5fc7e7f558b80a5df5addca4f5af27c5f3ca62ea9781209a8

See more details on using hashes here.

File details

Details for the file finder_enrichment_ai_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa4a5131f7900d3202e1f1825dfaf9950e2eebe2d1ce6b69860e9d28d0dd3e0
MD5 76ec499ffa89739c77d1cd2901f650e0
BLAKE2b-256 5d6f1a73b75332900cad40587a701cf60bc63e8a59a1c2edb1fc642a02f0427a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page