mirror of
https://github.com/Pythagora-io/gpt-pilot.git
synced 2026-01-09 13:17:55 -05:00
add log
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user