EYAI
pronounced: /eɪ aɪ/
A simple and intuitive wrapper around OpenAI compatible APIs with built-in tool support.
Features
- Easy-to-use AI assistant with conversation memory
- Simple tool/function calling with decorators
- Automatic conversation history management
- Save and load conversations
- Support for multiple AI providers (OpenAI, Groq, etc.)
- Configurable model parameters
Installation
pip install eyai
Quick Start
from eyai import Assistant
assistant = Assistant(api_key="your-api-key-here")
# Simple chat
response = assistant.chat("Hello! What's the weather like?")
print(response)
# With tools
@assistant.tool("Get the current weather for a city")
def get_weather(city: str) -> str:
# Your weather API logic here
return f"The weather in {city} is sunny and 72°F"
# The AI can now call your function
response = assistant.chat("What's the weather in New York?")
print(response) # AI will call get_weather("New York") and respond
Advanced Usage
Using with Groq
from eyai import Assistant
assistant = Assistant(
api_key="your-groq-api-key",
base_url="https://api.groq.com/openai/v1",
model="llama-3.3-70b-versatile"
)
Multiple Tools
@assistant.tool("Calculate the sum of two numbers")
def add(x: int, y: int) -> int:
return x + y
@assistant.tool("Get user information from database")
def get_user(user_id: str) -> dict:
# Your database logic here
return {"id": user_id, "name": "John Doe"}
response = assistant.chat("Add 5 and 3, then get user info for user123")
Conversation Management
# Get conversation history
history = assistant.get_conversation_history()
# Clear conversation (keeps system prompt)
assistant.clear_conversation()
# Save conversation
assistant.save_conversation("chat_history.json")
# Load conversation
assistant.load_conversation("chat_history.json")
API Reference
Assistant
Assistant(
api_key: str,
base_url: str,
model: str,
system_prompt: str = "You are a helpful AI assistant.",
temperature: float = 0.7,
max_tokens: Optional[int] = None
)
Methods
chat(message: str) -> str: Send a message and get a responsetool(description: str = ""): Decorator to register functions as toolsget_conversation_history() -> List[Dict[str, Any]]: Get conversation historyclear_conversation(): Clear conversation historysave_conversation(filename: str): Save conversation to JSON fileload_conversation(filename: str): Load conversation from JSON file
Requirements
- Python 3.8+
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for eyai 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eyai-1.0.5.tar.gz | 7.3 kB | Without provenance | Details for eyai-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eyai-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for eyai-1.0.5-py3-none-any.whl |
Total release size: 13.0 kB
Release files / eyai-1.0.5.tar.gz
| Download URL | eyai-1.0.5.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28c25a27e89373b27f712331203658fd7fbf7f07401be116a8c803b1658c081d
|
|
BLAKE2b-256 checksum How to use checksums |
143068d56f088b628fb5554bf06ba75290d984b6a73bc1caa4977953bf9e1f9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Release files / eyai-1.0.5-py3-none-any.whl
| Download URL | eyai-1.0.5-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5eb8d6f4ce11019b11f5d759f96addddb62122fe0083092479953b1c06472629
|
|
BLAKE2b-256 checksum How to use checksums |
d3b6c26ddaa4343c5238bcef6b813560681930ea7083b3a1d99f5dcb26666e4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.2
|
Security for eyai 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.