#Explain code API help

22 messages · Page 1 of 1 (latest)

brave sun
#
{
  "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
  "object": "text_completion",
  "created": 1589478378,
  "model": "code-davinci-002",
  "choices": [
    {
      "text": "\n\nThis is indeed a test",
      "index": 0,
      "logprobs": null,
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}
#

this is the sample response they give in the api but I got something way different than that

smoky fiber
#

比特币

dire fjord
#

try looking in:

response.data.choices[0].text

for the text response

brave sun
#

i got this

#

do you have any clue

dire fjord
# brave sun i got this

What was the prompt you passed in? Semicolon may be all that it returned. Also tweak your temperature and see if anything else pops out

brave sun
#

System.out.print(“yes”)

#

I tried this

#

So it gives me the semicolon it left out?

#

🤔

#

I thought it will explain my code

#

I tried

#

“This is a test”

#

Too

#

It returns “This is a”

dire fjord
#

The api is working then, now it’s probably better to use the playground to come up with a prompt that will get you your desired outcome!

#

Try playing with max_tokens and stop sequences