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.1.tar.gz (4.4 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.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 56d509d052ecc0c5a26c99605f4bcd7df323cf16f3d126c156a2f7c9fc1c540a
MD5 5a4c5a58a3140816a6e1ca807ff6b62f
BLAKE2b-256 96005ef7a53ad98e72798ba813fb82722b9914474032364e9a1232b6b334f44f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bc9f0a7e09b54e07b1a055571cccd665f13dd7201777b9bcf8205f19aca8fa5a
MD5 51b40a9ef64ae7c6b6d7325f8d24f852
BLAKE2b-256 62f27af594ee7bce62e60251f6b6a544177cedaeb7c0ed866572bdc839c2e593

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