API /answers clarifications needed

Context: we are trying to build a chatbot for a help desk. We have multiple documents that form the KB of our staff. Our intent is to make users chat with the bot before reaching us only after they are not satisfied with the bot’s answers.

  1. From the documentation the “stop” parameter in the /answers API call seems to refer only to text generation (of the answer of course). But these stop sequences are intended to be found in the file referenced in the call by the “file” param or what?

  2. If the file referenced in the call contains \n to separate text lines, should we include the \n as one of the four-stop sequences? Or this will prevent a good output?

  3. Generally speaking is it better to have a file composed of multiple lines separated by \n or should we produce a file like:
    {"text": "lorem ipsum line 1...", "metadata": ""}
    {"text": "lorem ipsum line 2...", "metadata": ""}
    ...

  4. If the previous questions seem nonsense to you, can you provide example usages or use cases of the “stop” param?

  5. Regarding the “max_rerank” param. We are not sure how it is intended to be used. With “documents” do you mean the lines in the file like in the above example or does each “stop” sequence produces a different document for GPT-3?

  6. We have noticed that sometimes in the answer the --- or === sequence is produced after the first sentence. Sometimes after --- or === we can read Context: ... with some contextual information up to the max_tokens value. It seems that it produces this output only with the “curie” model. Is a normal behaviour of such a model? Is there any documentation about this?
    We have also tried putting as stop sequences ["---", "==="] and we have observed that this trailing output after the first output sentence is omitted.

Can you give some insights into these behaviours? We are a little confused.

All the calls we have made had the params temperature = 0, logit_bias = null, n = 1, logprobs = null.

  1. To simulate a Q&A dialogue we have tried to reinject the previous questions and answers in the question “param”:
    Eg.
    User: Can you help to reset my pw?
    GPT3: Yes, of course.
    User: How?
    GPT3: Please go to this page https://awebpage and fill out the form following the instructions.

In this particular example our second question is sent to /answer in this way: question="User: Can you help to reset my pw?\nGPT3: Yes, of course.\nUser: How?"

GPT-3 seems to understand that he should continue answering by taking all the previous discussions as input. Are we doing right?

Thank you very much in advance for any help.

Kind regards,
Stefano