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.2.1.tar.gz (5.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.2.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2edf8b24c42b3c5bb5b81e0376de5dc7c2a954f41a911c227d3ba1373e0f0378
MD5 37f85eb2ec81cad6532f75a34088a880
BLAKE2b-256 a19c6764540f9936de0adf1b8ce3b47975b61f2bb22a0be06a585a3c37f86662

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de766222b67af8aaac06426737445f0e4342029b745fa7f893979d467cddb4a9
MD5 84773a069b5449b7d558ce46ae685de7
BLAKE2b-256 4b77a99e604982b725518a296d62b0866119fb14e6f02091da6ce53f9154e9d2

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