Skip to content

Commit

Permalink
Merge pull request #133 from lzell/fix-readme-audiospeech-example
Browse files Browse the repository at this point in the history
Fix: Readme typos in create speech example
  • Loading branch information
ingvarus-bc committed Dec 21, 2023
2 parents 1b1765b + dca606b commit 497266a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public struct AudioSpeechQuery: Codable, Equatable {
public let model: Model // tts-1 or tts-1-hd
public let input: String
public let voice: AudioSpeechVoice
public let response_format: AudioSpeechResponseFormat
public let responseFormat: AudioSpeechResponseFormat
public let speed: String? // Initializes with Double?
//...
}
Expand All @@ -555,13 +555,13 @@ public let audioData: Data?
**Example:**

```swift
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, response_format: .mp3, speed: 1.0)
let query = AudioSpeechQuery(model: .tts_1, input: "Hello, world!", voice: .alloy, responseFormat: .mp3, speed: 1.0)

openAI.audioCreateSpeech(query: query) { result in
// Handle response here
}
//or
let result = try await openAI.audioTranscriptions(query: query)
let result = try await openAI.audioCreateSpeech(query: query)
```
[OpenAI Create Speech – Documentation](https://platform.openai.com/docs/api-reference/audio/createSpeech)

Expand Down

0 comments on commit 497266a

Please sign in to comment.