diff --git a/src/Informedica.Ollama.Lib/Notebooks/Examples.ipynb b/src/Informedica.Ollama.Lib/Notebooks/Examples.ipynb deleted file mode 100644 index 0eb4a5a..0000000 --- a/src/Informedica.Ollama.Lib/Notebooks/Examples.ipynb +++ /dev/null @@ -1,25 +0,0 @@ -#!meta - -{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"name":"csharp"}]}} - -#!markdown - -# Ollama Lib Examples - -#!fsharp - -#load "load.fsx" - -open Informedica.Ollama.Lib -open Ollama.Operators - -#!markdown - -## Ask the hello world question - -#!fsharp - -"You are a helpful assistant" -|> init Ollama.Models.``openchat:7b`` ->>? "Why is the sky blue?" -|> Ollama.Conversation.print diff --git a/src/Informedica.Ollama.Lib/Notebooks/Examplles.ipynb b/src/Informedica.Ollama.Lib/Notebooks/Examplles.ipynb new file mode 100644 index 0000000..ce00827 --- /dev/null +++ b/src/Informedica.Ollama.Lib/Notebooks/Examplles.ipynb @@ -0,0 +1,111 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Ollama Lib Examples" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "dotnet_interactive": { + "language": "fsharp" + }, + "polyglot_notebook": { + "kernelName": "fsharp" + } + }, + "outputs": [], + "source": [ + "#load \"load.fsx\"\n", + "\n", + "open Informedica.Ollama.Lib\n", + "open Ollama.Operators" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The hello world of LLMs" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "dotnet_interactive": { + "language": "fsharp" + }, + "polyglot_notebook": { + "kernelName": "fsharp" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Starting conversation with openchat:7b\n", + "\n", + "Options:\n", + "{\"num_keep\":null,\"seed\":101,\"num_predict\":null,\"top_k\":null,\"top_p\":null,\"tfs_z\":null,\"typical_p\":null,\"repeat_last_n\":64,\"temperature\":0.0,\"repeat_penalty\":null,\"presence_penalty\":null,\"frequency_penalty\":null,\"mirostat\":0,\"mirostat_tau\":null,\"mirostat_eta\":null,\"penalize_newline\":null,\"stop\":[],\"numa\":null,\"num_ctx\":2048,\"num_batch\":null,\"num_gqa\":null,\"num_gpu\":null,\"main_gpu\":null,\"low_vram\":null,\"f16_kv\":null,\"vocab_only\":null,\"use_mmap\":null,\"use_mlock\":null,\"rope_frequency_base\":null,\"rope_frequency_scale\":null,\"num_thread\":null}\n", + "\n", + "Got an answer\n", + "\n", + "## Question:\n", + "You are a helpful assistant\n", + "\n", + "## Answer:\n", + "It seems like you may have accidentally typed \"Correct\" instead of your intended message. If you could provide me with the correct information or clarify what you'd like assistance with, I'll be more than happy to help!\n", + "\n", + "\n", + "\n", + "## Question:\n", + "Why is the sky blue?\n", + "\n", + "## Answer:\n", + "The sky appears blue to us because of a phenomenon called Rayleigh scattering. When sunlight passes through Earth's atmosphere, it interacts with the molecules and particles in the air. These interactions cause the shorter wavelength colors (like violet and blue) to scatter more than the longer wavelength colors (like red and yellow).\n", + "\n", + "Our eyes are most sensitive to blue light, so we perceive the sky as blue when we look up at it. However, during sunrise and sunset, the sunlight has to travel through a larger portion of the atmosphere, causing even more scattering and allowing the longer wavelength colors (like reds and oranges) to dominate, resulting in the beautiful colors we see during these times.\n", + "\n", + "\n" + ] + } + ], + "source": [ + "\"You are a helpful assistant\"\n", + "|> init Ollama.Models.``openchat:7b``\n", + ">>? \"Why is the sky blue?\"\n", + "|> Ollama.Conversation.print\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 +}