Skip to content

Commit aca280e

Browse files
authored
docs: Table of contents in readme (#119)
* docs: Updated docs with table of contents * fix: docs * fix: more docs stuff * fix: emoji * fix: cloud emoji
1 parent 7c52f19 commit aca280e

File tree

1 file changed

+54
-30
lines changed

1 file changed

+54
-30
lines changed

README.md

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,33 @@
1818

1919
---
2020

21+
## Table of Contents
22+
23+
- [Examples](#examples-tldr) 🗂️
24+
- [Migration from v1.3.4 and below](#migration-from-v134-and-below)
25+
- [AI21 Official Documentation](#Documentation)
26+
- [Installation](#Installation) 💿
27+
- [Usage - Chat Completions](#Usage)
28+
- [Older Models Support Usage](#Older-Models-Support-Usage)
29+
- [More Models](#More-Models)
30+
- [Streaming](#Streaming)
31+
- [TSMs](#TSMs)
32+
- [Token Counting](#Token-Counting)
33+
- [Environment Variables](#Environment-Variables)
34+
- [Error Handling](#Error-Handling)
35+
- [Cloud Providers](#Cloud-Providers) ☁️
36+
- [AWS](#AWS)
37+
- [SageMaker](#SageMaker)
38+
- [Bedrock](#Bedrock)
39+
40+
## Examples (tl;dr)
41+
42+
If you want to quickly get a glance how to use the AI21 Python SDK and jump straight to business, you can check out the examples. Take a look at our models and see them in action! Several examples and demonstrations have been put together to show our models' functionality and capabilities.
43+
44+
### [Check out the Examples](examples/)
45+
46+
Feel free to dive in, experiment, and adapt these examples to suit your needs. We believe they'll help you get up and running quickly.
47+
2148
## Migration from v1.3.4 and below
2249

2350
In `v2.0.0` we introduced a new SDK that is not backwards compatible with the previous version.
@@ -133,7 +160,6 @@ pip install ai21
133160

134161
```python
135162
from ai21 import AI21Client
136-
from ai21.models import RoleType
137163
from ai21.models.chat import ChatMessage
138164

139165
client = AI21Client(
@@ -236,6 +262,8 @@ for chunk in response:
236262

237263
---
238264

265+
## More Models
266+
239267
## TSMs
240268

241269
AI21 Studio's Task-Specific Models offer a range of powerful tools. These models have been specifically designed for their respective tasks and provide high-quality results while optimizing efficiency.
@@ -257,7 +285,28 @@ response = client.answer.create(
257285

258286
A detailed explanation on Contextual Answers, can be found [here](https://docs.ai21.com/docs/contextual-answers-api)
259287

260-
### Token Counting
288+
### File Upload
289+
290+
---
291+
292+
```python
293+
from ai21 import AI21Client
294+
295+
client = AI21Client()
296+
297+
file_id = client.library.files.create(
298+
file_path="path/to/file",
299+
path="path/to/file/in/library",
300+
labels=["label1", "label2"],
301+
public_url="www.example.com",
302+
)
303+
304+
uploaded_file = client.library.files.get(file_id)
305+
```
306+
307+
For more information on more Task Specific Models, see the [documentation](https://docs.ai21.com/reference/paraphrase-api-ref).
308+
309+
## Token Counting
261310

262311
---
263312

@@ -278,25 +327,6 @@ Available tokenizers are:
278327

279328
For more information on AI21 Tokenizers, see the [documentation](https://github.com/AI21Labs/ai21-tokenizer).
280329

281-
### File Upload
282-
283-
---
284-
285-
```python
286-
from ai21 import AI21Client
287-
288-
client = AI21Client()
289-
290-
file_id = client.library.files.create(
291-
file_path="path/to/file",
292-
path="path/to/file/in/library",
293-
labels=["label1", "label2"],
294-
public_url="www.example.com",
295-
)
296-
297-
uploaded_file = client.library.files.get(file_id)
298-
```
299-
300330
## Environment Variables
301331

302332
---
@@ -355,10 +385,12 @@ except AI21APIError as e:
355385

356386
```
357387

358-
## AWS Clients
388+
## Cloud Providers
359389

360390
---
361391

392+
### AWS
393+
362394
AI21 Library provides convenient ways to interact with two AWS clients for use with AWS SageMaker and AWS Bedrock.
363395

364396
### Installation
@@ -435,12 +467,4 @@ response = client.completion.create(
435467
)
436468
```
437469

438-
## Examples
439-
440-
Explore our examples to see our models in action! We've put together a variety of use cases and demonstrations to showcase the capabilities and functionality of our models.
441-
442-
### [Check out the Examples](examples/)
443-
444-
Feel free to dive in, experiment, and adapt these examples to suit your needs. We believe they'll help you get up and running quickly.
445-
446470
Happy prompting! 🚀

0 commit comments

Comments
 (0)