You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to convert to using the new Responses API, whilst the input does accept an array of items, it is not possible afaict to pass an array of items that include user/assistant messages.
I've since refactored the code I had back to ChatCompletions, but it was using InputItems and the error was:
I also printed out the input array it was sending:
[
SwiftOpenAI.InputItem(role: "user", content: [SwiftOpenAI.ContentItem.text(SwiftOpenAI.TextContent(text: "just wanted to test this works. tell me 3 dad jokes.", type: "input_text"))]),
SwiftOpenAI.InputItem(role: "assistant", content: [SwiftOpenAI.ContentItem.text(SwiftOpenAI.TextContent(text: "Sure thing! Here are three dad jokes for you:\n\n1. Why don\'t skeletons fight each other? \n They don\'t have the guts!\n\n2. What do you call cheese that isn\'t yours? \n Nacho cheese!\n\n3. Why did the scarecrow win an award? \n Because he was outstanding in his field!", type: "input_text"))]),
SwiftOpenAI.InputItem(role: "user", content: [SwiftOpenAI.ContentItem.text(SwiftOpenAI.TextContent(text: "ok, this is promising. I mean, not funny, but its good to see u can chat.", type: "input_text"))])
]
It might be the way I am working, but I feel like its more related to the library not setting the content type correctly for non-user messages.
The text was updated successfully, but these errors were encountered:
When trying to convert to using the new Responses API, whilst the input does accept an array of items, it is not possible afaict to pass an array of items that include user/assistant messages.
I've since refactored the code I had back to ChatCompletions, but it was using InputItems and the error was:
I also printed out the input array it was sending:
It might be the way I am working, but I feel like its more related to the library not setting the content type correctly for non-user messages.
The text was updated successfully, but these errors were encountered: