Intelligence/AI services for the Lifsys Enterprise
Project description
Intelisys
Intelisys is a Python library that provides intelligence/AI services for the Lifsys Enterprise. It offers a unified interface to interact with various AI models and services, including OpenAI, Anthropic, Google, and more.
Installation
You can install Intelisys using pip:
pip install intelisys
This will install the latest stable version from PyPI.
For the latest development version, you can install directly from GitHub:
pip install git+https://github.com/lifsys/intelisys.git
Note: If you encounter any issues during installation, make sure you have the latest version of pip:
pip install --upgrade pip
Then try the installation again.
Requirements
- Python 3.7 or higher
- A 1Password Connect server (for API key management)
- Environment variables:
OP_CONNECT_TOKEN
: Your 1Password Connect tokenOP_CONNECT_HOST
: The URL of your 1Password Connect server
Note: If no local 1Password Connect server is available, the library will fail to retrieve API keys.
Features
- Support for multiple AI models (OpenAI, Anthropic, Google, TogetherAI, Groq, MistralAI)
- Secure API key management using 1Password Connect
- JSON formatting and template rendering
- Asynchronous assistant interactions
- Template-based API calls
- Improved error handling and logging
- Consistent versioning across all package files
Usage
Here's a quick example of how to use Intelisys:
from intelisys import get_completion_api, Intelisys
# Make sure OP_CONNECT_TOKEN and OP_CONNECT_HOST are set in your environment
# Using get_completion_api
response = get_completion_api("Hello, how are you?", "gpt-4")
print(response)
# Using Intelisys class
intelisys = Intelisys(name="MyAssistant", provider="openai", model="gpt-4")
response = intelisys.chat("Tell me about artificial intelligence")
print(response)
Advanced Usage
from intelisys import template_api_json, get_assistant, fix_json
# Using a template for API calls
render_data = {"user_name": "Alice"}
system_message = "You are a helpful assistant. Greet {{user_name}}."
response = template_api_json("gpt-4", render_data, system_message, "friendly_assistant")
print(response)
# Using an OpenAI assistant
assistant_id = "your_assistant_id"
reference = "What's the weather like today?"
responses = get_assistant(reference, assistant_id)
for response in responses:
print(response)
# Fixing malformed JSON
malformed_json = "{'key': 'value', 'nested': {'a':1, 'b': 2,}}"
fixed_json = fix_json(malformed_json)
print(fixed_json)
Supported Models
Intelisys supports a variety of AI models:
- OpenAI: gpt-4o-mini, gpt-4, gpt-4o
- Anthropic: claude-3.5
- Google: gemini-flash
- TogetherAI: llama-3-70b, llama-3.1-large
- Groq: groq-llama, groq-fast
- MistralAI: mistral-large
New in Version 0.2.7
- Implemented lazy loading for Intelisys class attributes
- Improved performance by initializing attributes only when first accessed
- Introduced properties for model, api_key, and client in the Intelisys class
- Reduced initialization overhead of the Intelisys class
- Updated version number in relevant files
- Maintained all improvements from previous versions
API Reference
For detailed information on available functions and their usage, please refer to the docstrings in the source code.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Changelog
For a detailed list of changes and version history, please refer to the CHANGELOG.md file.
About Lifsys, Inc
Lifsys, Inc is an AI company dedicated to developing solutions for the future. For more information, visit www.lifsys.com.
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
File details
Details for the file intelisys-0.2.7.tar.gz
.
File metadata
- Download URL: intelisys-0.2.7.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3f2acf3f6d41021b7c387f228e2975bbee94a6d668f6eefd4ade54d9af14b1 |
|
MD5 | e653c513ecbbf71db9d1218747d22dae |
|
BLAKE2b-256 | 28c808647fa996f7f812dda14578ae96711f2d1fbce2bd32fd558945ccdd67d0 |
File details
Details for the file intelisys-0.2.7-py3-none-any.whl
.
File metadata
- Download URL: intelisys-0.2.7-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b4d6e598ca4a6d21a4e349745144f44cd2575cc7d732951f629b7a7383ed75 |
|
MD5 | a7a3cc4fe4fecb7f88b3a59180d89b68 |
|
BLAKE2b-256 | 618c1b26021e6a063c12f55f87af02f63fa22037d91bad9dca05f31853988d42 |