mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-14 07:26:42 +09:00
refect: 코드 가독성 해결
This commit is contained in:
parent
146c187b05
commit
3199a53a44
52 changed files with 389 additions and 3246 deletions
|
|
@ -1,6 +1,8 @@
|
|||
from typing import Union, Type
|
||||
from typing import Type, Union
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
def get_prompt(type: str) -> tuple[str, Type[BaseModel]] | str:
|
||||
"""
|
||||
Prompt를 반환합니다.
|
||||
|
|
@ -9,29 +11,36 @@ def get_prompt(type: str) -> tuple[str, Type[BaseModel]] | str:
|
|||
:return: 해당하는 프롬프트 문자열 또는 (프롬프트, 모델) 튜플
|
||||
"""
|
||||
if type.lower() == "auth":
|
||||
from lib.llm.prompt._get_oauth import prompt, model
|
||||
from lib.llm.prompt._get_oauth import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
||||
|
||||
elif type.lower() in ["google", "google account"]:
|
||||
from lib.llm.prompt.google import prompt, model
|
||||
from lib.llm.prompt.google import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
||||
|
||||
elif type.lower() in ["microsoft", "microsoftonline"]:
|
||||
from lib.llm.prompt.microsoft import prompt, model
|
||||
from lib.llm.prompt.microsoft import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
||||
|
||||
elif type.lower() in ["meta", "facebook"]:
|
||||
from lib.llm.prompt.facebook import prompt, model
|
||||
from lib.llm.prompt.facebook import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
||||
|
||||
elif type.lower() in ["apple"]:
|
||||
from lib.llm.prompt.apple import prompt, model
|
||||
from lib.llm.prompt.apple import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
||||
elif type.lower() in ["github"]:
|
||||
from lib.llm.prompt.github import prompt, model
|
||||
from lib.llm.prompt.github import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
||||
else:
|
||||
from lib.llm.prompt._fallback import model, prompt
|
||||
|
||||
return prompt, model
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt._fallback.prompt import prompt
|
||||
from lib.llm.prompt._fallback.model import model
|
||||
from lib.llm.prompt._fallback.prompt import prompt
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
status: str | None = None # "success", "mfa_required", "blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
status: str | None = (
|
||||
None # "success", "mfa_required", "blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
)
|
||||
final_url: str | None = None
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt._get_oauth.prompt import prompt
|
||||
from lib.llm.prompt._get_oauth.model import model
|
||||
from lib.llm.prompt._get_oauth.prompt import prompt
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
url: str | None = None
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt.apple.prompt import prompt
|
||||
from lib.llm.prompt.apple.model import model
|
||||
from lib.llm.prompt.apple.prompt import prompt
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
status: str | None = None # "success", "mfa_required", "apple_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
status: str | None = (
|
||||
None # "success", "mfa_required", "apple_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
)
|
||||
final_url: str | None = None
|
||||
|
|
|
|||
|
|
@ -56,4 +56,4 @@ Return the result in the following format only:
|
|||
```
|
||||
|
||||
- Return ONLY the JSON object. Do NOT include any explanation, logging, or extra output.
|
||||
"""
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt.facebook.model import model
|
||||
from lib.llm.prompt.facebook.prompt import prompt
|
||||
from lib.llm.prompt.facebook.model import model
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
status: str | None = None # "success", "mfa_required", "facebook_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
final_url: str | None = None
|
||||
status: str | None = (
|
||||
None # "success", "mfa_required", "facebook_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
)
|
||||
final_url: str | None = None
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
|
||||
# Extended planner prompt
|
||||
prompt = f"""
|
||||
You are a web automation agent.
|
||||
|
|
@ -47,4 +48,4 @@ Return the result in the following format only:
|
|||
```
|
||||
|
||||
- Return ONLY the JSON object. Do NOT include any explanation, logging, or extra output.
|
||||
"""
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt.github.model import model
|
||||
from lib.llm.prompt.github.prompt import prompt
|
||||
from lib.llm.prompt.github.model import model
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
status: str | None = None # "success", "mfa_required", "github_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
status: str | None = (
|
||||
None # "success", "mfa_required", "github_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
)
|
||||
final_url: str | None = None
|
||||
|
|
|
|||
|
|
@ -67,4 +67,4 @@ Return the result in the following format only:
|
|||
```
|
||||
|
||||
- Return ONLY the JSON object. Do NOT include any explanation, logging, or extra output.
|
||||
"""
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt.google.prompt import prompt
|
||||
from lib.llm.prompt.google.model import model
|
||||
from lib.llm.prompt.google.prompt import prompt
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
status: str | None = None # "success", "mfa_required", "google_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
status: str | None = (
|
||||
None # "success", "mfa_required", "google_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
)
|
||||
final_url: str | None = None
|
||||
|
|
|
|||
|
|
@ -55,4 +55,4 @@ Return the result in the following format only:
|
|||
```
|
||||
|
||||
- Return ONLY the JSON object. Do NOT include any explanation, logging, or extra output.
|
||||
"""
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from lib.llm.prompt.microsoft.prompt import prompt
|
||||
from lib.llm.prompt.microsoft.model import model
|
||||
from lib.llm.prompt.microsoft.prompt import prompt
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class model(BaseModel):
|
||||
msg: str | None = None
|
||||
status: str | None = None # "success", "mfa_required", "microsoft_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
status: str | None = (
|
||||
None # "success", "mfa_required", "microsoft_blocked", "sso_not_found", "login_page_not_found", "invalid_credentials"
|
||||
)
|
||||
final_url: str | None = None
|
||||
|
|
|
|||
|
|
@ -54,4 +54,4 @@ Microsoft 로그인에 사용할 자격 증명:
|
|||
```
|
||||
|
||||
- Return ONLY the JSON object. Do NOT include any explanation, logging, or extra output.
|
||||
"""
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue