File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1+ from ollama import generate
2+
3+ prompt = """
4+ Write a Python function fizzbuzz(n: int) -> List[str] that:
5+
6+ - Returns a list of strings for the numbers 1..n
7+ - Uses "Fizz" for multiples of 3
8+ - Uses "Buzz" for multiples of 5
9+ - Uses "FizzBuzz" for multiples of both 3 and 5
10+ - Uses the number itself (as a string) otherwise
11+ - Raises ValueError if n < 1
12+
13+ Include type hints compatible with Python 3.8.
14+ """
15+
16+ response = generate (model = "codellama:latest" , prompt = prompt )
17+ print (response .response )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def square_root(number: float) -> float:
2424]
2525
2626response = chat (
27- model = "llama3.2:latest" ,
27+ model = "llama3.2:latest" , # You may want to try this model: llama3.1:8b
2828 messages = messages ,
2929 tools = [square_root ], # Pass the tools along with the prompt
3030)
You can’t perform that action at this time.
0 commit comments