Skip to content

Commit 163a8d6

Browse files
committed
Fix async/await issue - SDK methods are synchronous, not async
1 parent 858f1f4 commit 163a8d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

backend/app/ai_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def is_configured(self) -> bool:
4141
async def chat(self, message: str) -> str:
4242
"""Send a message to the configured AI provider and get a response"""
4343
if self.provider == "anthropic":
44-
return await self._chat_with_claude(message)
44+
return self._chat_with_claude(message)
4545
elif self.provider == "openai":
46-
return await self._chat_with_openai(message)
46+
return self._chat_with_openai(message)
4747
raise ValueError(f"Unsupported AI provider: {self.provider}")
4848

4949
def _chat_with_claude(self, message: str) -> str:
@@ -60,7 +60,7 @@ def _chat_with_claude(self, message: str) -> str:
6060
except anthropic.APIError as e:
6161
raise ValueError(f"Claude API error: {str(e)}")
6262

63-
async def _chat_with_openai(self, message: str) -> str:
63+
def _chat_with_openai(self, message: str) -> str:
6464
"""Chat with OpenAI GPT using official SDK"""
6565
try:
6666
response = self.openai_client.chat.completions.create(

0 commit comments

Comments
 (0)