(text: str, pattern: str)
| 4495 | |
| 4496 | @staticmethod |
| 4497 | def _regex_capture(text: str, pattern: str) -> Optional[Any]: |
| 4498 | match = re.search(pattern, text, re.S) |
| 4499 | if match is None: |
| 4500 | return None |
| 4501 | group_dict = match.groupdict() |
| 4502 | if group_dict: |
| 4503 | return {key: value for key, value in group_dict.items() if value is not None} |
| 4504 | return match.group(1) if match.lastindex else match.group(0) |
| 4505 | |
| 4506 | @staticmethod |
| 4507 | def _gemma4_tool_call_to_json(text: str) -> str: |
no outgoing calls
no test coverage detected