taketwo / llm-ollama

LLM plugin providing access to local Ollama models using HTTP API
Apache License 2.0
147 stars 8 forks source link

Change type of stop sequences option to list #11

Closed Mrmaxmeier closed 5 months ago

Mrmaxmeier commented 5 months ago

This would previously fail with ollama._types.ResponseError: option "stop" must be of type array or a validation error in pydantic.

taketwo commented 5 months ago

How should this option be specified? When I execute something like

llm "How much is 2 + 2?" -o stop "2"

I get

Error: option "stop" must be of type array

on current HEAD and

Error: stop
  Input should be a valid list

with your commit.

Mrmaxmeier commented 5 months ago

Hm, I'm using the Python API (prompt(..., stop=["test"])). Wiring this up to the CLI probably requires an additional change in the command flag parsing logic.