Skip to content

Commit 13f8640

Browse files
committed
Update README
1 parent 00d470a commit 13f8640

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ollama Swift Client
22

3-
A Swift client library for interacting with the
3+
A Swift client library for interacting with the
44
[Ollama API](https://github.com/ollama/ollama/blob/main/docs/api.md).
55

66
## Requirements
@@ -21,11 +21,11 @@ Add the following to your `Package.swift` file:
2121

2222
## Usage
2323

24-
> [!NOTE]
25-
> The tests and example code for this library use the
24+
> [!NOTE]
25+
> The tests and example code for this library use the
2626
> [llama3.2](https://ollama.com/library/llama3.2) model.
2727
> Run the following command to download the model to run them yourself:
28-
>
28+
>
2929
> ```
3030
> ollama pull llama3.2
3131
> ```
@@ -53,8 +53,8 @@ do {
5353
model: "llama3.2",
5454
prompt: "Tell me a joke about Swift programming.",
5555
options: [
56-
"temperature": .number(0.7),
57-
"max_tokens": .number(100)
56+
"temperature": 0.7,
57+
"max_tokens": 100
5858
]
5959
)
6060
print(response.response)
@@ -69,14 +69,12 @@ Generate a chat completion:
6969

7070
```swift
7171
do {
72-
let messages: [ChatMessage] = [
73-
.init(role: .system, content: "You are a helpful assistant."),
74-
.init(role: .user, content: "In which city is Apple Inc. located?")
75-
]
76-
7772
let response = try await client.chat(
7873
model: "llama3.2",
79-
messages: messages
74+
messages: [
75+
.system("You are a helpful assistant."),
76+
.user("In which city is Apple Inc. located?")
77+
]
8078
)
8179
print(response.message.content)
8280
} catch {

0 commit comments

Comments
 (0)