Skip to content

Commit c896f8e

Browse files
Update README.md
1 parent fb88e33 commit c896f8e

File tree

1 file changed

+45
-18
lines changed

1 file changed

+45
-18
lines changed

README.md

+45-18
Original file line numberDiff line numberDiff line change
@@ -86,44 +86,71 @@ The definitive, open-source Swift framework for interfacing with generative AI.
8686

8787
## Initialize an AI Client
8888

89-
Initialize an instance of `LLMRequestHandling` with an API provider of your choice. Here are some examples:
89+
Initialize an instance of an AI API provider of your choice. Here are some examples:
9090

9191
```swift
9292
import AI
9393

94+
// OpenAI / GPT
9495
import OpenAI
95-
import Anthropic
96-
import Mistral
9796

98-
// OpenAI / GPT
99-
let client: any LLMRequestHandling = OpenAI.Client(apiKey: "YOUR_KEY")
97+
let client: OpenAI.Client = OpenAI.Client(apiKey: "YOUR_API_KEY")
98+
10099
// Anthropic / Claude
101-
let client: any LLMRequestHandling = Anthropic.Client(apiKey: "YOUR_KEY")
100+
import Anthropic
101+
102+
let client: Anthropic.Client = Anthropic.Client(apiKey: "YOUR_API_KEY")
103+
102104
// Mistral
103-
let client: any LLMRequestHandling = Mistral.Client(apiKey: "YOUR_KEY")
105+
import Mistral
106+
107+
let client: Mistral.Client = Mistral.Client(apiKey: "YOUR_API_KEY")
108+
109+
// Groq
110+
import Groq
111+
112+
let client: Groq.Client = Groq.Client(apiKey: "YOUR_API_KEY")
113+
114+
// ElevenLabs
115+
import ElevenLabs
116+
117+
let client: ElevenLabs.Client = ElevenLabs.Client(apiKey: "YOUR_API_KEY")
118+
104119
```
105120

106-
You can now use `client` as an interface to an LLM as provided by the underlying provider.
121+
You can now use `client` as an interface to the supported providers.
107122

108123
## Supported Models
109124
Each AI Client supports multiple models. For example:
110125

111126
```swift
112127
// OpenAI Models
113-
let gpt_4o_Model = OpenAI.Model.gpt_4o
114-
let gpt_4_Model = OpenAI.Model.gpt_4
115-
let gpt_3_5_Model = OpenAI.Model.gpt_3_5
116-
let otherGPTModels = OpenAI.Model.chat(.gpt_OTHER_MODEL_OPTIONS)
128+
let gpt_4o_Model: OpenAI.Model = .gpt_4o
129+
let gpt_4_Model: OpenAI.Model = .gpt_4
130+
let gpt_3_5_Model: OpenAI.Model = .gpt_3_5
131+
let otherGPTModels: OpenAI.Model = .chat(.gpt_OTHER_MODEL_OPTIONS)
117132

118133
// Anthropic Models
119-
let caludeHaikuModel = Anthropic.Model.haiku
120-
let claudeSonnetModel = Anthropic.Model.sonnet
121-
let claudeOpusModel = Anthropic.Model.opus
134+
let caludeHaikuModel: Anthropic.Model = .haiku
135+
let claudeSonnetModel: Anthropic.Model = .sonnet
136+
let claudeOpusModel: Anthropic.Model = .opus
122137

123138
// Mistral Models
124-
let mistralTiny = Mistral.Model.mistral_tiny
125-
let mistralSmall = Mistral.Model.mistral_small
126-
let mistralMedium = Mistral.Model.mistral_medium
139+
let mistralTiny: Mistral.Model = .mistral_tiny
140+
let mistralSmall: Mistral.Model = Mistral.Model.mistral_small
141+
let mistralMedium: Mistral.Model = Mistral.Model.mistral_medium
142+
143+
// Groq Models
144+
let gemma_7b: Groq.Model = .gemma_7b
145+
let llama3_8b: Groq.Model = .llama3_8b
146+
let llama3_70b: Groq.Model = .llama3_70b
147+
let mixtral_8x7b: Groq.Model = .mixtral_8x7b
148+
149+
// ElevenLabs Models
150+
let multilingualV2: ElevenLabs.Model = .MultilingualV2
151+
let turboV2: ElevenLabs.Model = .TurboV2 // English
152+
let multilingualV1: ElevenLabs.Model = .MultilingualV1
153+
let englishV1: ElevenLabs.Model = .EnglishV1
127154
```
128155

129156
## Completions

0 commit comments

Comments
 (0)