Skip to content

Commit

Permalink
change extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
lyie28 committed Aug 26, 2024
1 parent 4ece722 commit 7ecd7e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lavague-core/lavague/core/python_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(
display: bool = False,
batch_size: int = 5,
confidence_threshold: float = 0.85,
fallback_threshold: float = 0.65,
fallback_threshold: float = 0.85,
temp_screenshots_path="./tmp_screenshots",
n_search_attemps=10,
):
Expand All @@ -81,7 +81,8 @@ def from_context(cls, context: Context, driver: BaseDriver):
return cls(llm=context.llm, embedding=context.embedding, driver=driver)

def extract_json(self, output: str) -> Optional[dict]:
clean = JsonFromMarkdownExtractor.extract(output)
extractor = JsonFromMarkdownExtractor()
clean = extractor.extract(markdown_text=output)
try:
output_dict = json.loads(clean)
except json.JSONDecodeError as e:
Expand Down

0 comments on commit 7ecd7e0

Please sign in to comment.