zhaoqingang
2024-11-21 4eb8d55ec0a664678895132256c97cc63a80be2b
app/service/basic.py
@@ -1,5 +1,7 @@
import httpx
from Log import logger
class BasicService:
    def __init__(self, base_url: str):
@@ -73,13 +75,15 @@
                else:
                    yield f"Error: {response.status_code}"
    async def questions_talk(self, chat_id: str):
    async def questions_talk(self,question, chat_id: str):
        logger.error("---------------questions_talk--------------------------")
        url = f"{self.base_url}/questions/talk"
        params = {'chat_id': chat_id}
        headers = {'Content-Type': 'text/plain'}
        async with httpx.AsyncClient() as client:
        async with httpx.AsyncClient(timeout=1800) as client:
            response = await client.post(
                url,
                data=question,
                headers=headers,
                params=params
            )