Skip to content

Commit 6c0bd76

Browse files
committed
fix ai api types
1 parent aa34a55 commit 6c0bd76

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

backend/analytics_server/mhq/service/ai/ai_analytics_service.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ def __init__(self, llm: LLM, access_token: str):
4444
def _get_message(self, message: str, role: str = "user"):
4545
return {"role": role, "content": message}
4646

47-
def _handle_api_response(
48-
self, response
49-
) -> Union[Dict[str, str], Dict[str, Union[str, int]]]:
47+
def _handle_api_response(self, response) -> Dict[str, Union[str, int]]:
5048
"""
5149
Handles the API response, returning a success or error structure that the frontend can use.
5250
"""
@@ -101,7 +99,7 @@ def _fireworks_ai_fetch_completions(self, messages: List[Dict[str, str]]):
10199

102100
def _fetch_completion(
103101
self, messages: List[Dict[str, str]]
104-
) -> Union[Dict[str, str], Dict[str, Union[str, int]]]:
102+
) -> Dict[str, Union[str, int]]:
105103
"""
106104
Fetches the completion using the appropriate AI provider based on the LLM.
107105
"""
@@ -118,7 +116,7 @@ def _fetch_completion(
118116

119117
def get_dora_metrics_score(
120118
self, four_keys_data: Dict[str, float]
121-
) -> Union[Dict[str, str], Dict[str, Union[str, int]]]:
119+
) -> Dict[str, Union[str, int]]:
122120
"""
123121
Calculate the DORA metrics score using input data and an LLM (Language Learning Model).
124122

0 commit comments

Comments
 (0)