stanfordnlp/cocoa

How to restrict being selected scenarios in craigslistbargain

Mocchaso opened this issue · 3 comments

I'd like to select only the scenario that rulebased is the seller and human is the buyer.
However, I can't understand how to do this.

What should I change in craigslistbargain to restrict being selected scenarios?

scenarios are separated from the agents. when you build the session, you can check if kb.role == 'seller' and give that kb to the rulebased seller.

Thank you for commenting.

I could restrict a scenario to rulebased is seller.

The following error occurred, but I guess that this is no problem because this error occurs when the selected scenario is not rulebased: seller.
Furthermore, backend.py select a scenario until being selected a scenario of rulebased: seller.

Is my thought correct...?

cocoa_src/cocoa/web/main/backend.py, in line 320
  config = bot_session.config
AttributeError: 'NoneType' object has no attribute 'config'

Hmm. I'm not sure that I fully understand your thoughts. But what I was suggesting is that you don't have to change the backend (i.e. scenario loading), you can directly set the agents accordingly when you build the session. The scenario itself does not specify who's the seller and who's the buyer.