john.wallace Thank you for letting me know. I've updated the ZIP and Code tab with the code. I have no idea how I messed that up, but luckily, I was able to copy and paste all of the code from this example into the previous episode's code and it worked!
The object that you're calling insert_at is nil. Try logging what the item is to make sure that it is being found. It's currently returning nil, so you should trace upwards to see what the params[:sgid] is being set to. If the params[:sgid] is nil, then you go upwards from there to what's calling the controller and find out why it is nil.
This is considered the template or prompt format for communicating with the particular model that you're using. You can find more information and the specific templates on https://ollama.com/library/mixtral:latest. Since mistral is based on llama, it uses the [INST]prompt[/INST] template. If using gemma then the template would look something like <start_of_turn>model {{ .Response }}<end_of_turn>. It's basically formatting to yield better results from the model that is being used.
I didn't realize that langchainrb had included ollama. That's really cool.
Personally, I prefer to wrap my own classes around something like ollama since it does provide an API. And a lot of knowledge from those kinds of gems could be taken. I am planning an episode of vector searching with meilisearch, but am waiting for it to be released/stable so that could take a bit.
My main thing against something like langchainrb is if it is going to be a core part of my application. If it is, then I probably wouldn't want to rely on a gem to provide core functionality. If it is a nice-to-have feature, then I would add it to my list of considerations when making feature.