| def _process_response(res: dict, type: str) -> str: | def _process_response(res: dict, type: str) -> str: | ||||
| """Process response from SearchAPI.""" | """Process response from SearchAPI.""" | ||||
| if "error" in res: | if "error" in res: | ||||
| raise ValueError(f"Got error from SearchApi: {res['error']}") | |||||
| return res["error"] | |||||
| toret = "" | toret = "" | ||||
| if type == "text": | if type == "text": |
| def _process_response(res: dict, type: str) -> str: | def _process_response(res: dict, type: str) -> str: | ||||
| """Process response from SearchAPI.""" | """Process response from SearchAPI.""" | ||||
| if "error" in res: | if "error" in res: | ||||
| raise ValueError(f"Got error from SearchApi: {res['error']}") | |||||
| return res["error"] | |||||
| toret = "" | toret = "" | ||||
| if type == "text": | if type == "text": |
| def _process_response(res: dict, type: str) -> str: | def _process_response(res: dict, type: str) -> str: | ||||
| """Process response from SearchAPI.""" | """Process response from SearchAPI.""" | ||||
| if "error" in res: | if "error" in res: | ||||
| raise ValueError(f"Got error from SearchApi: {res['error']}") | |||||
| return res["error"] | |||||
| toret = "" | toret = "" | ||||
| if type == "text": | if type == "text": |
| def _process_response(res: dict) -> str: | def _process_response(res: dict) -> str: | ||||
| """Process response from SearchAPI.""" | """Process response from SearchAPI.""" | ||||
| if "error" in res: | if "error" in res: | ||||
| raise ValueError(f"Got error from SearchApi: {res['error']}") | |||||
| return res["error"] | |||||
| toret = "" | toret = "" | ||||
| if "transcripts" in res and "text" in res["transcripts"][0]: | if "transcripts" in res and "text" in res["transcripts"][0]: |