MCPcopy Create free account
hub / github.com/InternScience/InternAgent / process_item

Function process_item

tasks/AutoTTS/code/main.py:208–223  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

206
207 # Create tasks
208 async def process_item(item):
209 try:
210 if config.requires_context():
211 from experiment.prompter.multihop import contexts
212 optimized_question = await plugin(item[question_key], contexts(item, dataset))
213 else:
214 optimized_question = await plugin(item[question_key])
215
216 # Create new entry
217 new_item = item.copy()
218 new_item["original_question"] = item[question_key]
219 new_item[question_key] = optimized_question
220 return new_item
221 except Exception as e:
222 print(f"Error processing item: {e}")
223 return item # Return original item on error
224
225 # Process all items in parallel
226 tasks = [process_item(item) for item in testset]

Callers 1

optimize_datasetFunction · 0.70

Calls 4

pluginFunction · 0.90
contextsFunction · 0.90
requires_contextMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected