Metadata-Version: 2.1
Name: alita_sdk
Version: 0.3.2
Summary: SDK for building langchain agents using resouces from Alita
Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>
Project-URL: Homepage, https://projectalita.ai
Project-URL: Issues, https://github.com/ProjectAlita/alita-sdk/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sqlalchemy<2.0.36
Requires-Dist: tiktoken>=0.7.0
Requires-Dist: openai>=1.55.0
Requires-Dist: python-dotenv~=1.0.1
Requires-Dist: alita_tools>=0.1.0
Requires-Dist: jinja2~=3.1.3
Requires-Dist: pillow<11
Requires-Dist: requests~=2.3
Requires-Dist: pydantic~=2.10.0
Requires-Dist: chardet==5.2.0
Requires-Dist: fastapi==0.115.5
Requires-Dist: httpcore==1.0.7
Requires-Dist: langchain_core~=0.3.19
Requires-Dist: langchain~=0.3.7
Requires-Dist: langchain_community~=0.3.7
Requires-Dist: langchain-openai~=0.2.9
Requires-Dist: langgraph-checkpoint-sqlite~=2.0.0
Requires-Dist: langgraph-checkpoint-postgres~=2.0.1
Requires-Dist: langsmith==0.1.144
Requires-Dist: langgraph~=0.2.53
Requires-Dist: langchain_chroma~=0.1.0
Requires-Dist: langchain-unstructured~=0.1.2
Requires-Dist: keybert==0.8.3
Requires-Dist: charset_normalizer==3.3.2
Requires-Dist: unstructured[local-inference]==0.15.9
Requires-Dist: unstructured_pytesseract==0.3.13
Requires-Dist: unstructured_inference==0.7.36
Requires-Dist: python-pptx==1.0.2
Requires-Dist: pdf2image==1.16.3
Requires-Dist: pikepdf==8.7.1
Requires-Dist: pypdf==4.3.1
Requires-Dist: pdfminer.six==20221105
Requires-Dist: opencv-python==4.8.1.78
Requires-Dist: pandas==2.1.3
Requires-Dist: python-docx==1.1.2
Requires-Dist: openpyxl==3.1.2
Requires-Dist: markdown==3.5.1
Requires-Dist: beautifulsoup4==4.12.2
Requires-Dist: gensim==4.3.2
Requires-Dist: chromadb==0.5.20
Requires-Dist: pgvector==0.2.5
Requires-Dist: atlassian-python-api~=3.41
Requires-Dist: markdownify==0.12.1
Requires-Dist: dulwich==0.21.6
Requires-Dist: paramiko==3.3.1
Requires-Dist: urllib3>=2
Requires-Dist: certifi==2024.8.30
Requires-Dist: scipy==1.10.1
Requires-Dist: qtest-swagger-client==0.0.3
Requires-Dist: pytesseract==0.3.13
Requires-Dist: reportlab==4.2.5
Requires-Dist: svglib==1.5.1
Requires-Dist: rlpycairo==0.3.0
Requires-Dist: cairocffi==1.7.1
Requires-Dist: docx2txt==0.8

Alita SDK
=========

Alita SDK, built on top of Langchain, enables the creation of intelligent agents within the Alita Platform using project-specific prompts and data sources. This SDK is designed for developers looking to integrate advanced AI capabilities into their projects with ease.

Prerequisites
-------------

Before you begin, ensure you have the following requirements met:

*   Python 3.10
*   An active deployment of Project Alita
*   Access to personal project

Installation
------------

First, you need to install the Langchain library. Alita SDK depends on Langchain for its core functionalities. You can install Langchain using pip:

```bash
pip install langchain
```

Next, clone the Alita SDK repository (assuming it's available on GitHub or another source):


```bash
git clone https://github.com/ProjectAlita/alita-sdk.git
cd alita-sdk
```

Install the SDK along with its dependencies:

```bash
pip install -r requirements.txt
```

Environment Setup
-----------------

Before running your Alita agents, set up your environment variables. Create a `.env` file in the root directory of your project and include your Project Alita credentials:

```.env
AUTH_TOKEN=<your_api_token>
PROJECT_ID=<your_project_id> 
INTEGRATION_UID=<your_integration_uid>
```

Ensure you load these variables in your application:


```python
from dotenv import load_dotenv 
load_dotenv('.env')
```

Basic Usage
-----------

The Alita SDK allows you to create and execute agents with ease. Here's a simple example to get you started:

```bash
pip install alita-sdk
```

```python
import logging
from os import environ
from dotenv import load_dotenv

logging.basicConfig(level=logging.INFO)
load_dotenv('.env')
logger = logging.getLogger(__name__)

from alita_sdk.utils.streamlit import run_streamlit

try:
    import streamlit as st
except ImportError:
    logger.error("Streamlit not found, please install it using `pip install streamlit`")
    exit(1)

from alita_sdk.llms.alita import AlitaChatModel
            
# Minimal set of setting for AlitaChatModel
settings = {
    "deployment": "https://eye.projectalita.ai",
    "model": "gpt-4-0125-preview",
    "api_key": environ.get("AUTH_TOKEN"),
    "project_id": environ.get("PROJECT_ID"),
    "integration_uid": environ.get("INTEGRATION_UID"),
    
}

agent_id = 1  # Created Agent ID in Alita Platform
agent_version_id = 1

print(settings)
if 'messages' not in st.session_state:
    llm = AlitaChatModel(**settings)
    st.session_state.messages = []
    st.session_state.agent_executor = llm.client.application(llm, agent_id, agent_version_id)


run_streamlit(st)

```
