From 760a16ff325bc4e5cbe2a45903f15c70dee2fc79 Mon Sep 17 00:00:00 2001 From: Guangdong Liu Date: Sat, 2 Mar 2024 02:49:30 +0800 Subject: [PATCH] community[patch]: Fix ChatModel for sparkllm Bug. (#18375) **PR message**: ***Delete this entire checklist*** and replace with - **Description:** fix sparkllm paramer error - **Issue:** close #18370 - **Dependencies:** change `IFLYTEK_SPARK_APP_URL` to `IFLYTEK_SPARK_API_URL` - **Twitter handle:** No --- libs/community/langchain_community/chat_models/sparkllm.py | 6 +++--- libs/community/langchain_community/llms/sparkllm.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/community/langchain_community/chat_models/sparkllm.py b/libs/community/langchain_community/chat_models/sparkllm.py index 02c39d885b6..b29467108eb 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 0f49a356b9d..7d5eeab2184 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(