This commit is contained in:
LeonOstrez
2024-07-06 12:27:43 +01:00
parent 43813225a8
commit ca3f2e0c54
2 changed files with 2 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ After you have Python and (optionally) PostgreSQL installed, follow these steps:
1. `git clone https://github.com/Pythagora-io/gpt-pilot.git` (clone the repo)
2. `cd gpt-pilot` (go to the repo folder)
3. `python -m venv venv` (create a virtual environment)
3. `python3 -m venv venv` (create a virtual environment)
4. `source venv/bin/activate` (or on Windows `venv\Scripts\activate`) (activate the virtual environment)
5. `pip install -r requirements.txt` (install the dependencies)
6. `cp example-config.json config.json` (create `config.json` file)

View File

@@ -243,6 +243,7 @@ class BaseLLMClient:
# us confirm that we've breached the token limit, but Anthropic doesn't,
# so we can't be certain that's the problem in Anthropic case.
# Here we try to detect that and tell the user what happened.
log.info(f"API status error: {err}")
err_code = err.response.json().get("error", {}).get("code", "")
if err_code in ("request_too_large", "context_length_exceeded", "string_above_max_length"):
# Handle OpenAI and Groq token limit exceeded