|
| 1 | +from dataclasses import dataclass, field |
| 2 | +from typing import Dict, Any, List, Tuple |
| 3 | +from hackingBuddyGPT.capabilities import Capability |
| 4 | + |
| 5 | + |
| 6 | +from dataclasses import dataclass, field |
| 7 | +from typing import Any, Dict, List, Tuple |
| 8 | + |
| 9 | +@dataclass |
| 10 | +class ParsedInformation(Capability): |
| 11 | + status_code: str |
| 12 | + reason_phrase: Dict[str, Any] = field(default_factory=dict) |
| 13 | + headers: Dict[str, Any] = field(default_factory=dict) |
| 14 | + response_body: Dict[str, Any] = field(default_factory=dict) |
| 15 | + registry: List[Tuple[str, str, str, str]] = field(default_factory=list) |
| 16 | + |
| 17 | + def describe(self) -> str: |
| 18 | + """ |
| 19 | + Returns a description of the test case. |
| 20 | + """ |
| 21 | + return f"Parsed information for {self.status_code}, reason_phrase: {self.reason_phrase}, headers: {self.headers}, response_body: {self.response_body} " |
| 22 | + def __call__(self, status_code: str, reason_phrase: str, headers: str, response_body:str) -> dict: |
| 23 | + self.registry.append((status_code, response_body, headers,response_body)) |
| 24 | + |
| 25 | + return {"status_code": status_code, "reason_phrase": reason_phrase, "headers": headers, "response_body": response_body} |
0 commit comments