-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Cloud-Code-AI/26-setup-observability-with…
…-litellm-to-track-token-usage feat: added observability for llm check
- Loading branch information
Showing
10 changed files
with
67 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import json | ||
import os | ||
|
||
|
||
def get_config(): | ||
with open("config.json", "r") as f: | ||
config_data = json.loads(f.read()) | ||
return config_data | ||
|
||
|
||
def validate_config_settings(config): | ||
"Make sure relvant enviorment variables are set" | ||
if config.get("github_app", {}).get("check_signature", False): | ||
if not os.environ.get("GITHUB_APP_WEBHOOK_SECRET"): | ||
raise EnvironmentError( | ||
"The environment variable 'GITHUB_APP_WEBHOOK_SECRET' is not set." | ||
) | ||
|
||
if config.get("language_model", {}).get("provider", {}) == "litellm": | ||
if config.get("language_model", {}).get("enable_observability_logging", False): | ||
if not os.environ.get("SUPABASE_URL"): | ||
raise EnvironmentError( | ||
"The environment variable 'SUPABASE_URL' is not set." | ||
) | ||
if not os.environ.get("SUPABASE_KEY"): | ||
raise EnvironmentError( | ||
"The environment variable 'SUPABASE_KEY' is not set." | ||
) | ||
return config | ||
|
||
|
||
CONFIG_DATA = validate_config_settings(get_config()) |
Empty file.
This file contains 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
This file contains 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