Skip to content

Conversation

balaboom123
Copy link

@balaboom123 balaboom123 commented May 21, 2025

Implementation Details

  1. create config.py and llm_provider.py to manage the API call for different LLM provider and their model's option.
  2. To use all the langchain model, you need to download. I changed in the requirements.txt but not added in uv.lock:
langchain-mistralai==0.2.4
langchain-ibm==0.3.10
  1. Option includes:
    • OpenAI
    • Anthropic
    • Google
    • Azure OpenAI
    • DeepSeek
    • Mistral
    • Ollama
    • Alibaba
    • Moonshot
    • Unbound
    • SiliconFLOW
    • IBM
    • Grok

Related Issue

issue #37 #36 #22 #19

Important INFO

This PR has used the module which is added in the requirements.txt but not in uv.lock.

langchain-mistralai==0.2.4
langchain-ibm==0.3.10

Test (all work properly)

Test for run-workflow

Command

python cli.py run-workflow examples/example.workflow.json

Output

INFO     [telemetry] Anonymized telemetry enabled. See https://docs.browser-use.com/development/telemetry for more information.
INFO     [workflow_use.builder.service] BuilderService initialized.
Loading workflow from: D:\user\Github\workflow-use\workflows\examples\example.workflow.json

Workflow loaded successfully.

Provide values for the following workflow inputs:

Enter value for first_name (required, type: string): balaboom123

Enter value for last_name (required, type: string): 321

Enter value for social_security_last4 (required, type: string): 6666


Running workflow...
INFO     [workflow_use.workflow.service] --- Running Step 1/10 -- Navigate to the form application's homepage. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: navigation
INFO     [workflow_use.controller.service] 🔗  Navigated to URL: https://v0-complex-form-example.vercel.app/
INFO     [workflow_use.workflow.service] --- Finished Step 1 ---

INFO     [workflow_use.workflow.service] --- Running Step 2/10 -- Click the 'Start Application' button to begin form entry. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8
Found element with selector: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8 (original: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8)
INFO     [workflow_use.workflow.service] --- Finished Step 2 ---

INFO     [workflow_use.workflow.service] --- Running Step 3/10 -- Enter the first name into the form. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: input
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
INFO     [workflow_use.controller.service] ⌨️  Input "balaboom123" into element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"])
INFO     [workflow_use.workflow.service] --- Finished Step 3 ---

INFO     [workflow_use.workflow.service] --- Running Step 4/10 -- Press Tab to move to the next field. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: key_press
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
INFO     [workflow_use.controller.service] 🔑  Pressed key 'Tab' on element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"])
INFO     [workflow_use.workflow.service] --- Finished Step 4 ---

INFO     [workflow_use.workflow.service] --- Running Step 5/10 -- Tab through the middle name field. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: key_press
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"]
INFO     [workflow_use.controller.service] 🔑  Pressed key 'Tab' on element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"])
INFO     [workflow_use.workflow.service] --- Finished Step 5 ---

INFO     [workflow_use.workflow.service] --- Running Step 6/10 -- Enter the last name into the form. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: input
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"]
INFO     [workflow_use.controller.service] ⌨️  Input "321" into element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"])
INFO     [workflow_use.workflow.service] --- Finished Step 6 ---

INFO     [workflow_use.workflow.service] --- Running Step 7/10 -- Click to focus on the Social Security field. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"])
INFO     [workflow_use.workflow.service] --- Finished Step 7 ---

INFO     [workflow_use.workflow.service] --- Running Step 8/10 -- Enter the last 4 digits of the Social Security number. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: input
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
INFO     [workflow_use.controller.service] ⌨️  Input "6666" into element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"])
INFO     [workflow_use.workflow.service] --- Finished Step 8 ---

INFO     [workflow_use.workflow.service] --- Running Step 9/10 -- Select 'Male' as the gender. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"]
Found element with selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"]
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"] (original: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"])
INFO     [workflow_use.workflow.service] --- Finished Step 9 ---

INFO     [workflow_use.workflow.service] --- Running Step 10/10 -- Select 'Single' as the marital status. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"]
Found element with selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"]
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"] (original: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"])
INFO     [workflow_use.workflow.service] --- Finished Step 10 ---


Workflow execution completed!
Result:
10 steps executed.

Test for run-as-tool

Command

python cli.py run-as-tool examples/example.workflow.json --prompt "I want to search for 'workflow use'"

Output

INFO     [telemetry] Anonymized telemetry enabled. See https://docs.browser-use.com/development/telemetry for more information.
INFO     [workflow_use.builder.service] BuilderService initialized.
Loading workflow from: D:\user\Github\workflow-use\workflows\examples\example.workflow.json

Workflow loaded successfully.

Running workflow as tool with prompt: "I want to search for 'workflow use'"

Workflow execution completed!
Result:
I'm sorry, but I don't have a function available to assist with searching for 'workflow use' or related information. My current capabilities are limited to assisting with the automated submission of government-related forms. If you have a request related to form submission, I'd be happy to help with that. Please provide details such as your first name, last name, and the last four digits of your Social Security number to proceed with a form submission, or let me know if you have another request or need clarification.

