Skip to content

Commit

Permalink
New use case forms (#240)
Browse files Browse the repository at this point in the history
* Added new use case: form filling

* Update forms.md

---------

Co-authored-by: Laura Yie <[email protected]>
  • Loading branch information
paulpalmieri and lyie28 authored May 17, 2024
1 parent e259ce0 commit 0b67c8a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
Binary file added docs/assets/jotform_demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions docs/docs/use-cases/forms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Fill out forms

LaVague can be used to fill out simple forms automatically! Just provide the necessary information and ask LaVague to fill event registration forms, job applications, etc.

We have created a [sample job application form](https://form.jotform.com/241363523875359) you can use to try this use case.

Here is our framework going through the form and filling it after being given the instruction: **"Fill out this form, my name is: John Doe, my email is [email protected], etc..."**.


!["notion_demo"](../../assets/jotform_demo.gif)

On the left, you can see our agent navigating and highlighting the next elements to be interacted with. On the right, the reasoning and the low level instructions generated for our Action Engine (which controls the browser).

## Try it yourself

After [installation](../get-started/quick-tour.md), create a new .py file and run this code to try LaVague with Notion!

```py
from lavague.core import WebAgent, WorldModel, ActionEngine
from lavague.drivers.selenium import SeleniumDriver

selenium_driver = SeleniumDriver()
action_engine = ActionEngine(selenium_driver)
world_model = WorldModel.from_hub("data_entry_example")

agent = WebAgent(action_engine, world_model)

agent.get("https://form.jotform.com/241363523875359")

instruction = """
Fill out this form
Data:
- job: product lead
- name: john doe
- email: [email protected]
- phone: 555-123-4567
- cover letter: Excited to work with you!
"""

agent.run(instruction)
```

For now we suggest running this code in a Jupyter Notebook while we work on ways to improve the experience when running LaVague locally.

## Tell us more about your use cases!

Discover community use cases and share yours on our [product feedback space](https://lavague.canny.io/lavague-use-cases). We review your ideas daily to continuously improve LaVague's performance and accuracy on a wide range of tasks.

You can also drop a message on our [Discord](https://discord.gg/SDxn9KpqX9) to chat if you have any questions!
47 changes: 47 additions & 0 deletions examples/knowledge/data_entry_example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Objective: Submit the responses for the form
Thought:
- I am on a Google Form titled "Customer Feedback".
- The form contains various questions with different input types (text, multiple choice, checkboxes).
- I have filled out all required fields, and the 'Submit' button is visible at the bottom of the form.
- To complete the objective, I need to click the 'Submit' button to send the responses.
Instruction: Locate the 'Submit' button at the bottom of the form and click on it.

Objective: Fill in the form
Thought:
- I am on a Google Form titled "Event Registration".
- The form has required fields labeled "Email Address", "First name", "Last name" and "Phone".
- To proceed with the form, I need to enter info in all input boxes.
- This action requires typing the first name, last name, email and phone into the corresponding fields.
Instruction: Locate the input element labeled "Email Address" and type in "[email protected]". Locate the input element labeled "First name" and type in "John". Locate the input element labeled "Last name" and type in "Doe". Locate the input element labeled "Phone" and type in "555-555-5555".

Objective: Select "Yes" for the question "Do you have any dietary restrictions?"
Thought:
- I am on a Google Form titled "Conference RSVP".
- The form includes a question "Do you have any dietary restrictions?" with "Yes" and "No" as options.
- To answer this question, I need to select the "Yes" option.
- This action involves clicking the radio button next to "Yes".
Instruction: Locate the question "Do you have any dietary restrictions?" and click the radio button next to "Yes".

Objective: Choose "Vegetarian" from the dropdown menu for the question "Meal Preference"
Thought:
- I am on a Google Form titled "Workshop Signup".
- The form contains a question "Meal Preference" with a dropdown menu offering multiple options.
- To specify the meal preference, I need to select "Vegetarian" from the dropdown list.
- This action involves clicking the dropdown menu and choosing the appropriate option.
Instruction: Locate the question "Meal Preference", click the dropdown menu, and select "Vegetarian".

Objective: Provide additional comments in the text area
Thought:
- I am on a Google Form titled "Service Feedback".
- The form includes a section for additional comments with a text area for responses.
- To complete this section, I need to type my comments into the provided text area.
- This action requires entering text into the designated box.
Instruction: Locate the text area for additional comments and type in "Great service, very satisfied with the experience."

Objective: Mark all applicable options for the question "Which services did you use?" (Checkboxes)
Thought:
- I am on a Google Form titled "Facility Usage Survey".
- The form contains a question "Which services did you use?" with several checkboxes for multiple selections.
- To answer this question, I need to mark all relevant options.
- This action involves clicking the checkboxes next to the appropriate services.
Instruction: Locate the question "Which services did you use?" and click the checkboxes next to "Gym", "Pool", and "Spa".
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ nav:
- ✅ Use cases:
- Knowledge Retrieval:
- Navigate through Notion: "docs/use-cases/notion.md"
- Data Entry:
- Fill out forms: "docs/use-cases/forms.md"

- 🤗 Contributing:
- Overview: "docs/contributing/contributing.md"
Expand Down

0 comments on commit 0b67c8a

Please sign in to comment.