Skip to content

The agent engineering platform.

community[patch]: Fix ChatModel for sparkllm Bug. (#18375)

Guangdong Liu760a16ff325b
diff --git a/libs/community/langchain_community/chat_models/sparkllm.py b/libs/community/langchain_community/chat_models/sparkllm.py
index 02c39d885b..b29467108e 100644
--- a/libs/community/langchain_community/chat_models/sparkllm.py
+++ b/libs/community/langchain_community/chat_models/sparkllm.py
@@ -190,10 +190,10 @@ class ChatSparkLLM(BaseChatModel):
"spark_api_secret",
"IFLYTEK_SPARK_API_SECRET",
)
- values["spark_app_url"] = get_from_dict_or_env(
+ values["spark_api_url"] = get_from_dict_or_env(
values,
- "spark_app_url",
- "IFLYTEK_SPARK_APP_URL",
+ "spark_api_url",
+ "IFLYTEK_SPARK_API_URL",
"wss://spark-api.xf-yun.com/v3.1/chat",
)
values["spark_llm_domain"] = get_from_dict_or_env(
diff --git a/libs/community/langchain_community/llms/sparkllm.py b/libs/community/langchain_community/llms/sparkllm.py
index 0f49a356b9..7d5eeab218 100644
--- a/libs/community/langchain_community/llms/sparkllm.py
+++ b/libs/community/langchain_community/llms/sparkllm.py
@@ -71,10 +71,10 @@ class SparkLLM(LLM):
"spark_api_secret",
"IFLYTEK_SPARK_API_SECRET",
)
- values["spark_app_url"] = get_from_dict_or_env(
+ values["spark_api_url"] = get_from_dict_or_env(
values,
- "spark_app_url",
- "IFLYTEK_SPARK_APP_URL",
+ "spark_api_url",
+ "IFLYTEK_SPARK_API_URL",
"wss://spark-api.xf-yun.com/v3.1/chat",
)
values["spark_llm_domain"] = get_from_dict_or_env(