glean-agent-toolkit 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.cz.toml +1 -1
- glean_agent_toolkit-0.4.0/.env.template +6 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.github/workflows/ci.yml +9 -11
- glean_agent_toolkit-0.4.0/AGENTS.md +55 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/COMMIT_LINTING.md +5 -5
- glean_agent_toolkit-0.4.0/CONTRIBUTING.md +94 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/PKG-INFO +81 -52
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/README.md +80 -51
- glean_agent_toolkit-0.4.0/docs/prerequisites.md +65 -0
- glean_agent_toolkit-0.4.0/mise.toml +201 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/pyproject.toml +6 -3
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-01.py +4 -4
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-03.py +3 -3
- glean_agent_toolkit-0.4.0/snippets/readme/snippet-04.bash +2 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-04.py +4 -4
- glean_agent_toolkit-0.4.0/snippets/readme/snippet-05.bash +2 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-05.py +3 -3
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-07.bash +1 -1
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-09.py +1 -2
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/adapters/adk.py +4 -3
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/adapters/crewai.py +1 -1
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/adapters/langchain.py +1 -1
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/adapters/openai.py +1 -1
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/__init__.py +6 -6
- glean_agent_toolkit-0.4.0/src/glean/agent_toolkit/tools/_common.py +123 -0
- glean_agent_toolkit-0.4.0/src/glean/agent_toolkit/tools/read_document.py +89 -0
- glean_agent_toolkit-0.3.0/src/glean/agent_toolkit/tools/glean_search.py → glean_agent_toolkit-0.4.0/src/glean/agent_toolkit/tools/search.py +3 -3
- glean_agent_toolkit-0.4.0/tests/cassettes/test_search_api_error.yaml +81 -0
- glean_agent_toolkit-0.4.0/tests/cassettes/test_search_success.yaml +83 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/conftest.py +1 -1
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_common.py +75 -20
- glean_agent_toolkit-0.4.0/tests/tools/test_read_document.py +70 -0
- glean_agent_toolkit-0.4.0/tests/tools/test_search.py +29 -0
- glean_agent_toolkit-0.3.0/.env.template +0 -3
- glean_agent_toolkit-0.3.0/AGENTS.md +0 -55
- glean_agent_toolkit-0.3.0/CONTRIBUTING.md +0 -93
- glean_agent_toolkit-0.3.0/Taskfile.yml +0 -309
- glean_agent_toolkit-0.3.0/mise.toml +0 -4
- glean_agent_toolkit-0.3.0/snippets/readme/snippet-04.bash +0 -2
- glean_agent_toolkit-0.3.0/snippets/readme/snippet-05.bash +0 -2
- glean_agent_toolkit-0.3.0/src/glean/agent_toolkit/tools/_common.py +0 -78
- glean_agent_toolkit-0.3.0/src/glean/agent_toolkit/tools/ai_web_search.py +0 -63
- glean_agent_toolkit-0.3.0/tests/tools/test_ai_web_search.py +0 -60
- glean_agent_toolkit-0.3.0/tests/tools/test_glean_search.py +0 -29
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.github/workflows/publish.yml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.gitignore +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.markdown-coderc.json +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.pre-commit-config.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/.vscode/settings.json +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/CHANGELOG.md +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/CODEOWNERS +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/LICENSE +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/RELEASE.md +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/pyrightconfig.json +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-01.bash +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-02.bash +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-02.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-03.bash +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-06.bash +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-06.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-07.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-08.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/snippets/readme/snippet-10.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/__init__.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/adapters/__init__.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/adapters/base.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/decorators.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/py.typed +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/registry.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/spec.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/calendar_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/code_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/employee_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/gmail_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/outlook_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/src/glean/agent_toolkit/tools/web_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/__init__.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_complex_query.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_no_results.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_various_queries[blockchain applications].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_various_queries[cloud computing trends].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_various_queries[cybersecurity best practices].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_various_queries[machine learning frameworks 2025].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_ai_web_search_various_queries[sustainable technology solutions].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_by_attendee.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_by_date_range.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_no_results.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_various_queries[client demo presentation].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_various_queries[conference room bookings].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_various_queries[one-on-one meetings].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_various_queries[quarterly business review].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_calendar_search_various_queries[sprint planning meeting].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_complex_query.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_empty_query.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_various_queries[API endpoint security].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_various_queries[class UserManager].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_various_queries[database connection pool].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_various_queries[error handling middleware].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_code_search_various_queries[function login validation].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_by_department.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_by_role.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_no_results.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_various_queries[Sarah Johnson product manager].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_various_queries[UX designer mobile apps].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_various_queries[data scientist machine learning].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_various_queries[frontend developer React].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_employee_search_various_queries[security engineer DevOps].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_glean_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_glean_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_no_emails_found.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_various_queries[invoice from vendor].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_various_queries[meeting invitations].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_various_queries[password reset emails].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_various_queries[security alerts].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_various_queries[urgent emails from manager].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_with_filters[before:2025/01/01].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_with_filters[from:boss@company.com].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_with_filters[has:attachment].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_with_filters[label:important].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_gmail_search_with_filters[subject:urgent].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_calendar_events.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_no_results.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_various_queries[all-hands meeting].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_various_queries[budget review meeting].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_various_queries[client presentation tomorrow].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_various_queries[project deadline reminder].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_outlook_search_various_queries[team standup calendar].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_api_error.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_news_query.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_no_results.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_specific_domain.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_success.yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_various_queries[API design patterns].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_various_queries[Docker container deployment].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_various_queries[JavaScript frameworks comparison].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_various_queries[database optimization techniques].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/cassettes/test_web_search_various_queries[mobile app development].yaml +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_adapters.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_decorators.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_enhanced_schemas.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_registry.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_schema_generation.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/test_toolspec.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/__init__.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/test_calendar_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/test_code_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/test_employee_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/test_gmail_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/test_outlook_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/tests/tools/test_web_search.py +0 -0
- {glean_agent_toolkit-0.3.0 → glean_agent_toolkit-0.4.0}/uv.lock +0 -0
|
@@ -22,13 +22,13 @@ jobs:
|
|
|
22
22
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
23
23
|
|
|
24
24
|
- name: Setup development environment
|
|
25
|
-
run:
|
|
25
|
+
run: mise run setup
|
|
26
26
|
|
|
27
27
|
- name: Run linters
|
|
28
|
-
run:
|
|
28
|
+
run: mise run lint
|
|
29
29
|
|
|
30
30
|
- name: Build package
|
|
31
|
-
run:
|
|
31
|
+
run: mise run build
|
|
32
32
|
|
|
33
33
|
test:
|
|
34
34
|
name: Test Python ${{ matrix.python-version }}
|
|
@@ -44,23 +44,21 @@ jobs:
|
|
|
44
44
|
uses: jdx/mise-action@v2
|
|
45
45
|
with:
|
|
46
46
|
cache: true
|
|
47
|
-
mise_toml: |
|
|
48
|
-
[tools]
|
|
49
|
-
python = "${{ matrix.python-version }}"
|
|
50
|
-
task = "latest"
|
|
51
|
-
uv = "latest"
|
|
52
47
|
|
|
53
48
|
env:
|
|
54
49
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
55
50
|
|
|
56
51
|
- name: Setup development environment
|
|
57
|
-
run:
|
|
52
|
+
run: mise use -g python@${{ matrix.python-version }} uv@latest && mise install
|
|
53
|
+
|
|
54
|
+
- name: Initialize dev environment
|
|
55
|
+
run: mise run setup
|
|
58
56
|
|
|
59
57
|
- name: Run tests
|
|
60
|
-
run:
|
|
58
|
+
run: mise run test
|
|
61
59
|
|
|
62
60
|
- name: Test package installation
|
|
63
61
|
run: |
|
|
64
|
-
|
|
62
|
+
mise run build
|
|
65
63
|
uv run pip install dist/*.whl
|
|
66
64
|
uv run python -c "import glean.agent_toolkit; print('Package installed successfully')"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Agent Guidelines
|
|
2
|
+
|
|
3
|
+
This project contains the **Glean Agent Toolkit**, a Python package used to integrate Glean's search and discovery tools with various agent frameworks.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
1. Install the prerequisites:
|
|
8
|
+
- [uv](https://github.com/astral-sh/uv)
|
|
9
|
+
- [mise](https://mise.jdx.dev/)
|
|
10
|
+
2. Run `mise run setup` to create the `.venv` and install all development, test, lint and typing dependencies via `uv`.
|
|
11
|
+
|
|
12
|
+
Environment variables `GLEAN_API_TOKEN` and `GLEAN_SERVER_URL` (or deprecated `GLEAN_INSTANCE`) must be set to interact with Glean or regenerate VCR cassettes.
|
|
13
|
+
|
|
14
|
+
## Development Tasks
|
|
15
|
+
|
|
16
|
+
The repository uses **mise**. Key commands include:
|
|
17
|
+
|
|
18
|
+
| Task | Description |
|
|
19
|
+
|------|-------------|
|
|
20
|
+
| `mise run test` | Run unit tests |
|
|
21
|
+
| `mise run test:watch` | Run tests in watch mode |
|
|
22
|
+
| `mise run test:cov` | Run tests with coverage |
|
|
23
|
+
| `mise run test:all` | Run tests, apply lint fixes, and run pyright |
|
|
24
|
+
| `mise run lint` | Run Ruff, formatting checks and pyright |
|
|
25
|
+
| `mise run lint:diff` | Lint only changed files |
|
|
26
|
+
| `mise run lint:fix` | Apply Ruff fixes and formatting |
|
|
27
|
+
| `mise run format` | Format code using Ruff formatter |
|
|
28
|
+
| `mise run spell:check` | Check spelling |
|
|
29
|
+
| `mise run clean` | Remove build artifacts |
|
|
30
|
+
| `mise run build` | Build the package |
|
|
31
|
+
| `mise run release` | Bump version and generate the changelog |
|
|
32
|
+
|
|
33
|
+
Special tasks exist to manage VCR cassettes used in tests:
|
|
34
|
+
|
|
35
|
+
- `mise run test:vcr:regenerate` – Re-record all HTTP interactions (requires `GLEAN_API_TOKEN` and `GLEAN_SERVER_URL`; deprecated `GLEAN_INSTANCE` is still accepted as fallback).
|
|
36
|
+
- `mise run test:vcr:clean` – Delete cassettes so the next test run regenerates them.
|
|
37
|
+
|
|
38
|
+
## Coding Guidelines
|
|
39
|
+
|
|
40
|
+
- Python **>=3.10** is required. The project enforces formatting with Ruff. Line length is limited to **100** characters and double quotes are used by default.
|
|
41
|
+
- Docstrings follow the **Google** style as configured in `pyproject.toml`.
|
|
42
|
+
- Type checking is performed with **pyright**.
|
|
43
|
+
- Tools should be implemented using the `@tool_spec` decorator found in `glean.agent_toolkit.decorators`. See existing tools under `src/glean/agent_toolkit/tools` for examples.
|
|
44
|
+
|
|
45
|
+
## Contribution Process
|
|
46
|
+
|
|
47
|
+
1. Fork the repository and create a branch from `main`.
|
|
48
|
+
2. Make your changes and ensure all tasks run cleanly (`mise run test` and `mise run lint`).
|
|
49
|
+
3. Update or add documentation when necessary.
|
|
50
|
+
4. Submit a pull request.
|
|
51
|
+
5. Be respectful and follow the project's code of conduct.
|
|
52
|
+
|
|
53
|
+
## Additional Notes
|
|
54
|
+
|
|
55
|
+
Check the [README](README.md) for feature descriptions and basic usage. The package is released under the [MIT License](LICENSE).
|
|
@@ -25,7 +25,7 @@ Examples:
|
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
# Install all dependencies including pre-commit
|
|
28
|
-
|
|
28
|
+
mise run setup
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This will:
|
|
@@ -37,7 +37,7 @@ This will:
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# Install pre-commit hooks
|
|
40
|
-
|
|
40
|
+
mise run pre-commit:install
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Available Tools
|
|
@@ -54,13 +54,13 @@ Pre-commit hooks run automatically before each commit and will:
|
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
# Run pre-commit hooks on all files
|
|
57
|
-
|
|
57
|
+
mise run pre-commit:run
|
|
58
58
|
|
|
59
59
|
# Run pre-commit hooks on changed files only
|
|
60
|
-
|
|
60
|
+
mise run pre-commit:run:diff
|
|
61
61
|
|
|
62
62
|
# Update pre-commit hooks to latest versions
|
|
63
|
-
|
|
63
|
+
mise run pre-commit:update
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Making Commits
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Contributing to Glean Agent Toolkit
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to the Glean Agent Toolkit! This guide will help you understand the project structure, development workflow, and how to add new tools.
|
|
4
|
+
|
|
5
|
+
## Project Structure
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
src/
|
|
9
|
+
├─ glean/
|
|
10
|
+
│ ├─ __init__.py
|
|
11
|
+
│ └─ agent_toolkit/ # exposes `glean.agent_toolkit`
|
|
12
|
+
│ ├─ __init__.py
|
|
13
|
+
│ ├─ decorators.py
|
|
14
|
+
│ ├─ registry.py
|
|
15
|
+
│ ├─ spec.py
|
|
16
|
+
│ ├─ adapters/
|
|
17
|
+
│ ├─ tools/
|
|
18
|
+
│ └─ cli.py
|
|
19
|
+
├─ tests/
|
|
20
|
+
└─ docs/
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Development environment
|
|
24
|
+
|
|
25
|
+
The repository relies on [uv](https://github.com/astral-sh/uv) and [mise](https://mise.jdx.dev/) for reproducible workflows and task orchestration.
|
|
26
|
+
|
|
27
|
+
### Prerequisites
|
|
28
|
+
|
|
29
|
+
1. uv
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install uv
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. mise
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
brew install mise
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### One-time setup
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
mise run setup
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The command creates `.venv/` and installs all dev/test dependencies via uv.
|
|
48
|
+
|
|
49
|
+
## Development Tasks
|
|
50
|
+
|
|
51
|
+
The project uses `mise` to manage development tasks. Here are the available tasks:
|
|
52
|
+
|
|
53
|
+
### Testing
|
|
54
|
+
|
|
55
|
+
| Task | Description |
|
|
56
|
+
| --------------------- | ---------------------------- |
|
|
57
|
+
| `mise run test` | Run unit tests |
|
|
58
|
+
| `mise run test:watch` | Run tests in watch mode |
|
|
59
|
+
| `mise run test:cov` | Run tests with coverage |
|
|
60
|
+
| `mise run test:all` | Run all tests and lint fixes |
|
|
61
|
+
|
|
62
|
+
### Linting and formatting
|
|
63
|
+
|
|
64
|
+
| Task | Description |
|
|
65
|
+
| ----------------------- | --------------------------------------- |
|
|
66
|
+
| `mise run lint` | Run Ruff, pyright and formatting checks |
|
|
67
|
+
| `mise run lint:diff` | Same as above but only on changed files |
|
|
68
|
+
| `mise run lint:package` | Lint only `glean/toolkit` |
|
|
69
|
+
| `mise run lint:tests` | Lint only `tests` |
|
|
70
|
+
| `mise run lint:fix` | Autofix style issues |
|
|
71
|
+
| `mise run format` | Apply Ruff formatter |
|
|
72
|
+
| `mise run format:diff` | Format only changed files |
|
|
73
|
+
|
|
74
|
+
### Examples and Utilities
|
|
75
|
+
|
|
76
|
+
| Task | Description |
|
|
77
|
+
| ---------------------- | ----------------------------------------------- |
|
|
78
|
+
| `mise run spell:check` | Check spelling |
|
|
79
|
+
| `mise run spell:fix` | Fix spelling |
|
|
80
|
+
| `mise run clean` | Clean build artifacts |
|
|
81
|
+
| `mise run build` | Build the package |
|
|
82
|
+
| `mise run release` | Create a new release (version bump + changelog) |
|
|
83
|
+
| `mise run security:audit` | Run dependency vulnerability audit (pip-audit) |
|
|
84
|
+
|
|
85
|
+
## Pull Request Process
|
|
86
|
+
|
|
87
|
+
1. Fork the repository and create your branch from `main`.
|
|
88
|
+
2. Make your changes and ensure that all tests pass.
|
|
89
|
+
3. Update the documentation to reflect any changes.
|
|
90
|
+
4. Submit a pull request.
|
|
91
|
+
|
|
92
|
+
## Code of Conduct
|
|
93
|
+
|
|
94
|
+
Please be respectful and considerate of others when contributing to this project.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: glean-agent-toolkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: AI Agent toolkit for adapting Glean's enterprise tools across multiple frameworks
|
|
5
5
|
Project-URL: Source Code, https://github.com/gleanwork/glean-agent-toolkit
|
|
6
6
|
Author-email: Steve Calvert <steve.calvert@glean.com>
|
|
@@ -47,9 +47,36 @@ The Glean Agent Toolkit makes it easy to integrate Glean's powerful search and k
|
|
|
47
47
|
|
|
48
48
|
## Key Features
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
- **Production-Ready Glean Tools:** Instantly add capabilities like enterprise search, employee lookup, calendar search, Gmail search, and more to your agents.
|
|
51
|
+
- **Framework Adapters:** Seamlessly convert Glean tools into formats compatible with major agent SDKs.
|
|
52
|
+
- **Custom Tool Creation:** Define your own tools once using the `@tool_spec` decorator and use them across any supported framework.
|
|
53
|
+
|
|
54
|
+
## Compatibility & Reliability
|
|
55
|
+
|
|
56
|
+
- Requires Python 3.10+
|
|
57
|
+
- Built-in retries are enabled via the Python client’s `RetryConfig`.
|
|
58
|
+
- See `docs/prerequisites.md` for server-level configuration and connector requirements.
|
|
59
|
+
|
|
60
|
+
### Retry configuration (env vars)
|
|
61
|
+
|
|
62
|
+
| Variable | Default | Description | Example |
|
|
63
|
+
| --------------------------- | ------- | ------------------------------ | ------- |
|
|
64
|
+
| `GLEAN_RETRY_INITIAL` | `1.0` | Initial backoff in seconds | `0.5` |
|
|
65
|
+
| `GLEAN_RETRY_MAX` | `50.0` | Maximum backoff in seconds | `8` |
|
|
66
|
+
| `GLEAN_RETRY_MULTIPLIER` | `1.1` | Exponential backoff multiplier | `2.0` |
|
|
67
|
+
| `GLEAN_RETRY_JITTER_MS` | `100` | Random jitter in milliseconds | `250` |
|
|
68
|
+
| `GLEAN_RETRY_ON_RATE_LIMIT` | `true` | Retry on HTTP 429 rate limits | `true` |
|
|
69
|
+
|
|
70
|
+
Retries cover transient failures such as HTTP 429/5xx and connection timeouts. Set these before constructing any Glean client usage.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Example: low-latency, bounded retries
|
|
74
|
+
export GLEAN_RETRY_INITIAL=0.5
|
|
75
|
+
export GLEAN_RETRY_MAX=8
|
|
76
|
+
export GLEAN_RETRY_MULTIPLIER=2.0
|
|
77
|
+
export GLEAN_RETRY_JITTER_MS=250
|
|
78
|
+
export GLEAN_RETRY_ON_RATE_LIMIT=true
|
|
79
|
+
```
|
|
53
80
|
|
|
54
81
|
## Installation
|
|
55
82
|
|
|
@@ -85,9 +112,11 @@ Before using any Glean tools, you'll need:
|
|
|
85
112
|
|
|
86
113
|
```bash
|
|
87
114
|
export GLEAN_API_TOKEN="your-api-token"
|
|
88
|
-
export
|
|
115
|
+
export GLEAN_SERVER_URL="https://your-company-be.glean.com"
|
|
89
116
|
```
|
|
90
117
|
|
|
118
|
+
See `docs/prerequisites.md` for instance-level connector and Admin settings required per tool.
|
|
119
|
+
|
|
91
120
|
## Quickstart Example: Company Assistant with Google ADK
|
|
92
121
|
|
|
93
122
|
Here's a complete example that demonstrates the power of the Glean Agent Toolkit. We'll build a "Company Assistant" using Google's Agent Development Kit (ADK) that can help employees find information, discover colleagues, and search company resources.
|
|
@@ -98,7 +127,7 @@ First, create the project structure:
|
|
|
98
127
|
|
|
99
128
|
```bash snippet=readme/snippet-04.bash
|
|
100
129
|
export GLEAN_API_TOKEN="your-api-token"
|
|
101
|
-
export
|
|
130
|
+
export GLEAN_SERVER_URL="https://your-company-be.glean.com"
|
|
102
131
|
```
|
|
103
132
|
|
|
104
133
|
### Step 2: Create the Agent File
|
|
@@ -110,10 +139,10 @@ import os
|
|
|
110
139
|
|
|
111
140
|
from google.adk.agents import Agent
|
|
112
141
|
|
|
113
|
-
from glean.agent_toolkit.tools import calendar_search, employee_search,
|
|
142
|
+
from glean.agent_toolkit.tools import calendar_search, employee_search, gmail_search, search
|
|
114
143
|
|
|
115
144
|
# Ensure environment variables are set
|
|
116
|
-
required_env_vars = ["GLEAN_API_TOKEN", "
|
|
145
|
+
required_env_vars = ["GLEAN_API_TOKEN", "GLEAN_SERVER_URL"]
|
|
117
146
|
for var in required_env_vars:
|
|
118
147
|
if not os.getenv(var):
|
|
119
148
|
raise ValueError(f"{var} environment variable must be set")
|
|
@@ -124,7 +153,7 @@ if not os.getenv("GOOGLE_API_KEY") and not os.getenv("GOOGLE_CLOUD_PROJECT"):
|
|
|
124
153
|
raise ValueError("Either GOOGLE_API_KEY or GOOGLE_CLOUD_PROJECT must be set for ADK")
|
|
125
154
|
|
|
126
155
|
# Convert Glean tools to Google ADK format
|
|
127
|
-
company_search =
|
|
156
|
+
company_search = search.as_adk_tool()
|
|
128
157
|
people_finder = employee_search.as_adk_tool()
|
|
129
158
|
meeting_search = calendar_search.as_adk_tool()
|
|
130
159
|
email_search = gmail_search.as_adk_tool()
|
|
@@ -138,7 +167,7 @@ root_agent = Agent(
|
|
|
138
167
|
instruction="""You are a helpful company assistant that helps employees find information,
|
|
139
168
|
people, and resources within the organization. You have access to:
|
|
140
169
|
|
|
141
|
-
- Company knowledge base and documents (use
|
|
170
|
+
- Company knowledge base and documents (use search)
|
|
142
171
|
- Employee directory and contact information (use employee_search)
|
|
143
172
|
- Calendar and meeting information (use calendar_search)
|
|
144
173
|
- Email search capabilities (use gmail_search)
|
|
@@ -163,7 +192,7 @@ Create `company_assistant/.env` with your credentials:
|
|
|
163
192
|
|
|
164
193
|
```bash snippet=readme/snippet-05.bash
|
|
165
194
|
export GLEAN_API_TOKEN="your-api-token"
|
|
166
|
-
export
|
|
195
|
+
export GLEAN_SERVER_URL="https://your-company-be.glean.com"
|
|
167
196
|
```
|
|
168
197
|
|
|
169
198
|
### Step 5: Run Your Agent
|
|
@@ -179,12 +208,12 @@ cd company_assistant/
|
|
|
179
208
|
|
|
180
209
|
Once set up, your Company Assistant can handle requests like:
|
|
181
210
|
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
211
|
+
- _"Find our security guidelines for handling customer data"_
|
|
212
|
+
- _"Who's the product manager for the mobile app team?"_
|
|
213
|
+
- _"Show me emails about the budget planning meeting from last week"_
|
|
214
|
+
- _"I need the engineering team's architecture docs for the payment system"_
|
|
215
|
+
- _"Find all the design review meetings scheduled for this month"_
|
|
216
|
+
- _"Who worked on the API authentication project? I need to ask them some questions"_
|
|
188
217
|
|
|
189
218
|
This type of assistant can dramatically improve employee productivity by making company knowledge instantly accessible through natural conversation.
|
|
190
219
|
|
|
@@ -192,18 +221,33 @@ This type of assistant can dramatically improve employee productivity by making
|
|
|
192
221
|
|
|
193
222
|
The toolkit comes with a suite of production-ready tools that connect to various Glean functionalities:
|
|
194
223
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
224
|
+
- `search`: Search your company's knowledge base for relevant documents and information
|
|
225
|
+
- **`read_document`**: Read full content of a specific document by ID or URL (requires
|
|
226
|
+
config settings `queryapi.getDocuments.enabled` and `queryapi.getDocuments.content.enabled`)
|
|
227
|
+
- **`web_search`**: Search the public web for up-to-date external information
|
|
228
|
+
- `calendar_search`: Find meetings and calendar events
|
|
229
|
+
- `employee_search`: Search for employees by name, team, department, or expertise
|
|
230
|
+
- `code_search`: Search your company's source code repositories
|
|
231
|
+
- `gmail_search`: Search Gmail messages and conversations
|
|
232
|
+
- `outlook_search`: Search Outlook mail and calendar items
|
|
233
|
+
|
|
234
|
+
### Web Research with Context
|
|
235
|
+
|
|
236
|
+
```python snippet=readme/snippet-09.py
|
|
237
|
+
from glean.agent_toolkit.tools import web_search
|
|
238
|
+
|
|
239
|
+
# External information gathering
|
|
240
|
+
web_tool = web_search.as_langchain_tool()
|
|
241
|
+
|
|
242
|
+
# Example queries:
|
|
243
|
+
# "Latest industry trends in machine learning"
|
|
244
|
+
# "Current market analysis for SaaS companies"
|
|
245
|
+
# "Recent news about our competitors"
|
|
246
|
+
```
|
|
203
247
|
|
|
204
248
|
## Quick Start Examples
|
|
205
249
|
|
|
206
|
-
### Using `
|
|
250
|
+
### Using `search` with Different Frameworks
|
|
207
251
|
|
|
208
252
|
#### OpenAI Agents SDK
|
|
209
253
|
|
|
@@ -212,11 +256,11 @@ import os
|
|
|
212
256
|
|
|
213
257
|
from agents import Agent, Runner
|
|
214
258
|
|
|
215
|
-
from glean.agent_toolkit.tools import
|
|
259
|
+
from glean.agent_toolkit.tools import search
|
|
216
260
|
|
|
217
261
|
# Ensure environment variables are set
|
|
218
262
|
assert os.getenv("GLEAN_API_TOKEN"), "GLEAN_API_TOKEN must be set"
|
|
219
|
-
assert os.getenv("
|
|
263
|
+
assert os.getenv("GLEAN_SERVER_URL"), "GLEAN_SERVER_URL must be set"
|
|
220
264
|
assert os.getenv("OPENAI_API_KEY"), "OPENAI_API_KEY must be set"
|
|
221
265
|
|
|
222
266
|
# Create an agent with the Glean search tool
|
|
@@ -224,7 +268,7 @@ agent = Agent(
|
|
|
224
268
|
name="KnowledgeAssistant",
|
|
225
269
|
instructions="""You help users find information from the company knowledge base using
|
|
226
270
|
Glean search.""",
|
|
227
|
-
tools=[
|
|
271
|
+
tools=[search], # Use the tool function directly
|
|
228
272
|
)
|
|
229
273
|
|
|
230
274
|
# Run a search query
|
|
@@ -241,20 +285,20 @@ from langchain.agents import AgentExecutor, create_react_agent
|
|
|
241
285
|
from langchain_core.prompts import ChatPromptTemplate
|
|
242
286
|
from langchain_openai import ChatOpenAI
|
|
243
287
|
|
|
244
|
-
from glean.agent_toolkit.tools import
|
|
288
|
+
from glean.agent_toolkit.tools import search
|
|
245
289
|
|
|
246
290
|
# Ensure environment variables are set
|
|
247
291
|
assert os.getenv("GLEAN_API_TOKEN"), "GLEAN_API_TOKEN must be set"
|
|
248
|
-
assert os.getenv("
|
|
292
|
+
assert os.getenv("GLEAN_SERVER_URL"), "GLEAN_SERVER_URL must be set"
|
|
249
293
|
|
|
250
294
|
# Convert to LangChain tool format
|
|
251
|
-
langchain_tool =
|
|
295
|
+
langchain_tool = search.as_langchain_tool()
|
|
252
296
|
|
|
253
297
|
llm = ChatOpenAI(model="gpt-4", temperature=0)
|
|
254
298
|
tools = [langchain_tool]
|
|
255
299
|
|
|
256
300
|
prompt_template = """You are a helpful assistant with access to company knowledge.
|
|
257
|
-
Use the
|
|
301
|
+
Use the search tool to find relevant information when users ask questions.
|
|
258
302
|
|
|
259
303
|
Tools available:
|
|
260
304
|
{tools}
|
|
@@ -287,14 +331,14 @@ import os
|
|
|
287
331
|
|
|
288
332
|
from crewai import Agent, Crew, Task
|
|
289
333
|
|
|
290
|
-
from glean.agent_toolkit.tools import
|
|
334
|
+
from glean.agent_toolkit.tools import search
|
|
291
335
|
|
|
292
336
|
# Ensure environment variables are set
|
|
293
337
|
assert os.getenv("GLEAN_API_TOKEN"), "GLEAN_API_TOKEN must be set"
|
|
294
|
-
assert os.getenv("
|
|
338
|
+
assert os.getenv("GLEAN_SERVER_URL"), "GLEAN_SERVER_URL must be set"
|
|
295
339
|
|
|
296
340
|
# Convert to CrewAI tool format
|
|
297
|
-
crewai_tool =
|
|
341
|
+
crewai_tool = search.as_crewai_tool()
|
|
298
342
|
|
|
299
343
|
# Create a research agent
|
|
300
344
|
researcher = Agent(
|
|
@@ -366,21 +410,6 @@ calendar_tool = calendar_search.as_langchain_tool()
|
|
|
366
410
|
# "Search for messages containing budget discussions"
|
|
367
411
|
```
|
|
368
412
|
|
|
369
|
-
#### Web Research with Context
|
|
370
|
-
|
|
371
|
-
```python snippet=readme/snippet-09.py
|
|
372
|
-
from glean.agent_toolkit.tools import ai_web_search, web_search
|
|
373
|
-
|
|
374
|
-
# External information gathering
|
|
375
|
-
web_tool = web_search.as_langchain_tool()
|
|
376
|
-
ai_web_tool = ai_web_search.as_langchain_tool()
|
|
377
|
-
|
|
378
|
-
# Example queries:
|
|
379
|
-
# "Latest industry trends in machine learning"
|
|
380
|
-
# "Current market analysis for SaaS companies"
|
|
381
|
-
# "Recent news about our competitors"
|
|
382
|
-
```
|
|
383
|
-
|
|
384
413
|
## Creating Custom Tools with `@tool_spec`
|
|
385
414
|
|
|
386
415
|
Define your own tools that work across all supported frameworks:
|
|
@@ -432,4 +461,4 @@ Interested in contributing? Check out our [Contributing Guide](CONTRIBUTING.md)
|
|
|
432
461
|
|
|
433
462
|
## License
|
|
434
463
|
|
|
435
|
-
This project is licensed under the [MIT License](LICENSE).
|
|
464
|
+
This project is licensed under the [MIT License](LICENSE).
|