Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions examples/python-operator-dataflow/llm_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ def replace_code_in_source(source_code, replacement_block: str):
start_index, end_index = find_best_match_location(source_code, replacement_block)
if start_index != -1 and end_index != -1:
# Replace the best matching part with the replacement block
return (
source_code[:start_index] + replacement_block + source_code[end_index:]
)
return source_code[:start_index] + replacement_block + source_code[end_index:]
return source_code


Expand Down Expand Up @@ -264,7 +262,6 @@ def on_event(
return DoraStatus.CONTINUE

def ask_llm(self, prompt):

# Generate output
# prompt = PROMPT_TEMPLATE.format(system_message=system_message, prompt=prompt))
"""TODO: Add docstring."""
Expand Down Expand Up @@ -299,7 +296,7 @@ def ask_llm(self, prompt):
# Directory of the current file
current_directory = os.path.dirname(current_file_path)

path = current_directory + "object_detection.py"
path = os.path.join(current_directory, "object_detection.py")
with open(path, encoding="utf8") as f:
raw = f.read()

Expand Down
Loading