From a7fc731720304990993fb39499d33c1c7295bfcb Mon Sep 17 00:00:00 2001 From: fjk <1586237690@qq.com> Date: Tue, 12 Mar 2024 04:01:30 +0800 Subject: [PATCH] docs: change sparkllm spark_app_url to spark_api_url (#18000) community: fix - change sparkllm spark_app_url to spark_api_url - **Description:** - Change the variable name from `sparkllm spark_app_url` to `spark_api_url` in the community package. --------- Co-authored-by: Bagatur --- docs/docs/integrations/chat/sparkllm.ipynb | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/docs/integrations/chat/sparkllm.ipynb b/docs/docs/integrations/chat/sparkllm.ipynb index 3fa80792a32..14c92d00084 100644 --- a/docs/docs/integrations/chat/sparkllm.ipynb +++ b/docs/docs/integrations/chat/sparkllm.ipynb @@ -99,6 +99,36 @@ "for chunk in chat.stream(\"Hello!\"):\n", " print(chunk.content, end=\"\")" ] + }, + { + "cell_type": "markdown", + "id": "566c85e0", + "metadata": {}, + "source": [ + "## For v2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3103ebdf", + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"For basic init and call\"\"\"\n", + "from langchain_community.chat_models import ChatSparkLLM\n", + "from langchain_core.messages import HumanMessage\n", + "\n", + "chat = ChatSparkLLM(\n", + " spark_app_id=\"\",\n", + " spark_api_key=\"\",\n", + " spark_api_secret=\"\",\n", + " spark_api_url=\"wss://spark-api.xf-yun.com/v2.1/chat\",\n", + " spark_llm_domain=\"generalv2\",\n", + ")\n", + "message = HumanMessage(content=\"Hello\")\n", + "chat([message])" + ] } ], "metadata": {