Help - Cannot convert value of type 'String' to expected argument type 'OpenAISwift.Config'

Newbie coder here, using most recent Xcode and iOS 17 to build an app using Adam Rushy openaiswift tutorial. The app is entirely built and everything functions except this:

Cannot convert value of type 'String' to expected argument type 'OpenAISwift.Config'

So I cannot build the project, it refers to this line of code:

func setup () { client = OpenAISwift(config: "removed api key for public view)") } func send(text: String,

in the tutorial it said use authToken which Xcode said was wrong and must be config, so I changed it but it still doesn't work.

Any help appreciated

Use this instead:

func setup() { let apiConfig = OpenAISwift.Config.makeDefaultOpenAI(apiKey: "sk-YOUR API KEY") client = OpenAISwift(config: apiConfig) }

Help - Cannot convert value of type 'String' to expected argument type 'OpenAISwift.Config'
 
 
Q