Pizza bot, how does it know when order complete?

I went over the Pizzabot pretty fast-- so maybe it’s obvious. But, if this were really deployed in an application, how does the system know the order is “complete” ?

Do we monitor the chat for an/the “order” output to know to end the chat? If order is found then we parse it and submit it to presumably another system? Maybe put a special code word in it that we can check programmatically or always have it output a JSON structure with and “order” that we can check to see if it exists?

With second solution, we could update the json structure with a status.

Example seems incomplete unless I am missing something(?)

I can see a solution where we expand the solution to output a json with the order structure. It always outputs this structure which can be checked for the order. It is only instructed to fill when user confirms the order is complete?

At which one your observer code can grab the order and close the chat or switch the context to “status” context (checking on order).

Hi CurtisW,

You are right that the example is incomplete as the order is not processed. You suggestion to do this by using json and some observer / backend code makes sense to me.

1 Like

I have figured out one way to to do it working on another project. One could look into toolformer or langchain.

I developed and simulated a Prompt Engineering :stuck_out_tongue: solution in ChatGPT:

The keys points are the PizzzBot always asks for clarification the order is complete and issues a special / magic token and the final order. The system can then respond back with context on the order in the future. This could be expanded with an order ID and specific json structures.

I ran a few more tests-- sometimes it won’t emit the magic token. It can help to submit a context with each query. The other option is to have it submit the order with each response in a hidden json and have a status field on it which is marked as complete at the end of the order.

Nice to see your solution. Also interesting to see that sometimes it does not emit the token. I guess you could see emitting the token as a decision making step, which is not one of ChatGPT’s reliable functionalities. It may instead be an idea to include a ‘completed’ button in code separate from the dialogue system.