55from wfcommons.wfbench.translator and implements the required interface.
66"""
77
8- from os import path
98import requests
109from wfcommons .wfbench .bench import WorkflowBenchmark
1110from typing import Optional , Dict , Any , List
@@ -58,10 +57,12 @@ def _load_examples(self,
5857 ref : str = "main" ) -> List [str ]:
5958 """
6059 Load and return the content from the provided URLs.
60+
6161 Parameters
6262 ----------
6363 path_list : List[str]
6464 List of paths within the repository to fetch files from.
65+
6566 Returns
6667 -------
6768 List[Dict[str, Any]]
@@ -82,6 +83,7 @@ def _fetch_examples_from_path(self,
8283 ref : str = "main" ) -> List [Dict [str , Any ]]:
8384 """
8485 Fetch Python files from a specific path in a GitHub repository.
86+
8587 Parameters
8688 ----------
8789 path : str
@@ -120,11 +122,9 @@ def translate(self, trace, metadata=None, json_schema: dict | None = None, **kwa
120122 # assume Python code or any raw text
121123 trace_text = str (trace )
122124
123- # grounding_examples = self._retrieve_examples(trace_text)
124125
125126 prompt = self ._build_prompt (
126127 trace = trace_text ,
127- # examples=grounding_examples,
128128 metadata = metadata ,
129129 )
130130
@@ -164,7 +164,7 @@ def _retrieve_examples(self, trace_text: str):
164164 @staticmethod
165165 def _similarity (a : str , b : str ) -> float :
166166 """
167- Very naive similarity; replace with embeddings for real use .
167+ Very naive similarity based on word overlap. Replace with embeddings if desired .
168168 """
169169 return len (set (a .split ()) & set (b .split ()))
170170
0 commit comments