This directly exposes the content string of the Message object, which makes handling the response from a call to the chat endpoint easier. Alternatively, Message could be a struct instead of an enum? Lmk what you think.
Example usage
let response = try await openAIClient.chats.create(
model: Model.GPT3.gpt3_5Turbo,
messages: [userMessage]
)
let message: Chat.Message = response.choices.first!.message
// .assistant(content: "This is message content.")
let content: String = message.content
// This is message content.
This directly exposes the content string of the Message object, which makes handling the response from a call to the chat endpoint easier. Alternatively, Message could be a struct instead of an enum? Lmk what you think.
Example usage