From db3e74629f52003ceb0cc029c01db5a400abc491 Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Tue, 3 Jun 2025 11:48:51 +0800 Subject: [PATCH] fix: added permissions setting in the workflow (#273) * fix: added permissions setting in the workflow * fix: reformat the code of src/tools/retriever.py --- .github/workflows/lint.yaml | 3 +++ .github/workflows/unittest.yaml | 3 +++ src/tools/retriever.py | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 5fa1cb0..6e6316d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -6,6 +6,9 @@ on: pull_request: branches: [ '*' ] +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index 5e36cb9..c8902b2 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -6,6 +6,9 @@ on: pull_request: branches: [ '*' ] +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest diff --git a/src/tools/retriever.py b/src/tools/retriever.py index a05792d..fc0bf93 100644 --- a/src/tools/retriever.py +++ b/src/tools/retriever.py @@ -22,7 +22,9 @@ class RetrieverInput(BaseModel): class RetrieverTool(BaseTool): name: str = "local_search_tool" - description: str = "Useful for retrieving information from the file with `rag://` uri prefix, it should be higher priority than the web search or writing code. Input should be a search keywords." + description: str = ( + "Useful for retrieving information from the file with `rag://` uri prefix, it should be higher priority than the web search or writing code. Input should be a search keywords." + ) args_schema: Type[BaseModel] = RetrieverInput retriever: Retriever = Field(default_factory=Retriever)