Skip to content

fix: exit the goose and show the error message when provider environment variable is not set#103

Merged
lifeizhou-ap merged 13 commits intomainfrom
lifei/show-readable-error-message-when-api-key-not-specified
Oct 4, 2024
Merged

fix: exit the goose and show the error message when provider environment variable is not set#103
lifeizhou-ap merged 13 commits intomainfrom
lifei/show-readable-error-message-when-api-key-not-specified

Conversation

@lifeizhou-ap
Copy link
Copy Markdown
Collaborator

@lifeizhou-ap lifeizhou-ap commented Oct 1, 2024

Why

Currently it throws a runtime error and print the stack trace when

  • when the environment variable is not set for LLM apis,
  • when unknown provider or moderator is trying to be loaded

This make it hard for users to understand what is going.

What

Exchange

  • Raised a MissingProviderEnvVariableError with attributes of provider, env_variable. When providers fetch the environment variable for api key, it will raise this error if the environment variable is not available
  • Raised a LoadExchangeAttributeError for unknown provider or moderator

With the above custom erross we can construct user friendly messages in goose

goose

  • Raised a LoadExchangeAttributeError for unknown provider or toolkit
  • Catch the custom errors Show the error message without stacktrace and exit the program.

screenshots
Screenshot 2024-10-03 at 11 35 56 AM

Screenshot 2024-10-02 at 11 49 46 AM

Please give feedback including the content and presentation of these error message. Thank you!

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants