Installation
Installation
To get started with rtrapy, you can install the package directly from source or via GitHub. The package is designed to work with Python 3.x and relies on the requests library for handling API communications.
Prerequisites
Before installing, ensure you have the following:
- Python 3.6 or higher.
- pip (Python package installer).
Installing via Pip
You can install the latest version of rtrapy directly from the GitHub repository:
pip install git+https://github.com/uditakhourii/rtrapy.git
Manual Installation
If you prefer to install the package manually, follow these steps:
-
Clone the repository:
git clone https://github.com/uditakhourii/rtrapy.git cd rtrapy -
Install the package:
pip install .
Dependencies
rtrapy requires the requests library. When installing via pip, this dependency is resolved and installed automatically. If you are managing your environment manually, you can install it using:
pip install requests
Configuration
To use the core functionality of the package via the RTRAConnector class, you will need to provide credentials for the external services it interfaces with.
Required Credentials
The RTRAConnector requires a Google Custom Search API setup to function. You must obtain:
- Google API Key: Generated via the Google Cloud Console.
- Search Engine ID (CX): Generated via the Google Custom Search Engine dashboard.
Initializing the Connector
Once installed, you can verify the installation by initializing the connector in your Python script:
from rtrapy.rtra_connector import RTRAConnector
# Replace with your actual credentials
API_KEY = "your_google_api_key"
ENGINE_ID = "your_custom_search_engine_id"
connector = RTRAConnector(api_key=API_KEY, engine_id=ENGINE_ID)
Note: The package currently uses a pre-configured Hugging Face Inference API endpoint for text generation. Ensure your environment has outbound internet access to
https://api-inference.huggingface.coandhttps://www.googleapis.com.