Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated integration doc for aleph alpha #16844

Merged
merged 9 commits into from
Feb 2, 2024
35 changes: 21 additions & 14 deletions docs/docs/integrations/llms/aleph_alpha.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"id": "0cb0f937-b610-42a2-b765-336eed037031",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdin",
"name": "stdout",
"output_type": "stream",
"text": [
" ········\n"
"········\n"
]
}
],
Expand All @@ -51,21 +51,20 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"id": "6fb585dd",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from langchain.chains import LLMChain\n",
"from langchain.prompts import PromptTemplate\n",
"from langchain_community.llms import AlephAlpha"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"id": "f81a230d",
"metadata": {
"tags": []
Expand All @@ -81,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"id": "f0d26e48",
"metadata": {
"tags": []
Expand All @@ -98,19 +97,19 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"id": "6811d621",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"llm_chain = LLMChain(prompt=prompt, llm=llm)"
"llm_chain = prompt | llm"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 8,
"id": "3058e63f",
"metadata": {
"tags": []
Expand All @@ -119,19 +118,27 @@
{
"data": {
"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": {},
"output_type": "execute_result"
}
],
"source": [
"question = \"What is AI?\"\n",
"\n",
"llm_chain.run(question)"
"llm_chain.invoke({\"question\": question})"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a3544eff",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -150,7 +157,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.9.12"
},
"vscode": {
"interpreter": {
Expand Down
Loading