mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
examples: reorder parameters and add options configuration in example
- Move `think` parameter after `messages` for better parameter ordering - Add `options` dict with temperature, top_p, and top_k settings - Add comment showing think parameter accepts "low", true, or false
This commit is contained in:
parent
a3396e310a
commit
e6c8210330
@ -159,10 +159,15 @@ def div(a: float, b: float) -> float:
|
||||
if __name__ == "__main__":
|
||||
from ollama import chat
|
||||
|
||||
response, messages = ollama_automatic_function_calling(
|
||||
response, messages = ollama_chat_automatic_function_calling(
|
||||
chat,
|
||||
model="glm-5:cloud",
|
||||
think="low",
|
||||
tools=[add, sub, mul, div],
|
||||
messages=[{"role": "user", "content": "这个数学题:4+7*9/6是多少?"}],
|
||||
think="low", # or true, false
|
||||
options={
|
||||
"temperature": 1,
|
||||
"top_p": 1.0,
|
||||
"top_k": 60,
|
||||
},
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user