Closed asimcanyagiz closed 1 year ago
Ah, so you need to access firstChoice.text
in your example you're accessing the first Choice
but then printing result
which is the full object.
Yes but even like this its only write to terminal "ma", "Shadows Of The Night", "The night stretches long" in line by line. I think probably answer of api long than this because this answer doesn't mean anything.
My prompt to api ""bana ingilizce şiir yaz" is mean write to English poem
I don't know what elements do but there is a character limit for AI responses
Aha! Thank you for reporting, I found the issue. We need to allow consumers to pass in max_tokens
because the API defaults to 16. PR is coming now 👍🏼
New version released 1.1.1 - thanks again 👏🏼
When I make successfully api call response back like this.
"success(OpenAISwift.OpenAI(object: "text_completion", model: "text-davinci-003", choices: [OpenAISwift.Choice(text: "ma\n\nShadows Of The Night\n\nThe night stretches long, ")]))"
that's my code
func aichange(){ openAPI.sendCompletion(with: "bana ingilizce şiir yaz", model: .gpt3(.davinci)) { result in // Result<OpenAI, OpenAIError> // switch on result to get the response or error
The text "ma\n\nShadows Of The Night\n\nThe night stretches long, "