chat_dialog.py 446 B

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