Deno, LangChain, Ollama, and structured outputs
When working with LLMs programmatically, it’s important to receive a structured response from the model. This makes it easier to parse and use the output in your application. In this post, we’ll walk through how to define a schema using zod and query an Ollama model with the help of LangChain. For simplicity, we’ll use Deno, so make sure it’s installed on your system. You can find the full code here: https://github.com/hosainnet/ai-experiments/tree/main/deno-ollama-structured-response — let’s break it down. ...