docs: Updated integration doc for aleph alpha (#16844)

Description: Updated doc for llm/aleph_alpha with new functions: invoke.
Changed structure of the document to match the required one.
Issue: https://github.com/langchain-ai/langchain/issues/15664
Dependencies: None
Twitter handle: None

---------

Co-authored-by: Radhakrishnan Iyer <radhakrishnan.iyer@ibm.com>
This commit is contained in:
Radhakrishnan 2024-02-02 22:58:06 +05:30 committed by GitHub
parent cc17334473
commit 3b0fa9079d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,14 +27,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 1,
"id": "0cb0f937-b610-42a2-b765-336eed037031", "id": "0cb0f937-b610-42a2-b765-336eed037031",
"metadata": { "metadata": {
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [
{ {
"name": "stdin", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"········\n" "········\n"
@ -51,21 +51,20 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 2,
"id": "6fb585dd", "id": "6fb585dd",
"metadata": { "metadata": {
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"from langchain.chains import LLMChain\n",
"from langchain.prompts import PromptTemplate\n", "from langchain.prompts import PromptTemplate\n",
"from langchain_community.llms import AlephAlpha" "from langchain_community.llms import AlephAlpha"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 3,
"id": "f81a230d", "id": "f81a230d",
"metadata": { "metadata": {
"tags": [] "tags": []
@ -81,7 +80,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 4,
"id": "f0d26e48", "id": "f0d26e48",
"metadata": { "metadata": {
"tags": [] "tags": []
@ -98,19 +97,19 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 5,
"id": "6811d621", "id": "6811d621",
"metadata": { "metadata": {
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"llm_chain = LLMChain(prompt=prompt, llm=llm)" "llm_chain = prompt | llm"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 8,
"id": "3058e63f", "id": "3058e63f",
"metadata": { "metadata": {
"tags": [] "tags": []
@ -119,10 +118,10 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"' Artificial Intelligence (AI) is the simulation of human intelligence processes by machines, especially computer systems.\\n'" "' Artificial Intelligence is the simulation of human intelligence processes by machines.\\n\\n'"
] ]
}, },
"execution_count": 10, "execution_count": 8,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -130,8 +129,16 @@
"source": [ "source": [
"question = \"What is AI?\"\n", "question = \"What is AI?\"\n",
"\n", "\n",
"llm_chain.run(question)" "llm_chain.invoke({\"question\": question})"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a3544eff",
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "metadata": {
@ -150,7 +157,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.9.12"
}, },
"vscode": { "vscode": {
"interpreter": { "interpreter": {