Spaces:
Running
Running
Commit
·
5ff529c
1
Parent(s):
42a7266
logging utils
Browse files
models/business_logic_utils/response_generation.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
import requests
|
2 |
from .config import API_TIMEOUT, SCENARIOS, SUPPORTED_LANGUAGES
|
|
|
|
|
|
|
3 |
|
4 |
def check_arguments(model_input: dict) -> None:
|
5 |
"""Check if the input arguments are valid."""
|
@@ -41,6 +44,6 @@ def generate_sim(model_input: dict, endpoint_url: str, endpoint_bearer_token: st
|
|
41 |
|
42 |
if response.status_code != 200:
|
43 |
raise ValueError(f"Error in response: {response.status_code} - {response.text}")
|
44 |
-
|
45 |
# Return the raw response as a dictionary
|
46 |
return response.json()
|
|
|
1 |
import requests
|
2 |
from .config import API_TIMEOUT, SCENARIOS, SUPPORTED_LANGUAGES
|
3 |
+
from streamlit.logger import get_logger
|
4 |
+
|
5 |
+
logger = get_logger(__name__)
|
6 |
|
7 |
def check_arguments(model_input: dict) -> None:
|
8 |
"""Check if the input arguments are valid."""
|
|
|
44 |
|
45 |
if response.status_code != 200:
|
46 |
raise ValueError(f"Error in response: {response.status_code} - {response.text}")
|
47 |
+
logger.debug(f"Default response is {response.json()}")
|
48 |
# Return the raw response as a dictionary
|
49 |
return response.json()
|