Get proxy configuration from settings
(self)
| 1003 | return "\n\n---\n" + "\n".join(citations) |
| 1004 | |
| 1005 | def _get_proxy_config(self) -> Optional[str]: |
| 1006 | """Get proxy configuration from settings""" |
| 1007 | # In httpx 0.28.1, proxy parameter expects a single URL string |
| 1008 | # Support HTTP_PROXY, HTTPS_PROXY and SOCKS5_PROXY |
| 1009 | |
| 1010 | if settings.HTTPS_PROXY: |
| 1011 | self.logger.info(f"🔄 使用HTTPS代理: {settings.HTTPS_PROXY}") |
| 1012 | return settings.HTTPS_PROXY |
| 1013 | |
| 1014 | if settings.HTTP_PROXY: |
| 1015 | self.logger.info(f"🔄 使用HTTP代理: {settings.HTTP_PROXY}") |
| 1016 | return settings.HTTP_PROXY |
| 1017 | |
| 1018 | if settings.SOCKS5_PROXY: |
| 1019 | self.logger.info(f"🔄 使用SOCKS5代理: {settings.SOCKS5_PROXY}") |
| 1020 | return settings.SOCKS5_PROXY |
| 1021 | |
| 1022 | return None |
| 1023 | |
| 1024 | def _build_timeout(self, read_timeout: float = 30.0) -> httpx.Timeout: |
| 1025 | """Create httpx timeout settings tuned for upstream chat traffic.""" |
no outgoing calls
no test coverage detected