self.pvd
This commit is contained in:
parent
fc4856c249
commit
0769004ebb
|
@ -8,11 +8,11 @@ from simplylab.providers import Providers
|
||||||
class ChatService:
|
class ChatService:
|
||||||
def __init__(self, ctx: Any):
|
def __init__(self, ctx: Any):
|
||||||
self.ctx = ctx
|
self.ctx = ctx
|
||||||
|
self.pvd = Providers()
|
||||||
|
|
||||||
async def get_ai_chat_response(self, req: GetAiChatResponseInput) -> GetAiChatResponseOutput:
|
async def get_ai_chat_response(self, req: GetAiChatResponseInput) -> GetAiChatResponseOutput:
|
||||||
pvd = Providers()
|
|
||||||
message = req.message
|
message = req.message
|
||||||
response_content = await pvd.openrouter.chat(content=message)
|
response_content = await self.pvd.openrouter.chat(content=message)
|
||||||
res = GetAiChatResponseOutput(response=response_content)
|
res = GetAiChatResponseOutput(response=response_content)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue