(Deprecated) Adding the Intelligence Layer SDK to your project
|
Intelligence Layer SDK is deprecated! For convenience and easier installation, the Intelligence Layer SDK has been split into three separate SDKs, all available on PyPI:
These SDKs are documented in Adding PhariaAI SDKs to your project. The original Intelligence Layer SDK is now deprecated, and you should replace it with the above SDKs. |
Add the Intelligence Layer SDK to your Poetry project
Prerequisites for installation
The Intelligence Layer uses Poetry as the package manager to handle dependencies and manage virtual environments.
We recommend installing Poetry globally while isolating it in a virtual environment using pipx, following the official instructions.
Installation steps
-
Install Poetry (if you do not already have it installed).
-
Change directory to where you want to create your project.
-
Create a new Poetry project:
poetry new poetry-demo -
Navigate to the project directory and run the following command to create a new virtual environment and install all project dependencies:
poetry install -
Activate the environment:
poetry env activate
For further details, see the official poetry documentation.
Add the Intelligence Layer to your project dependencies (JFrog)
If you do not have a JFrog account, see Add the Intelligence Layer to your project dependencies (GitHub).
To install the Intelligence Layer in your project from the JFrog artifactory, add this information to your Poetry setup as follows:
-
Add the JFrog artifactory as a source to your project:
poetry source add --priority=explicit artifactory https://alephalpha.jfrog.io/artifactory/api/pypi/python/simple -
To install the Poetry environment, export your JFrog credentials to the environment:
export POETRY_HTTP_BASIC_ARTIFACTORY_USERNAME=your@username.here export POETRY_HTTP_BASIC_ARTIFACTORY_PASSWORD=your-token-here -
Add the Intelligence Layer to the project:
poetry add --source artifactory intelligence-layer -
Execute the Poetry installation to add all the necessary dependencies to the environment:
poetry installThe Intelligence Layer is now available as a Python package and ready to be used in your project:
from intelligence_layer.core import Task
Add the Intelligence Layer to your project dependencies (GitHub)
To install the Intelligence Layer from GitHub in your project, run the following command:
poetry add git+https://github.com/Aleph-Alpha/intelligence-layer-sdk.git --python ">=3.10,<3.13"
Add the Intelligence Layer to your project dependencies (local)
To install the Intelligence Layer in your project, you can also clone the repository locally and add the development dependency on your poetry project, as follows:
-
Clone the Intelligence Layer repository from GitHub in any directory:
git clone https://github.com/Aleph-Alpha/intelligence-layer-sdk.git -
In your Poetry project directory, open the
pyproject.tomland add the Intelligence Layer as a dependency:[tool.poetry.group.dev.dependencies] python = ">=3.10,<3.13" intelligence-layer = {path = "path/to/git/folder/intelligence-layer-sdk/", develop = true} -
Refresh the lock file and then run the installation for the project with the following instructions:
poetry lock poetry install