Skip to main content

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 token
    • OP_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.6

  • Prepared package for PyPI update
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intelisys-0.2.6.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

intelisys-0.2.6-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file intelisys-0.2.6.tar.gz.

File metadata

  • Download URL: intelisys-0.2.6.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for intelisys-0.2.6.tar.gz
Algorithm Hash digest
SHA256 26fb397f0c8d27c1bef47ba1c17f4a4c50f78c4891e776ac8e1fb60fc97d06e8
MD5 1b83cc81f065dd03fa0228b81a61e599
BLAKE2b-256 338abcea63798ee1326e5298c4480a2d837e47be3d975020f4f6e595283750bd

See more details on using hashes here.

File details

Details for the file intelisys-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: intelisys-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for intelisys-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bf92326afa9b21bac6bbe6e2a2772c5be62a20074d6e4445f5789113febefdd9
MD5 3a0762cea1de8c3bd3f21c3d72712c48
BLAKE2b-256 1895d2f6997251c80ecf890b33b0bbd4549d4ac2fc0a51143b0a8ef3c40bc591

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page