mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 05:41:53 +09:00
Meta가 Python에 TypeScript같은 걸 만들어서 타입을 존중하기로 했습니다.
This commit is contained in:
parent
2f356d8b8a
commit
1081160859
2 changed files with 9 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ venv와 패키지가 설치가 됩니다.
|
||||||
browser_use가 Playwright에 대한 의존성이 있어 브라우저 설치가 필요합니다
|
browser_use가 Playwright에 대한 의존성이 있어 브라우저 설치가 필요합니다
|
||||||
|
|
||||||
```
|
```
|
||||||
playwright install chromium
|
playwright install chromium --with-deps --no-shell
|
||||||
```
|
```
|
||||||
|
|
||||||
다음과 같은 명령어로 실행합니다.
|
다음과 같은 명령어로 실행합니다.
|
||||||
|
|
|
||||||
11
main.py
11
main.py
|
|
@ -11,8 +11,10 @@ import csv
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
if os.getenv("GOOGLE_API_KEY") is None:
|
if os.getenv("OPENAI_API_KEY") is None:
|
||||||
raise ValueError("GOOGLE_API_KEY environment variable is not set.")
|
raise ValueError("OPENAI_API_KEY environment variable not set.")
|
||||||
|
if os.getenv("OPENAI_MODEL") is None:
|
||||||
|
raise ValueError("OPENAI_MODEL environment variable not set.")
|
||||||
|
|
||||||
browser_config_kwargs = browser_config_kwargs()
|
browser_config_kwargs = browser_config_kwargs()
|
||||||
|
|
||||||
|
|
@ -57,7 +59,10 @@ async def main():
|
||||||
)
|
)
|
||||||
|
|
||||||
response = await agent.run()
|
response = await agent.run()
|
||||||
result = json.loads(response.final_result())
|
final_result = response.final_result()
|
||||||
|
if final_result is None:
|
||||||
|
raise ValueError("final_result() returned None")
|
||||||
|
result = json.loads(final_result)
|
||||||
print(result)
|
print(result)
|
||||||
|
|
||||||
# {"oauth_providers": ["GitHub", "Passkey"]} print
|
# {"oauth_providers": ["GitHub", "Passkey"]} print
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue