1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| from app.service.v2.app_driver.chat_base import ChatBase
|
|
| class ChatDialog(ChatBase):
|
|
| def __init__(self, token):
| self.token = token
|
|
| async def get_headers(self):
| return {
| 'Content-Type': 'application/json',
| 'Authorization': f'Bearer {self.token}'
| }
|
|
| async def chat_completions(self):
| async for rag_response in self.http_stream(token, chat_id, chat_history):
|
| yield rag_response
|
|