@@ -285,12 +285,13 @@ Multiple images can be included using the `ollama::images` container.
285
285
286
286
```C++
287
287
ollama::image image = ollama::image::from_file("llama.jpg");
288
- ollama::image base64_image = ollama::image::from_base64_string("iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNkYPhfz0AEYBxVSF+FAP5FDvcfRYWgAAAAAElFTkSuQmCC ");
288
+ ollama::image image2 = ollama::image::from_file("another_llama.jpg ");
289
289
290
290
// Include a list of images here
291
- ollama::images images={image, base64_image };
291
+ ollama::images images={image, image2 };
292
292
293
- ollama::response response = ollama::generate("llava", "What do you see in this image?", options, images);
293
+ ollama::response response =
294
+ ollama::generate("llava", "What do you see in these images?", options, images);
294
295
```
295
296
296
297
### Basic Chat Generation
@@ -326,7 +327,7 @@ You can use a collection of messages in a chat. This allows chain-of-thought pro
326
327
327
328
```C++
328
329
ollama::message message1("user", "What are nimbus clouds?");
329
- ollama::message message2("assistant", "Nimbus clouds are dense, moisture-filled clouds that produce rain .");
330
+ ollama::message message2("assistant", "Nimbus clouds are dark rain clouds.");
330
331
ollama::message message3("user", "What are some other kinds of clouds?");
331
332
332
333
ollama::messages messages = {message1, message2, message3};
@@ -359,7 +360,8 @@ The `ollama::message` class can contain an arbitrary number of `ollama::image` o
359
360
```C++
360
361
ollama::image image = ollama::image::from_file("llama.jpg");
361
362
362
- // We can optionally include images with each message. Vision-enabled models will be able to utilize these.
363
+ // We can optionally include images with each message.
364
+ //Vision-enabled models will be able to utilize these.
363
365
ollama::message message_with_image("user", "What do you see in this image?", image);
364
366
ollama::response response = ollama::chat("llava", message_with_image);
365
367
```
@@ -376,7 +378,8 @@ Like any other generative function, options can be included during generation.
376
378
ollama::options options;
377
379
options[" num_predict" ] = 20 ;
378
380
379
- ollama::response response = ollama::generate_embeddings(" llama3:8b" , " Why is the sky blue?" , options);
381
+ ollama::response response =
382
+ ollama::generate_embeddings ("llama3:8b", "Why is the sky blue?", options);
380
383
```
381
384
382
385
### Debug Information
0 commit comments