Skip to content

Commit

Permalink
update get-action-from-context
Browse files Browse the repository at this point in the history
  • Loading branch information
lyie28 committed Aug 26, 2024
1 parent e6a6588 commit 24350a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lavague-core/lavague/core/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,14 @@ def get_action_from_context(self, context: str, query: str) -> str:
"""
Generate the code from a query and a context
"""
prompt = self.prompt_template.format(context_str=context, query_str=query)
authorized_xpaths = extract_xpaths_from_html(context)

prompt = self.prompt_template.format(
context_str=context,
query_str=query,
authorized_xpaths=authorized_xpaths,
)

response = self.llm.complete(prompt).text
code = self.extractor.extract(response)
return code
Expand Down

0 comments on commit 24350a0

Please sign in to comment.