Skip to main content

A powerful tweet evaluation engine using advanced LLM models

Project description

EvaEngine SDK

Python 3.7+ PyPI version

A Python SDK for evaluating and generating tweet responses using EvaEngine's AI-powered API. This SDK provides easy access to tweet evaluation metrics, virtual scoring, and AI-generated response suggestions.

Features

  • 🔍 Comprehensive tweet evaluation
  • 🎯 Virtual scoring system
  • 💡 AI-powered response suggestions
  • 📊 Detailed scoring metrics
  • ⚡ Async/await support
  • 🔒 Type-safe with Pydantic models

Installation

pip install evaengine

Quick Start

import asyncio
from evaengine import EvaEngine

async def main():
    # Initialize with your API key
    engine = EvaEngine(api_key="your-api-key")
    
    async with engine:
        # Evaluate a tweet response
        result = await engine.evaluate_tweet(
            input_tweet="What's your favorite programming language?",
            output_tweet="Python is amazing for its simplicity and readability!"
        )
        
        print(f"Final Score: {result.final_score}")
        print(f"Truth Score: {result.truth.score}")
        print(f"Truth Rationale: {result.truth.rationale}")

if __name__ == "__main__":
    asyncio.run(main())

API Reference

Initialize Client

from evaengine import EvaEngine

# Using API key directly
engine = EvaEngine(api_key="your-api-key")

# Using environment variable
from dotenv import load_dotenv
import os

load_dotenv()
engine = EvaEngine(api_key=os.getenv("X_API_KEY"))

Evaluate Tweet

Evaluate a tweet response against an original tweet:

result = await engine.evaluate_tweet(
    input_tweet="What's your favorite programming language?",
    output_tweet="Python is amazing for its simplicity and readability!"
)

print(f"Final Score: {result.final_score}")
print(f"Truth Score: {result.truth.score}")
print(f"Accuracy Score: {result.accuracy.score}")
print(f"Creativity Score: {result.creativity.score}")
print(f"Engagement Score: {result.engagement.score}")

Get Historical Scores

Retrieve historical evaluation scores:

scores = await engine.get_scores()

Get AI-Suggested Response

Generate an AI-powered response suggestion:

suggestion = await engine.get_suggested_tweet(
    input_tweet="Just launched my new AI project!"
)
print(f"Suggested Response: {suggestion}")

Environment Variables

You can set your API key using an environment variable:

# .env file
X_API_KEY=your-api-key

Requirements

  • Python 3.7+
  • aiohttp>=3.8.0
  • pydantic>=2.0.0
  • python-dotenv>=0.19.0

Documentation

For more detailed documentation, visit https://api.evaengine.ai/docs

License

MIT License - see LICENSE file for details.

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

evaengine-0.1.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.

evaengine-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: evaengine-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for evaengine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 11bf1f39de4840d6e3c8278498c352d7fdf2217ec23eb3378bb3f7ba9193dea9
MD5 fd6f861aba42ebaffa47b7de3c8a8468
BLAKE2b-256 bee3b9aa2aee34d1dfb3fa7b8143cba20ef95320538d47afc0e8b159ca74e294

See more details on using hashes here.

File details

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

File metadata

  • Download URL: evaengine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for evaengine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c28ddd4ce880f02b30d1aa4abb8d6b456567783c8e9cd28aa9125e8d49b5f39f
MD5 8406c3670b129b294af40838bb456158
BLAKE2b-256 9399f2f91d392640a831e44c5567ad0d079e7ff91f447c1c51ccaa0655715a9f

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