From 2c6a699d499a3468fc4312a6b6c9493ffd1806a2 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 06:23:09 -0500 Subject: [PATCH] docs(readme): add token counting reference (#94) --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dec4b0c..d4dad28 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,12 @@ main(); Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. +## Counting Tokens + +We provide a [separate package](https://github.com/anthropics/anthropic-tokenizer-typescript) for counting how many tokens a given piece of text contains. + +See the [repository documentation](https://github.com/anthropics/anthropic-tokenizer-typescript) for more details. + ## Handling errors When the library is unable to connect to the API, @@ -231,13 +237,13 @@ await anthropic.completions.create( ### Timeouts -Requests time out after 60 seconds by default. You can configure this with a `timeout` option: +Requests time out after 10 minutes by default. You can configure this with a `timeout` option: ```ts // Configure the default for all requests: const anthropic = new Anthropic({ - timeout: 20 * 1000, // 20 seconds (default is 60s) + timeout: 20 * 1000, // 20 seconds (default is 10 minutes) }); // Override per-request: