Assistant Randomly Generator Parameter Values To Call The Custom Function

Hi, I have a function created in the assistant called bookRooomFunction.

The assistant will auto-randomly generate the guest name and the mobile number when calling the bookRoomFunction.

I have also given the instructions “I must not continue if the guest’s name is unavailable. I will repeat to ask the guest’s name.
I must get the mobile number from the guest before calling bookRoomFunction.
I do not randomly generate or guess the names of guests
I do not randomly generate guest’s mobile numbers”

May I know how I could stop the assistant from generating guest names and mobile values randomly? Thanks!

Below is the bookRoomFunction schema.

  "name": "bookRoomFunction",
  "description": "Use this function When the guest wants to book the hotel room. guestname, mobileno, arrivaldate, departuredate, roomtype, and numberofrooms are compulsory.  Ask the guest to provide all the information before calling this function.",
  "parameters": {
    "type": "object",
    "properties": {
      "guestname": {
        "type": "string",
        "description": "Your name"
      "mobileno": {
        "type": "string",
        "description": "Mobile No."
      "arrivaldate": {
        "type": "string",
        "format": "date",
        "description": "Arrival date for the stay dd/mm/yyyy"
      "departuredate": {
        "type": "string",
        "format": "date",
        "description": "Departure date for the stay dd/mm/yyyy"
      "roomtype": {
        "type": "string",
        "description": "Room type for the stay, example: Deluxe King & Twin Room, Signature King & Twin Room"
      "numberofroom": {
        "type": "number",
        "description": "How many rooms to book"
      "breakfast": {
        "enum": [
    "required": [

That is hard to say without the prompt as well.
Try different models as well - they will respond different with different prompts.

For the love of everything please do not use GPT to make final calls for intricate processes like this.

Instead I highly, HIGHLY recommend using GPT as a gateway to a booking form with prefilled information. Or at the very least take over the chat with logic to confirm everything.

There’s a golden saying here: “This damn chatbot could have been a form”.

1 Like

Hi, if using GPT-3.5, any prompt will also probably generate the random value.
If GPT-4, this will be more stable, and ask the user for the name.

    "description": "Your name"

Try being more explicit in all your descriptions of the function and the parameters like instead of just Your name something like “The guest’s name, must be provided by the user, if the user has not provided a name you must prompt the user for a name before calling this function”? this is the description that the AI sees, so just “Your name” is a bit confusing maybe, but adding a similar style to every parameter would probably help~

Edit; You could also say that it must be provided exactly as the user gives it, and then you can programmatically, when the function is called, see if the given name exists in any of the user messages in the thread; else return a function error response saying that it must be a user provided name~

That means we still have to use the form-based input.
I wonder in what kind of scenario the chatting-based or form-based scenario will serve better.

If the assistant tends to generate random values even after already given the instructions not to do so, the usefulness of the assistant and the custom function will be lower.

The value passed over will be very difficult to validate because in my case, the auto-generated guest’s names are: “John Toe”, “John”, “Alice” etc

Hi, I have updated the function schema by changing the “description”: “Your name” to “The guest’name must be provided by the user *****”
And I test again the prompt, you can refer to the screenshot below:

The gpt-3.5 will generate the guest’s name automatically, refer the screenshot below:

In some cases, the gpt-3.5 will ask for the name for few times, and if the user try to prompt other question and later come back to request for making the reservation again, gpt-3.5 will auto generate the guest’s name and passing it to the custom function.

Personally I do not consider 3.5 smart enough to be user-facing, for 3.5 you really need to “hammer it in” for the AI to be consistent, if this prompt made a small improvement that tells you that you simply need to keep making the descriptions more expansive to cover all your failure cases.

but beyond improving the prompts and descriptions so that the AI understands in more detail, and upgrading to gpt-4, what you probably are looking at here is to follow up on my last suggestion where you say the name needs to be verbatim exactly the same as the user writes it, and then return a function response with “Error: The name must be provided by the user” if you are unable to programatically find the given name anywhere inside any of the user messages in the thread~

But as @RonaldGRuckus said you really need some form of verification step, it doesn’t need to be a prefilled form but it could simply be a popup that says “You are about to book: Name: X, Room: Y, Date(s): Z” with a (yes/no) or so~ and possibly return like “Confirmation dialogue declined by user” as a function response to facilitate follow-up requirements by the user

I would like to thank you @jlvanhulst @RonaldGRuckus @eslof.github for the advice given.

I have changed the way of implementation by showing the booking details for the guest to double confirm before proceeding with the final function call. However, gtp-3.5 is still not able to handle it correctly compared to gtp-4.

Gpt-4 is the best model to use for function calls . If only need retrieval I may use gpt-3.5 which is 10 times lower the price than gpt-4.

1 Like

Looks great, is that gpt-4-1106-preview aka gpt-4 turbo? while still more expensive than 3.5 it’s at least half the price of gpt-4.

And from what I can tell we’ve already seen two substantial price cuts and I don’t see this trend going away.

When GPT-5 shows up, GPT-4 will still be “good enough” for many purposes and will just keep becoming cheaper and faster so I think we can trust that price will go down.