Skip to content

[minor] This library doesnt seem compatible with VCR #9

@palladius

Description

@palladius

Hi, I've tried to run VCR to intercept and cache Gemini calls, all good.
Tried with ollama and ollama-ai, the cache ends actually empty.
So I changed the code to a simple

  uri = URI('http://localhost:11434/api/generate')
  http = Net::HTTP.new(uri.host, uri.port)
  request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
  request.body = { model: model_to_use, prompt: prompt, stream: true }.to_json
  ...

and it worked like a charm.

Newbie question, is there a way to intercept ollama-ai requests with VCR?
I'm pretty sure this can be done without changing your code, but a snipper would be helpful.

Riccardo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions