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
- Lazy loading of Intelisys class attributes for improved performance
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)
# Demonstrating lazy loading
intelisys = Intelisys(name="LazyAssistant", provider="openai")
# The model, api_key, and client are not initialized until first accessed
print(intelisys.model) # This will trigger the initialization of the model
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.8
- Enhanced lazy loading for Intelisys class attributes
- Further improved performance by optimizing attribute initialization
- Updated documentation with examples of lazy loading usage
- Ensured version consistency across all package 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.9.tar.gz
.
File metadata
- Download URL: intelisys-0.2.9.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cf25dba0ba88df56c4c984688d66d1a13ce2da1aa263fa0c2a15e9db57955ab |
|
MD5 | 3fc2986db4debc919e7f50f6579ee068 |
|
BLAKE2b-256 | ac1ab2b4580040f227d45e21f723003e12607842c777f29584cdca1168d3cad9 |
File details
Details for the file intelisys-0.2.9-py3-none-any.whl
.
File metadata
- Download URL: intelisys-0.2.9-py3-none-any.whl
- Upload date:
- Size: 18.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f371791bf8b4a9c18b61d5d93ac0c26334710894422cf91087bbff5bad2822b2 |
|
MD5 | b33b6894bbe8b140611b7019f75ae70e |
|
BLAKE2b-256 | 3a9a7a445f4c01bdebad5e97a2c99c6d0d1ed6810243a8eadcce05e84dfeb7c9 |