Add MISTRAL_ environment variable support with precedence over KOYEB_#56
Draft
nicoche wants to merge 1 commit into
Draft
Add MISTRAL_ environment variable support with precedence over KOYEB_#56nicoche wants to merge 1 commit into
nicoche wants to merge 1 commit into
Conversation
- Add helper functions (get_api_token, get_api_host, get_region) in utils.py - Update get_api_clients() and get_async_api_clients() to check MISTRAL_ vars first - Update sandbox.py and snapshot.py to use the new helper functions - Update documentation and examples to mention both MISTRAL_ and KOYEB_ env vars - MISTRAL_API_TOKEN, MISTRAL_API_HOST, and MISTRAL_REGION take precedence over KOYEB_ counterparts This allows users to use either MISTRAL_ or KOYEB_ environment variables, with MISTRAL_ variables taking precedence when both are set. Co-authored-by: nicoche <nicoche@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes Made
Core Changes
get_env_var_mistral_fallback(),get_api_token(),get_api_host(), andget_region()helper functions inkoyeb/sandbox/utils.pyget_api_clients()andget_async_api_clients()to use the new helper functionscreate_deployment_definition()to useget_region()helpersandbox.pyto useget_api_token()helper and updated all docstringssnapshot.pyto useget_api_token()helper and updated docstringsDocumentation & Examples
docs/sandbox.mdto mention both MISTRAL_ and KOYEB_ environment variablesexamples/README.mdto show both environment variable optionsBehavior
Testing
Closes: Request to add MISTRAL_ environment variable support