tmp
zhaoqingang
2025-01-07 7666bdbabfb929f98e94310dbe99eabb435898a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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, url, data, headers):
 
        async for rag_response in self.http_stream(url, data, headers):
 
            yield rag_response