Skip to content

Commit 7078ec3

Browse files
authored
Syntax highlighting for Gemini section of readme
1 parent 3b691c6 commit 7078ec3

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

README.md

+18-11
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ You can use all of the OpenAI snippets aboves with one change. Initialize the Op
10641064

10651065
### How to generate text content with Gemini
10661066

1067+
```swift
10671068
import AIProxy
10681069

10691070
/* Uncomment for BYOK use cases */
@@ -1115,10 +1116,11 @@ You can use all of the OpenAI snippets aboves with one change. Initialize the Op
11151116
} catch {
11161117
print("Could not create Gemini generate content request: \(error.localizedDescription)")
11171118
}
1118-
1119+
```
11191120

11201121
### How to make a tool call with Gemini
11211122

1123+
```swift
11221124
import AIProxy
11231125

11241126
/* Uncomment for BYOK use cases */
@@ -1206,7 +1208,7 @@ You can use all of the OpenAI snippets aboves with one change. Initialize the Op
12061208
} catch {
12071209
print("Could not create Gemini tool (function) call: \(error.localizedDescription)")
12081210
}
1209-
1211+
```
12101212

12111213
### How to make a search grounding call with Gemini
12121214

@@ -1217,6 +1219,7 @@ account for the API keys you use [here](https://aistudio.google.com/app/apikey).
12171219
Consider applying to [google for startups](https://cloud.google.com/startup?hl=en) to gain
12181220
credits that you can put towards Gemini.
12191221

1222+
```swift
12201223
import AIProxy
12211224

12221225
/* Uncomment for BYOK use cases */
@@ -1270,6 +1273,7 @@ credits that you can put towards Gemini.
12701273
} catch {
12711274
print("Could not create Gemini grounding search request: \(error.localizedDescription)")
12721275
}
1276+
```
12731277

12741278
### How to make a google search grounding call with Gemini 2.0
12751279

@@ -1346,11 +1350,11 @@ credits that you can put towards Gemini.
13461350
}
13471351
```
13481352

1349-
13501353
### How to transcribe audio with Gemini
13511354

13521355
Add a file called `helloworld.m4a` to your Xcode assets before running this sample snippet:
13531356

1357+
```swift
13541358
import AIProxy
13551359

13561360
/* Uncomment for BYOK use cases */
@@ -1411,13 +1415,13 @@ Add a file called `helloworld.m4a` to your Xcode assets before running this samp
14111415
} catch {
14121416
print("Could not create transcript with Gemini: \(error.localizedDescription)")
14131417
}
1414-
1418+
```
14151419

14161420
### How to use images in the prompt to Gemini
14171421

14181422
Add a file called 'my-image.jpg' to Xcode app assets. Then run this snippet:
14191423

1420-
1424+
```swift
14211425
import AIProxy
14221426

14231427
/* Uncomment for BYOK use cases */
@@ -1490,13 +1494,14 @@ Add a file called 'my-image.jpg' to Xcode app assets. Then run this snippet:
14901494
} catch {
14911495
print("Could not create Gemini generate content request: \(error.localizedDescription)")
14921496
}
1493-
1497+
```
14941498

14951499
### How to upload a video file to Gemini temporary storage
14961500

14971501
Add a file called `my-movie.mov` to your Xcode assets before running this sample snippet.
14981502
If you use a file like `my-movie.mp4`, change the mime type from `video/quicktime` to `video/mp4` in the snippet below.
14991503

1504+
```swift
15001505
import AIProxy
15011506

15021507
/* Uncomment for BYOK use cases */
@@ -1534,12 +1539,13 @@ If you use a file like `my-movie.mp4`, change the mime type from `video/quicktim
15341539
} catch {
15351540
print("Could not upload file to Gemini: \(error.localizedDescription)")
15361541
}
1537-
1542+
```
15381543

15391544
### How to convert video contents to text with Gemini
15401545

15411546
Use the file URL returned from the snippet above.
15421547

1548+
```swift
15431549
import AIProxy
15441550

15451551
let fileURL = URL(string: "url-from-snippet-above")!
@@ -1606,10 +1612,11 @@ Use the file URL returned from the snippet above.
16061612
} catch {
16071613
print("Could not create Gemini vision request: \(error.localizedDescription)")
16081614
}
1609-
1615+
```
16101616

16111617
### How to delete a temporary file from Gemini storage
16121618

1619+
```swift
16131620
import AIProxy
16141621

16151622
let fileURL = URL(string: "url-from-snippet-above")!
@@ -1633,7 +1640,7 @@ Use the file URL returned from the snippet above.
16331640
} catch {
16341641
print("Could not delete file from Gemini temporary storage: \(error.localizedDescription)")
16351642
}
1636-
1643+
```
16371644

16381645
### How to use structured ouputs with Gemini
16391646

@@ -1793,7 +1800,7 @@ Use the file URL returned from the snippet above.
17931800

17941801
### How to generate an image with Gemini
17951802

1796-
```
1803+
```swift
17971804
import AIProxy
17981805

17991806
/* Uncomment for BYOK use cases */
@@ -1853,7 +1860,7 @@ Use the file URL returned from the snippet above.
18531860
}
18541861
```
18551862

1856-
### How to generate an image with Imagen
1863+
### How to generate an image with Gemini and Imagen
18571864

18581865
```swift
18591866
import AIProxy

0 commit comments

Comments
 (0)