A powerful tweet evaluation engine using advanced LLM models
Project description
EvaEngine SDK
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
Running Tests
pip install -r requirements-dev.txt
pytest
Documentation
For more detailed documentation, visit https://api.evaengine.ai/docs
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evaengine-0.1.2.tar.gz.
File metadata
- Download URL: evaengine-0.1.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b3bfe2faa89ad10eef37a12434804422510ba726abf12984b80850d53ae8bc5
|
|
| MD5 |
ed041794f1fa1d14ed90ce24c8bea096
|
|
| BLAKE2b-256 |
5d8512d31099f657c09dca2c36fa610ef5376d5f3c8d277f20ce33fa214407d3
|
File details
Details for the file evaengine-0.1.2-py3-none-any.whl.
File metadata
- Download URL: evaengine-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa89ba6e665ded6791cc3bac017e304102491efa36100be26a62da7d3e7d4fe1
|
|
| MD5 |
88e9ede468c51dcd63b5806ff1b7ea19
|
|
| BLAKE2b-256 |
dc86313da338e2b2d6bc6d55cccee3beece6358873a1d94b1f71ab729dc60f6a
|