### Install Literal AI Python Client Source: https://github.com/chainlit/literalai-python/blob/main/README.md Installs the Literal AI Python client library using pip. This command adds the necessary package to your Python environment. ```bash pip install literalai ``` -------------------------------- ### Set Up Literal AI Development Environment Source: https://github.com/chainlit/literalai-python/blob/main/README.md Installs development dependencies for the Literal AI project. This command is typically used by contributors to set up their local development environment. ```bash pip install -r requirements-dev.txt ``` -------------------------------- ### Initialize Literal AI Client and Define Steps Source: https://github.com/chainlit/literalai-python/blob/main/README.md Demonstrates how to initialize the Literal AI client, load environment variables (specifically LITERAL_API_KEY from a .env file), define a custom step using a decorator, and run a thread. This example shows a basic 'Hello World' flow. ```python from literalai import LiteralClient from dotenv import load_dotenv load_dotenv() literalai_client = LiteralClient() @literalai_client.step(type="run") def my_step(input): return f"World" @literalai_client.thread def main(): print(my_step("Hello")) main() client.flush_and_stop() print("Done") ``` -------------------------------- ### Python Project Dependencies (requirements.txt) Source: https://github.com/chainlit/literalai-python/blob/main/requirements.txt Specifies the required Python packages and their version constraints for the LiteralAI project. These dependencies are typically installed using pip from a `requirements.txt` file to ensure a consistent environment. ```Python asyncio==3.4.3 packaging==23.2 httpx>=0.23.0 pydantic>=1,<3 openai>=1.0.0 chevron>=0.14.0 traceloop-sdk>=0.33.12 ``` -------------------------------- ### Literal AI API Class Hierarchy Overview Source: https://github.com/chainlit/literalai-python/blob/main/literalai/api/README.md This entry describes the core classes for interacting with the Literal AI platform. It introduces `BaseLiteralAPI` as the foundational class containing all method prototypes, and its two inheriting classes, `LiteralAPI` for synchronous operations and `AsyncLiteralAPI` for asynchronous operations. ```APIDOC Literal AI API Structure: BaseLiteralAPI: - Serves as the base class for all Literal AI API interactions. - Contains all method prototypes and is the primary source of documentation. LiteralAPI: - Inherits from BaseLiteralAPI. - Provides synchronous API methods. AsyncLiteralAPI: - Inherits from BaseLiteralAPI. - Provides asynchronous API methods. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.