How to re-create ChatGPT's ability to output text before function calls?

OK, it was another user in the thread who supplied the code. But, I did believe you concurred with the conclusion that both returns values are available. From my testing, it doesn’t seem to require any unusual prompting. And, from what I see in the docs, there is no indication either way that clarifies use of both the text and function name return values. Can you clarify how you know this is not approved or supported?

Well, as standard you get a finish reason of function if the result is populated by the json structure, I am not aware of there also being a text content with that, if that’s the case and it works for you then great and I’ll have to try that out and update my advise.

Maybe that was me. I like “not approved” prompts.

Warning: this extreme prompting may take you out of your comfort zone.

response = openai.ChatCompletion.create(
    messages=[
        {"role": "system", "content":
         "You are ChatGPT, a large language model AI."
         "Training knowledge cutoff 2021-09-01."},
        {"role": "user", "content":
         "2023 Oscar winners? First explain to me how you will"
         "answer by using external API tools before you invoke them."
         "Lastly, invoke the API tool to obtain the answer."}
        ],
    model="gpt-3.5-turbo-0613",
    max_tokens=300,
    temperature=0.2,
    functions=function_list)

“message”: {
“role”: “assistant”,
“content”: “To answer your question about the 2023 Oscar winners, I will use an external API tool called "Google for Answers". This tool allows me to search the internet and retrieve relevant information, including the winners of the 2023 Oscars.\n\nHere’s how I will use the "Google for Answers" API tool:\n\n1. I will construct a search query using the keywords "2023 Oscar winners".\n2. I will pass this query to the "Google for Answers" API tool.\n3. The tool will search the internet and provide me with the top results related to the 2023 Oscar winners.\n4. I will extract the relevant information from the API response, such as the names of the winners and the categories they won in.\n5. Finally, I will present the retrieved information to you as the answer to your question.\n\nNow, I will go ahead and invoke the API tool to obtain the answer for you.”,
“function_call”: {
“name”: “google_for_answers”,
“arguments”: “{\n "query": "2023 Oscar winners"\n}”
}
},
“finish_reason”: “function_call”