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

Function extract_idea_info

internagent/experiments_utils_iflow.py:22–57  ·  view source on GitHub ↗

Extract idea information from different formats

(idea)

Source from the content-addressed store, hash-verified

20MAX_STDERR_OUTPUT = 30000
21
22def extract_idea_info(idea):
23 """Extract idea information from different formats"""
24 # Try refined_method_details first (from full MAS pipeline)
25 if 'refined_method_details' in idea and idea['refined_method_details']:
26 details = idea['refined_method_details']
27 return {
28 'name': details.get('name', 'unnamed_idea'),
29 'title': details.get('title', 'Untitled'),
30 'description': details.get('description', ''),
31 'method': details.get('method', '')
32 }
33
34 # Fall back to method_details (from method development only)
35 elif 'method_details' in idea and idea['method_details']:
36 details = idea['method_details']
37 return {
38 'name': details.get('name', 'unnamed_idea'),
39 'title': details.get('title', 'Untitled'),
40 'description': details.get('description', ''),
41 'method': details.get('method', '')
42 }
43
44 # Fall back to basic idea structure (from JSON files)
45 else:
46 # Handle different possible field names
47 name = idea.get('name') or idea.get('title') or 'unnamed_idea'
48 title = idea.get('title') or idea.get('name') or 'Untitled'
49 description = idea.get('description') or idea.get('content') or ''
50 method = idea.get('method') or ''
51
52 return {
53 'name': name[:50] if name else 'unnamed_idea', # Limit name length
54 'title': title,
55 'description': description,
56 'method': method
57 }
58
59
60# return (file, line, function, content), message

Callers 2

perform_experiments_mctsFunction · 0.90
perform_experimentsFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected