From 2f84090578da341d2bed4ef9d6f3e0d9b9340bad Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Wed, 20 Dec 2023 14:50:00 +0200 Subject: [PATCH 1/2] docs: instance text --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2bac70a8..ac535d65 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,9 @@ client = AI21Client(api_key='my_api_key') client = AI21Client() ``` +We No longer support static methods for each resource, instead we have a client instance that has a method for each +allowing for more flexibility and better control. + ### Completion before/after ```diff From 6df07da25e5425e0c4268556e634a4cdc72f4229 Mon Sep 17 00:00:00 2001 From: Asaf Gardin Date: Wed, 20 Dec 2023 14:50:56 +0200 Subject: [PATCH 2/2] docs: client instance explanation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ac535d65..cd5f74ad 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ import ai21 + response = client.completion(model="j2-light", prompt=prompt, max_tokens=2) ``` +This applies to all resources. You would now need to create a client instance and use it to call the resource method. + ### Tokenization and Token counting before/after ```diff