4cd2d4af2b
Test Browser Use CLI Install / uv pip install (macos-latest) (push) Waiting to run
Test Browser Use CLI Install / uv pip install (windows-latest) (push) Waiting to run
Test Browser Use CLI Install / uv pip install (ubuntu-latest) (push) Failing after 1s
Test Browser Use CLI Install / uvx browser-use from local wheel (push) Failing after 1s
Test Browser Use CLI Install / uvx browser-use[cli] from PyPI (push) Failing after 1s
package / pip-install-on-macos-latest-py-3.11 (push) Has been skipped
package / pip-install-on-macos-latest-py-3.13 (push) Has been skipped
package / pip-install-on-ubuntu-latest-py-3.11 (push) Has been skipped
package / pip-install-on-windows-latest-py-3.13 (push) Has been skipped
cloud_evals / trigger_cloud_eval_image_build (push) Failing after 1s
docker / build_publish_image (push) Failing after 1s
Test Browser Use CLI Install / browser-use skill sync (push) Failing after 1s
lint / code-style (push) Failing after 0s
lint / type-checker (push) Failing after 1s
package / pip-build (push) Failing after 1s
lint / syntax-errors (push) Failing after 3s
package / pip-install-on-ubuntu-latest-py-3.13 (push) Has been skipped
package / pip-install-on-windows-latest-py-3.11 (push) Has been skipped
test / ${{ matrix.test_filename }} (push) Has been skipped
test / evaluate-tasks (push) Has been skipped
test / setup-chromium (push) Failing after 2s
test / find_tests (push) Failing after 2s
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
import os
|
|
import sys
|
|
|
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
|
|
from browser_use.browser import BrowserProfile
|
|
from browser_use.llm import ChatGoogle
|
|
from examples.integrations.slack.slack_api import SlackBot, app
|
|
|
|
# load credentials from environment variables
|
|
bot_token = os.getenv('SLACK_BOT_TOKEN')
|
|
if not bot_token:
|
|
raise ValueError('Slack bot token not found in .env file.')
|
|
|
|
signing_secret = os.getenv('SLACK_SIGNING_SECRET')
|
|
if not signing_secret:
|
|
raise ValueError('Slack signing secret not found in .env file.')
|
|
|
|
api_key = os.getenv('GOOGLE_API_KEY')
|
|
if not api_key:
|
|
raise ValueError('GOOGLE_API_KEY is not set')
|
|
|
|
llm = ChatGoogle(model='gemini-2.0-flash-exp', api_key=api_key)
|
|
|
|
slack_bot = SlackBot(
|
|
llm=llm, # required; instance of BaseChatModel
|
|
bot_token=bot_token, # required; Slack bot token
|
|
signing_secret=signing_secret, # required; Slack signing secret
|
|
ack=True, # optional; whether to acknowledge task receipt with a message, defaults to False
|
|
browser_profile=BrowserProfile(
|
|
headless=True
|
|
), # optional; useful for changing headless mode or other browser configs, defaults to headless mode
|
|
)
|
|
|
|
app.dependency_overrides[SlackBot] = lambda: slack_bot
|
|
|
|
if __name__ == '__main__':
|
|
import uvicorn
|
|
|
|
uvicorn.run('integrations.slack.slack_api:app', host='0.0.0.0', port=3000)
|