Skip to content

Commit 244c13a

Browse files
committed
Update README.md
1 parent bf2757b commit 244c13a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ You just type in any your idea and AI will give you an art solution
2222

2323
### 2. Override the default loader at Environment with you apiKey
2424
```swift
25-
@Environment(\.openAIDefaultLoader) var loader : OpenAIDefaultLoader
26-
27-
let apiKey = "*******************"
28-
let endpoint = OpenAIImageEndpoint.get(with: apiKey)
29-
let loader = OpenAIDefaultLoader(endpoint: endpoint)
30-
31-
ContentView()
32-
.environment(\.openAIDefaultLoader, loader)
25+
let apiKey = "your API KEY"
26+
let endpoint = OpenAIImageEndpoint.get(with: apiKey)
27+
let loader = OpenAIDefaultLoader(endpoint: endpoint)
28+
OpenAIDefaultLoaderKey.defaultValue = loader
3329
```
3430

3531
### 3. Add **OpenAIAsyncImage** to your code

0 commit comments

Comments
 (0)