mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 20:14:44 +08:00
Add support for self-signed certs from model providers (#276)
* Add support for self-signed certs from model providers * cleanup --------- Co-authored-by: tonydoesathing <tmastromarino@cpacket.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict
|
||||
import os
|
||||
import ssl
|
||||
import httpx
|
||||
|
||||
from langchain_openai import ChatOpenAI
|
||||
from langchain_deepseek import ChatDeepSeek
|
||||
@@ -71,6 +73,16 @@ def _create_llm_use_conf(
|
||||
if llm_type == "reasoning":
|
||||
merged_conf["api_base"] = merged_conf.pop("base_url", None)
|
||||
|
||||
# Handle SSL verification settings
|
||||
verify_ssl = merged_conf.pop("verify_ssl", True)
|
||||
|
||||
# Create custom HTTP client if SSL verification is disabled
|
||||
if not verify_ssl:
|
||||
http_client = httpx.Client(verify=False)
|
||||
http_async_client = httpx.AsyncClient(verify=False)
|
||||
merged_conf["http_client"] = http_client
|
||||
merged_conf["http_async_client"] = http_async_client
|
||||
|
||||
return (
|
||||
ChatOpenAI(**merged_conf)
|
||||
if llm_type != "reasoning"
|
||||
@@ -78,6 +90,7 @@ def _create_llm_use_conf(
|
||||
)
|
||||
|
||||
|
||||
|
||||
def get_llm_by_type(
|
||||
llm_type: LLMType,
|
||||
) -> ChatOpenAI:
|
||||
|
||||
Reference in New Issue
Block a user