└── main.py /main.py: -------------------------------------------------------------------------------- 1 | from concurrent.futures import ThreadPoolExecutor 2 | 3 | def thread_worker(step: int, query: str) -> str: 4 | return f"Thread step {step}: {query} processed" 5 | 6 | def threaded_agent(query: str): 7 | with ThreadPoolExecutor() as executor: 8 | results = executor.map(thread_worker, range(5), [query] * 5) 9 | return list(results) 10 | --------------------------------------------------------------------------------