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.0.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.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d58db785c8f83cb374d5564d95ddb8dc86376f440b444fb5edf7f5e7c4d36c21
MD5 e55667d9c8e43cae649c6b24cf785be2
BLAKE2b-256 c8feee82b3315a8006dd515641c132cd14a1cf540cc0c1ebe29b4e956da104dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for finder_enrichment_ai_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0893579b7ba94bcb5ad05b7ca42df3084f672468016c12b0f71eb02e823ee90
MD5 98a80db172e32b2fd5f9253aba19f580
BLAKE2b-256 a2dbeef72e98800223d732024806db8efca45bc0b6e6edf2262dc5e2afcc643d

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