(approaches, system_prompt, initial_query, client, model, request_config: dict = None)
| 493 | return final_response, total_tokens |
| 494 | |
| 495 | async def execute_parallel_approaches(approaches, system_prompt, initial_query, client, model, request_config: dict = None): |
| 496 | async def run_approach(approach): |
| 497 | return await asyncio.to_thread(execute_single_approach, approach, system_prompt, initial_query, client, model, request_config) |
| 498 | |
| 499 | tasks = [run_approach(approach) for approach in approaches] |
| 500 | results = await asyncio.gather(*tasks) |
| 501 | responses, tokens = zip(*results) |
| 502 | return list(responses), sum(tokens) |
| 503 | |
| 504 | def execute_n_times(n: int, approaches, operation: str, system_prompt: str, initial_query: str, client: Any, model: str, |
| 505 | request_config: dict = None, request_id: str = None) -> Tuple[Union[str, List[str]], int]: |
no test coverage detected