from langchain.chat_models import init_chat_model from httpx import Client, Timeout from app.conf.app_config import app_config http_client = Client( timeout=Timeout(120.0, connect=10.0, read=60.0), follow_redirects=True, ) llm = init_chat_model(model=app_config.llm.model_name, api_key=app_config.llm.api_key, base_url=app_config.llm.base_url, temperature=1, extra_body={"thinking": {"type": "disabled"}}, max_retries=3, request_timeout=120, http_client=http_client)