|
12 | 12 |
|
13 | 13 | ## 📜 Table of Contents
|
14 | 14 |
|
15 |
| -1. [Features](#features) |
16 |
| -2. [Installation](#installation) |
17 |
| -3. [Usage Examples](#usage-examples) |
| 15 | +1. [Features](#-features) |
| 16 | +2. [Installation](#-installation) |
| 17 | +3. [Usage Examples](#-usage-examples) |
18 | 18 | - [Fetch API Key Information 🔑](#fetch-api-key-information-)
|
19 | 19 | - [Chat Completions 💬](#chat-completions-)
|
20 | 20 | - [Text Completions 📝](#text-completions-)
|
21 | 21 | - [Embedding Creation 📊](#embedding-creation-)
|
22 | 22 | - [List Models 📜](#list-models-)
|
23 |
| -4. [License](#license) |
| 23 | +4. [Examples](#-examples) |
| 24 | +5. [Contributing](#-contributing) |
| 25 | +6. [License](#-license) |
24 | 26 |
|
25 | 27 | ---
|
26 | 28 |
|
@@ -294,6 +296,63 @@ async fn main() {
|
294 | 296 |
|
295 | 297 | ---
|
296 | 298 |
|
| 299 | +## 📌 Examples |
| 300 | + |
| 301 | +> [!WARNING] |
| 302 | +> 🚧 Under Construction |
| 303 | +
|
| 304 | +This repository contains a list of notebooks examples on how to use the sdk and or the cli. To use the notebooks in this repository, you need to set up your environment. Follow these steps to get started: |
| 305 | + |
| 306 | +1. Clone the repository to your local machine: |
| 307 | + |
| 308 | + ```sh |
| 309 | + git clone https://github.com/opensass/x-ai.git |
| 310 | + ``` |
| 311 | + |
| 312 | +1. Install the required dependencies and libraries. Make sure you have [`Rust`](https://rustup.rs/), [`Jupyter Notebook`](https://jupyter.org/install), and [`evcxr_jupyter`](https://github.com/evcxr/evcxr/blob/main/evcxr_jupyter/README.md) installed on your system. |
| 313 | + |
| 314 | + ```sh |
| 315 | + # Install a Rust toolchain (e.g. nightly): |
| 316 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly |
| 317 | + |
| 318 | + # Although not recommended, but, You may need to clean the python thing cz of new v3.12 venv breaking changes |
| 319 | + sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGED |
| 320 | + |
| 321 | + # Install Jupyter Notebook |
| 322 | + pip install notebook |
| 323 | + |
| 324 | + # Install evcxr_jupyter, upgrade soon |
| 325 | + cargo install evcxr_jupyter |
| 326 | + evcxr_jupyter --install |
| 327 | + ``` |
| 328 | + |
| 329 | +1. Navigate to the cloned repository and build the project: |
| 330 | + |
| 331 | + ```sh |
| 332 | + cd x-ai |
| 333 | + cargo build --release --all-features |
| 334 | + ``` |
| 335 | + |
| 336 | +1. Start Jupyter Notebook: |
| 337 | + |
| 338 | + ```sh |
| 339 | + jupyter notebook |
| 340 | + ``` |
| 341 | + |
| 342 | +1. Access the notebooks in your web browser by clicking on the notebook file you want to explore. |
| 343 | + |
| 344 | +| ID | Example | Open on GitHub | Launch on Binder | Launch on Colab | |
| 345 | +|----|---------------|-----------|:-------------|-------------| |
| 346 | +| 1 | **Basic** | [](./examples/basic.ipynb) | [](https://mybinder.org/v2/gh/opensass/x-ai/main?filepath=examples/basic.ipynb) | [](https://colab.research.google.com/github/opensass/x-ai/blob/main/examples/basic.ipynb) | |
| 347 | + |
| 348 | +--- |
| 349 | + |
| 350 | +## 🤝 Contributing |
| 351 | + |
| 352 | +Contributions and feedback are welcome! If you'd like to contribute, report an issue, or suggest an enhancement, please engage with the project on [GitHub](https://github.com/opensass/x-ai). Your contributions help improve this crate for the community. |
| 353 | + |
| 354 | +--- |
| 355 | + |
297 | 356 | ## 📜 License
|
298 | 357 |
|
299 | 358 | This crate is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.
|
0 commit comments