-
Notifications
You must be signed in to change notification settings - Fork 32
Add dynamic guidance tasks #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dynamic guidance tasks #125
Conversation
| class ServiceNowIncidentTask(AbstractServiceNowTask): | ||
|
|
||
| def __init__(self, seed: int, fixed_config: Dict[str, Any] = None, start_rel_url: str = "/now/nav/ui/home") -> None: | ||
| super().__init__(seed, start_rel_url=start_rel_url) | ||
| self.task_is_setup = False | ||
| self.config = fixed_config if fixed_config else self.random.choice(self.all_configs()) | ||
| self.timeout = 60000 | ||
| self.created_sysids = [] | ||
|
|
||
| def setup_goal(self, page: playwright.sync_api.Page) -> Tuple[str, dict]: | ||
| """Setup the task configuration and produce the goal.""" | ||
|
|
||
| goal = self.config["goal"] | ||
| info = self.config | ||
|
|
||
| return goal, info | ||
|
|
||
| def cheat(self, page: playwright.sync_api.Page, chat_messages: List[str]) -> None: | ||
| pass | ||
|
|
||
| def all_configs(self): | ||
| raise NotImplementedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for these create incidents we should just reuse what exists. I will do a PR for these incident tasks
| response = requests.get( | ||
| f"{self.instance.snow_url}/api/now/table/interaction", | ||
| auth=self.instance.snow_credentials, | ||
| headers={"Accept": "application/json"}, | ||
| params={ | ||
| "sysparm_query": f"short_descriptionLIKE{customer_problem}", | ||
| "sysparm_fields": "sys_id,short_description", | ||
| "sysparm_limit": 1, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you just validate by getting the sys id of the created interaction and then checking whether the short description matches the expected value? This way, we can just reuse the other create tasks code
No description provided.