Skip to content

Development #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion pilot/utils/llm_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,15 @@ def return_result(result_data, lines_printed):

if response.status_code == 401 and 'BricksLLM' in response.text:
print("", type='keyExpired')
raise ApiError("Trial Expired", response=response)
msg = "Trial Expired"
key = os.getenv("OPENAI_API_KEY")
endpoint = os.getenv("OPENAI_ENDPOINT")
if key:
msg += f"\n\n(using key ending in ...{key[-4:]}):"
if endpoint:
msg += f"\n(using endpoint: {endpoint}):"
msg += f"\n\nError details: {response.text}"
raise ApiError(msg, response=response)

if response.status_code != 200:
project.dot_pilot_gpt.log_chat_completion(endpoint, model, req_type, data['messages'], response.text)
Expand Down
Loading