INNER CODE UNIT · Python

process_batch_with_api

KodCode-AI/kodcode · pipeline/completion_open_model.py:93

def process_batch_with_api(batch):
    with concurrent.futures.ProcessPoolExecutor() as executor:
        future_to_item = {
            executor.submit(
                make_api_request_with_retry, 
                [{'content': item['messages'][0]['content'], 'role': 'user'}],
                API_PARAMS,
                API_ENDPOINT,
                API_HEADERS,
            ): item 
            for item in batch
        }

        for future in concurrent.futures.as_completed(future_to_item):
            item = future_to_item[future]
            message = item["messages"]
            try:
                api_response = future.result()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…