MCPcopy Create free account
hub / github.com/GitsSaikat/PyGen / load_code_examples

Function load_code_examples

pygen/prompt_context.py:33–48  ·  view source on GitHub ↗

Load code examples from specified text files.

(example_files: List[str])

Source from the content-addressed store, hash-verified

31 return feature_descriptions
32
33def load_code_examples(example_files: List[str]) -> Dict[str, str]:
34 """
35 Load code examples from specified text files.
36 """
37 code_examples = {}
38 for file_path in example_files:
39 if not os.path.exists(file_path):
40 print(f"Warning: Code example file {file_path} does not exist.")
41 continue
42 try:
43 with open(file_path, 'r', encoding='utf-8') as f:
44 content = f.read()
45 code_examples[os.path.basename(file_path)] = content
46 except Exception as e:
47 print(f"Error loading code example file {file_path}: {str(e)}")
48 return code_examples
49
50def generate_enhanced_feature_descriptions(client: Groq, model_name: str, feature_descriptions: Dict[str, str], max_retries: int = 5) -> Dict[str, str]:
51 """

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected