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": {