From a17f349daa0609402c51205929b9f2b32f6fb1bb Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 24 Apr 2024 16:12:38 +0800 Subject: feat: support customizing `top_p` parameter (#434) --- src/client/ollama.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/client/ollama.rs') diff --git a/src/client/ollama.rs b/src/client/ollama.rs index 055730a..434e487 100644 --- a/src/client/ollama.rs +++ b/src/client/ollama.rs @@ -122,6 +122,7 @@ fn build_body(data: SendData, model: &Model) -> Result { let SendData { messages, temperature, + top_p, stream, } = data; @@ -185,6 +186,9 @@ fn build_body(data: SendData, model: &Model) -> Result { if let Some(temperature) = temperature { body["options"]["temperature"] = temperature.into(); } + if let Some(top_p) = top_p { + body["options"]["top_p"] = top_p.into(); + } Ok(body) } -- cgit v1.2.3