Fixed more or less reading import, attempted to do listening

This commit is contained in:
Carlos-Mesquita
2024-11-10 06:46:58 +00:00
parent 6909d75eb6
commit afeaf118c6
33 changed files with 3712 additions and 86 deletions

View File

@@ -2,6 +2,9 @@ import json
import re
import logging
from typing import List, Optional, Callable, TypeVar
from numba.core.transforms import consolidate_multi_exit_withs
from numba.cuda import const
from openai import AsyncOpenAI
from openai.types.chat import ChatCompletionMessageParam
@@ -123,7 +126,9 @@ class OpenAI(ILLMService):
while attempt < 3:
result = await self._client.chat.completions.create(**params)
result_content = result.choices[0].message.content
try:
print(result_content)
result_json = json.loads(result_content)
return map_to_model(result_json)
except Exception as e: