Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg conversion #717

Merged
merged 1 commit into from
Aug 23, 2024
Merged

svg conversion #717

merged 1 commit into from
Aug 23, 2024

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Aug 23, 2024

🚀 This description was created by Ellipsis for commit 82b861c

Summary:

This PR adds SVG conversion to string descriptions with caching and a new LLM prompt template in the Skyvern project.

Key points:

  • Added _convert_svg_to_string in skyvern/forge/agent_functions.py to convert SVG elements to string descriptions.
  • Implemented caching for SVG conversion results using CacheFactory and LocalCache in skyvern/forge/sdk/cache.
  • Introduced svg-convert.j2 template in skyvern/forge/prompts/skyvern for LLM to interpret SVG elements.
  • Updated cleanup_element_tree_func to process SVG elements for conversion and caching.
  • Integrated cache retrieval and storage in app.CACHE within skyvern/forge/app.py.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 82b861c in 21 seconds

More details
  • Looked at 233 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/agent_functions.py:73
  • Draft comment:
    Typo in log message: 'loaded' should be 'load'.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The log message has a typo in the word 'loaded'.

Workflow ID: wflow_iEH21HL4CEA5SaZY


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

if key not in self.cache:
return None
value = self.cache[key]
await self.set(key, value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary call to set in get method. TTLCache handles TTL internally, so refreshing TTL manually is not needed. Remove await self.set(key, value) from get method.

MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"confidence_float": float, // The confidence of the action. Pick a number between 0.0 and 1.0. 0.0 means no confidence, 1.0 means full confidence
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments within JSON are not valid. Consider removing comments or using a different format to provide instructions.

@LawyZheng LawyZheng merged commit 76ee91e into main Aug 23, 2024
2 checks passed
@LawyZheng LawyZheng deleted the lawy/svg-conversion branch August 23, 2024 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant