Skip to content

Commit

Permalink
cr
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Aug 1, 2024
1 parent 8ce7dcb commit e1ca460
Showing 1 changed file with 47 additions and 24 deletions.
71 changes: 47 additions & 24 deletions docs/core_docs/docs/integrations/chat/ollama.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@
"source": [
"## Instantiation\n",
"\n",
"Now we can instantiate our model object and generate chat completions:\n",
"\n",
"- TODO: Update model instantiation with relevant params."
"Now we can instantiate our model object and generate chat completions:"
]
},
{
Expand All @@ -106,9 +104,7 @@
"id": "2b4f3e15",
"metadata": {},
"source": [
"## Invocation\n",
"\n",
"- TODO: Run cells so output can be seen."
"## Invocation"
]
},
{
Expand Down Expand Up @@ -187,9 +183,7 @@
"source": [
"## Chaining\n",
"\n",
"We can [chain](/docs/how_to/sequence/) our model with a prompt template like so:\n",
"\n",
"- TODO: Run cells so output can be seen."
"We can [chain](/docs/how_to/sequence/) our model with a prompt template like so:"
]
},
{
Expand Down Expand Up @@ -263,25 +257,46 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "d2502c0d",
"metadata": {},
"outputs": [
{
"name": "stderr",
"name": "stdout",
"output_type": "stream",
"text": [
"unexpected error: Error: Unexpected pending rebuildTimer\n",
" at sys.setTimeout (/Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/converter.js:111:19)\n",
" at scheduleProgramUpdate (/Users/bracesproul/.npm-global/lib/node_modules/tslab/node_modules/@tslab/typescript-for-tslab/lib/typescript.js:122735:35)\n",
" at onSourceFileChange (/Users/bracesproul/.npm-global/lib/node_modules/tslab/node_modules/@tslab/typescript-for-tslab/lib/typescript.js:122876:7)\n",
" at /Users/bracesproul/.npm-global/lib/node_modules/tslab/node_modules/@tslab/typescript-for-tslab/lib/typescript.js:122868:56\n",
" at updateContent (/Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/converter.js:601:9)\n",
" at Object.convert (/Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/converter.js:252:9)\n",
" at Object.execute (/Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/executor.js:138:38)\n",
" at JupyterHandlerImpl.handleExecuteImpl (/Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/jupyter.js:223:38)\n",
" at /Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/jupyter.js:181:57\n",
" at async JupyterHandlerImpl.handleExecute (/Users/bracesproul/.npm-global/lib/node_modules/tslab/dist/jupyter.js:181:21)\n"
"AIMessage {\n",
" \"content\": \"\",\n",
" \"additional_kwargs\": {},\n",
" \"response_metadata\": {\n",
" \"model\": \"llama3-groq-tool-use\",\n",
" \"created_at\": \"2024-08-01T18:43:13.2181Z\",\n",
" \"done_reason\": \"stop\",\n",
" \"done\": true,\n",
" \"total_duration\": 2311023875,\n",
" \"load_duration\": 1560670292,\n",
" \"prompt_eval_count\": 177,\n",
" \"prompt_eval_duration\": 263603000,\n",
" \"eval_count\": 30,\n",
" \"eval_duration\": 485582000\n",
" },\n",
" \"tool_calls\": [\n",
" {\n",
" \"name\": \"get_current_weather\",\n",
" \"args\": {\n",
" \"location\": \"San Francisco, CA\"\n",
" },\n",
" \"id\": \"c7a9d590-99ad-42af-9996-41b90efcf827\",\n",
" \"type\": \"tool_call\"\n",
" }\n",
" ],\n",
" \"invalid_tool_calls\": [],\n",
" \"usage_metadata\": {\n",
" \"input_tokens\": 177,\n",
" \"output_tokens\": 30,\n",
" \"total_tokens\": 207\n",
" }\n",
"}\n"
]
}
],
Expand Down Expand Up @@ -325,10 +340,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "759924f6",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{ location: 'San Francisco, CA' }\n"
]
}
],
"source": [
"import { ChatOllama } from \"@langchain/ollama\";\n",
"import { z } from \"zod\";\n",
Expand Down

0 comments on commit e1ca460

Please sign in to comment.