You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,11 @@ An open-source Swift package that simplifies LLM message completions, inspired b
20
20
-[Collaboration](#collaboration)
21
21
-[OpenAI Azure](OpenAI Azure)
22
22
-[OpenAI AIProxy](AIProxy)
23
+
-[Gemini](Gemini)
23
24
24
25
## Description
25
26
26
-
Call different LLM APIs using the OpenAI format; currently supporting [OpenAI](https://github.com/jamesrochabrun/SwiftOpenAI) and [Anthropic](https://github.com/jamesrochabrun/SwiftAnthropic), with more models, including Gemini, coming soon.
27
+
Call different LLM APIs using the OpenAI format; currently supporting [OpenAI](https://github.com/jamesrochabrun/SwiftOpenAI), [Anthropic](https://github.com/jamesrochabrun/SwiftAnthropic), and [Gemini](https://github.com/google-gemini/generative-ai-swift).
27
28
28
29
## Installation
29
30
@@ -54,12 +55,13 @@ First, import the PolyAI package:
54
55
importPolyAI
55
56
```
56
57
57
-
Then, define the LLM configurations. Currently, OpenAIand Anthropic are supported:
58
+
Then, define the LLM configurations. Currently, OpenAI, Anthropic and Gemini are supported:
58
59
59
60
```swift
60
61
let openAIConfiguration: LLMConfiguration = .openAI(.api(key: "your_openai_api_key_here"))
61
62
let anthropicConfiguration: LLMConfiguration = .anthropic(apiKey: "your_anthropic_api_key_here")
62
-
let configurations = [openAIConfiguration, anthropicConfiguration]
63
+
let geminiConfiguration: LLMConfiguration = .gemini(apiKey: "your_gemini_api_key_here")
64
+
let configurations = [openAIConfiguration, anthropicConfiguration, geminiConfiguration]
63
65
```
64
66
65
67
With the configurations set, initialize the service:
@@ -68,7 +70,7 @@ With the configurations set, initialize the service:
68
70
let service = PolyAIServiceFactory.serviceWith(configurations)
69
71
```
70
72
71
-
Now, you have access to both the OpenAIand Anthropic APIs in a single package, with Gemini coming soon! 🚀
73
+
Now, you have access to OpenAI, Anthropic and Gemini APIs in a single package. 🚀
0 commit comments