Skip to content

Commit 3ebc30c

Browse files
committed
Fix code example for OpenAI language model Chat Completions
1 parent b7baa59 commit 3ebc30c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,14 @@ let response = try await session.respond {
201201
}
202202
```
203203

204-
For structured outputs, use the Responses API:
204+
For OpenAI-compatible endpoints that use older Chat Completions API:
205205

206206
```swift
207207
let model = OpenAILanguageModel(
208+
baseURL: URL(string: "https://api.example.com")!,
208209
apiKey: apiKey,
209210
model: "gpt-4o-mini",
210-
useResponsesAPI: true
211+
apiVariant: .chatCompletions
211212
)
212213
```
213214

0 commit comments

Comments
 (0)