docs: Fix typo in openai llm integration notebook (#25492)

Fix typo in openai LLM integration notebook.
This commit is contained in:
Eugene Yurtsev 2024-08-28 22:22:57 -04:00 committed by GitHub
parent 31f55781b3
commit 83327ac43a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,18 +42,10 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "efcdb2b6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter your OpenAI API key: ········\n"
]
}
],
"outputs": [],
"source": [
"import getpass\n",
"import os\n",
@ -72,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "52fa46e8",
"metadata": {},
"outputs": [],
@ -122,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "6fb585dd",
"metadata": {
"tags": []
@ -144,17 +136,17 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"id": "85b49da0",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\"\\n\\nI'm an AI language model created by OpenAI, so I don't have feelings or emotions. But thank you for asking! How can I assist you today?\""
"'\\n\\nI am an AI and do not have emotions like humans do, so I am always functioning at my optimal level. Thank you for asking! How can I assist you today?'"
]
},
"execution_count": 5,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@ -173,16 +165,27 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "a641dbd9",
"metadata": {
"tags": []
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'\\nIch liebe Programmieren.'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from langchain_core.prompts import PromptTemplate\n",
"\n",
"prompt = PromptTemplate(\"How to say {input} in {output_language}:\\n\")\n",
"prompt = PromptTemplate.from_template(\"How to say {input} in {output_language}:\\n\")\n",
"\n",
"chain = prompt | llm\n",
"chain.invoke(\n",
@ -205,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "55142cec",
"metadata": {},
"outputs": [],
@ -221,8 +224,8 @@
]
},
{
"cell_type": "markdown",
"id": "73e207dd",
"cell_type": "raw",
"id": "2fd99e97-013f-4c28-bb47-426faa42a2cf",
"metadata": {},
"source": [
"## API reference\n",
@ -247,7 +250,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.11.4"
},
"vscode": {
"interpreter": {