Test for no model name in .env

Command

python cli.py run-workflow examples/example.workflow.json

Output (in line 5, it let user choose the model list. here I did not type anything so it choose the default value.)

INFO     [telemetry] Anonymized telemetry enabled. See https://docs.browser-use.com/development/telemetry for more information.
**Available models for grok:
['grok-3', 'grok-3-fast', 'grok-3-mini', 'grok-3-mini-fast', 'grok-2-vision', 'grok-2-image', 'grok-2']
model name for grok [grok-3]:**
INFO     [workflow_use.builder.service] BuilderService initialized.
Loading workflow from: D:\user\Github\workflow-use\workflows\examples\example.workflow.json

Workflow loaded successfully.

Provide values for the following workflow inputs:

Enter value for first_name (required, type: string): balaboom

Enter value for last_name (required, type: string): 123

Enter value for social_security_last4 (required, type: string): 6666


Running workflow...
INFO     [workflow_use.workflow.service] --- Running Step 1/10 -- Navigate to the form application's homepage. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: navigation
INFO     [workflow_use.controller.service] 🔗  Navigated to URL: https://v0-complex-form-example.vercel.app/
INFO     [workflow_use.workflow.service] --- Finished Step 1 ---

INFO     [workflow_use.workflow.service] --- Running Step 2/10 -- Click the 'Start Application' button to begin form entry. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8
Found element with selector: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8 (original: button.inline-flex.items-center.justify-center.gap-2.whitespace-nowrap.text-sm.font-medium.ring-offset-background.transition-colors.bg-primary.text-primary-foreground.h-11.rounded-md.px-8)
INFO     [workflow_use.workflow.service] --- Finished Step 2 ---

INFO     [workflow_use.workflow.service] --- Running Step 3/10 -- Enter the first name into the form. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: input
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
INFO     [workflow_use.controller.service] ⌨️  Input "balaboom" into element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"])
INFO     [workflow_use.workflow.service] --- Finished Step 3 ---

INFO     [workflow_use.workflow.service] --- Running Step 4/10 -- Press Tab to move to the next field. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: key_press
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"]
INFO     [workflow_use.controller.service] 🔑  Pressed key 'Tab' on element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="firstName"][name="firstName"])
INFO     [workflow_use.workflow.service] --- Finished Step 4 ---

INFO     [workflow_use.workflow.service] --- Running Step 5/10 -- Tab through the middle name field. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: key_press
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"]
INFO     [workflow_use.controller.service] 🔑  Pressed key 'Tab' on element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="middleName"][name="middleName"])
INFO     [workflow_use.workflow.service] --- Finished Step 5 ---

INFO     [workflow_use.workflow.service] --- Running Step 6/10 -- Enter the last name into the form. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: input
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"]
INFO     [workflow_use.controller.service] ⌨️  Input "123" into element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="lastName"][name="lastName"])
INFO     [workflow_use.workflow.service] --- Finished Step 6 ---

INFO     [workflow_use.workflow.service] --- Running Step 7/10 -- Click to focus on the Social Security field. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"])
INFO     [workflow_use.workflow.service] --- Finished Step 7 ---

INFO     [workflow_use.workflow.service] --- Running Step 8/10 -- Enter the last 4 digits of the Social Security number. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: input
Trying selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
Found element with selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"]
INFO     [workflow_use.controller.service] ⌨️  Input "6666" into element with CSS selector: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"] (original: input.flex.h-10.w-full.rounded-md.border.border-input.bg-background.px-3.py-2.text-base.ring-offset-background[id="socialSecurityLast4"][name="socialSecurityLast4"])
INFO     [workflow_use.workflow.service] --- Finished Step 8 ---

INFO     [workflow_use.workflow.service] --- Running Step 9/10 -- Select 'Male' as the gender. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"]
Found element with selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"]
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"] (original: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="male"])
INFO     [workflow_use.workflow.service] --- Finished Step 9 ---

INFO     [workflow_use.workflow.service] --- Running Step 10/10 -- Select 'Single' as the marital status. ---
INFO     [workflow_use.workflow.service] Attempting deterministic action: click
Trying selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"]
Found element with selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"]
INFO     [workflow_use.controller.service] 🖱️  Clicked element with CSS selector: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"] (original: button.aspect-square.h-4.w-4.rounded-full.border.border-primary.text-primary.ring-offset-background[type="button"][role="radio"][id="single"])
INFO     [workflow_use.workflow.service] --- Finished Step 10 ---


Workflow execution completed!
Result:
10 steps executed.

1. create config.py and llm_provider.py to manage the API call for different LLM provider and their model's option.
2. To use all the langchain model, you need to download. I changed in the requirements.txt but not added in uv.lock:
```
langchain-mistralai==0.2.4
langchain-ibm==0.3.10
```
3. option includes:
   - OpenAI
   - Anthropic
   - Google
   - Azure OpenAI
   - DeepSeek
   - Mistral
   - Ollama
   - Alibaba
   - Moonshot
   - Unbound
   - SiliconFLOW
   - IBM
   - Grok
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