Skip to content

Commit 9adf8fe

Browse files
committed
chore: fix pkg metadata
1 parent 3649130 commit 9adf8fe

File tree

3 files changed

+87
-4
lines changed

3 files changed

+87
-4
lines changed

Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
name = "x-ai"
33
version = "0.0.1"
44
edition = "2021"
5+
rust-version = "1.75"
6+
description = "✨ A cli, tui, and sdk for interacting with the 𝕏-AI API"
7+
license = "MIT"
8+
keywords = ["client", "xai", "grok", "ai"]
9+
categories = ["command-line-utilities", "science"]
10+
repository = "https://github.com/opensass/x-ai"
11+
documentation = "https://docs.rs/x-ai"
12+
authors = ["Mahmoud Harmouch <[email protected]>"]
13+
exclude = ["tests"]
514

615
[dependencies]
716
reqwest = { version = "0.12.9", features = ["json", "blocking"] }
@@ -11,3 +20,15 @@ thiserror = "2.0.3"
1120

1221
[dev-dependencies]
1322
tokio = { version = "1.41.1", features = ["full"] }
23+
24+
[profile.release]
25+
opt-level = "z"
26+
debug = false
27+
lto = true
28+
codegen-units = 1
29+
panic = "abort"
30+
strip = true
31+
incremental = false
32+
33+
[badges]
34+
maintenance = { status = "actively-developed" }

README.md

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@
1212

1313
## 📜 Table of Contents
1414

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)
1818
- [Fetch API Key Information 🔑](#fetch-api-key-information-)
1919
- [Chat Completions 💬](#chat-completions-)
2020
- [Text Completions 📝](#text-completions-)
2121
- [Embedding Creation 📊](#embedding-creation-)
2222
- [List Models 📜](#list-models-)
23-
4. [License](#license)
23+
4. [Examples](#-examples)
24+
5. [Contributing](#-contributing)
25+
6. [License](#-license)
2426

2527
---
2628

@@ -294,6 +296,63 @@ async fn main() {
294296

295297
---
296298

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** | [![Github](https://img.shields.io/badge/launch-Github-181717.svg?logo=github&logoColor=white)](./examples/basic.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/opensass/x-ai/main?filepath=examples/basic.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](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+
297356
## 📜 License
298357

299358
This crate is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2+
#![doc = include_str!("../README.md")]
3+
14
pub mod api_key;
25
pub mod chat_compl;
36
pub mod client;

0 commit comments

Comments
 (0)