efugier / smartcat

Putting a brain behind `cat`🐈‍⬛ Integrating language models in the Unix commands ecosystem through text streams.
https://crates.io/crates/smartcat
Apache License 2.0
76 stars 9 forks source link

Failed to make API request if ollama generation takes too long #22

Closed vavakado closed 6 days ago

vavakado commented 3 months ago

This problem occurs if ollama does not generate full answer before timeout.

> sc "hello, can you write a cli util in python that tells if it's night or day"
Failed to make API request: reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(11434), path: "/api/chat", query: None, fragment: None }, source: TimedOut }

For context, everything if working if i use a simpler prompt.

efugier commented 3 months ago

Interesting thanks for reporting! What would be you preferred solution for this? Being able to config a specific timeout value? I can do that.

vavakado commented 3 months ago

I think that an option in configs would be more usable for someone with slow hardware, so that they don't have to type additional option every time.

efugier commented 2 months ago

That's actually what I meant :slightly_smiling_face:

I'll get to it as soon as I get some time on my hands!

vavakado commented 6 days ago

I probably should close this as the PR #24 was merged

efugier commented 5 days ago

Good call, thanks @vavakado!