-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ollama function calling, but is slowgit add -A
- Loading branch information
Casper Bollen
authored and
Casper Bollen
committed
Mar 10, 2024
1 parent
9ee6af1
commit 7299fed
Showing
5 changed files
with
266 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"dotnet_interactive": { | ||
"language": "fsharp" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelName": "fsharp" | ||
} | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"#load \"load.fsx\"\n", | ||
"\n", | ||
"open Newtonsoft.Json\n", | ||
"\n", | ||
"open Informedica.Ollama.Lib\n", | ||
"open Ollama.Operators" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": { | ||
"dotnet_interactive": { | ||
"language": "fsharp" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelName": "fsharp" | ||
} | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"<functioncall>{\"name\": \"get_the_weather\", \"arguments\": {\"city\": \"Seattle\", \"state\": \"Washington\"}}\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"let tools =\n", | ||
" {|\n", | ||
" city = {|\n", | ||
" ``type`` = \"string\"\n", | ||
" description = \"The city to get the weather for\"\n", | ||
" |}\n", | ||
" state = {|\n", | ||
" ``type`` = \"string\"\n", | ||
" description = \"The state to get the weather for\"\n", | ||
" |}\n", | ||
" |}\n", | ||
" |> Ollama.Tool.create\n", | ||
" \"get_weather\"\n", | ||
" \"Get the weather.\"\n", | ||
" [\"city\"; \"state\"]\n", | ||
" |> List.singleton\n", | ||
"\n", | ||
"\"What is the weather in Seattle?\"\n", | ||
"|> Ollama.Message.user\n", | ||
"|> Ollama.extract\n", | ||
" tools\n", | ||
" \"joefamous/firefunction-v1:q3_k\"\n", | ||
" []\n", | ||
"|> Async.RunSynchronously\n", | ||
"|> function\n", | ||
" | Ollama.Response.Success resp ->\n", | ||
" resp.message.content\n", | ||
" |> printfn \"%s\"\n", | ||
" | _ -> ()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".NET (F#)", | ||
"language": "F#", | ||
"name": ".net-fsharp" | ||
}, | ||
"language_info": { | ||
"name": "polyglot-notebook" | ||
}, | ||
"polyglot_notebook": { | ||
"kernelInfo": { | ||
"defaultKernelName": "fsharp", | ||
"items": [ | ||
{ | ||
"aliases": [], | ||
"languageName": "fsharp", | ||
"name": "fsharp" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.