Spaces:
Build error
Build error
Download src/mapper/parser.py from Gustav-Proxi/scitonic: direct link, hf CLI and curl.
- Browser
- Download file 845 Bytes
-
https://huggingface.co/spaces/Gustav-Proxi/scitonic/resolve/main/src/mapper/parser.py
- Command line
-
hf download hf://spaces/Gustav-Proxi/scitonic/src/mapper/parser.py
-
curl -L -o parser.py https://huggingface.co/spaces/Gustav-Proxi/scitonic/resolve/main/src/mapper/parser.py
845 Bytes
| class MapperParser: | |
| def parse_taskmapper_response(response): | |
| """Parses the response from the taskmapper and returns the task name.""" | |
| if not response or 'task' not in response: | |
| return "No task identified" | |
| task_info = response['task'] | |
| for task, is_selected in task_info.items(): | |
| if is_selected == "YES": | |
| return task | |
| def parse_teammapper_response(response, default_team="DefaultTeam"): | |
| """Parses the response from the teammapper and returns the team name.""" | |
| if not response or 'Team' not in response: | |
| return "ConsultingTeam" | |
| team_info = response['Team'] | |
| for team, is_selected in team_info.items(): | |
| if is_selected: | |
| return team | |
| return "ConsultingTeam" |