From 8663c7e1c26040a3fa8dfb06b23463f3efdaea2c Mon Sep 17 00:00:00 2001 From: Lucas Gomide Date: Mon, 12 May 2025 09:10:31 -0300 Subject: [PATCH 1/2] Enable ALL Ruff rules set by default (#2775) * style: use Ruff default linter rules * ci: check linter files over changed ones --- .github/workflows/linter.yml | 25 +++++++++++++++++++++---- .ruff.toml | 5 ----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f9853cf7c..3e1571830 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,12 +5,29 @@ on: [pull_request] jobs: lint: runs-on: ubuntu-latest + env: + TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Install Requirements + - name: Fetch Target Branch + run: git fetch origin $TARGET_BRANCH --depth=1 + + - name: Install Ruff + run: pip install ruff + + - name: Get Changed Python Files + id: changed-files run: | - pip install ruff + merge_base=$(git merge-base origin/"$TARGET_BRANCH" HEAD) + changed_files=$(git diff --name-only --diff-filter=ACMRTUB "$merge_base" | grep '\.py$' || true) + echo "files<> $GITHUB_OUTPUT + echo "$changed_files" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - - name: Run Ruff Linter - run: ruff check + - name: Run Ruff on Changed Files + if: ${{ steps.changed-files.outputs.files != '' }} + run: | + echo "${{ steps.changed-files.outputs.files }}" | tr " " "\n" | xargs -I{} ruff check "{}" diff --git a/.ruff.toml b/.ruff.toml index acc241bd4..4f8811cef 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -2,8 +2,3 @@ exclude = [ "templates", "__init__.py", ] - -[lint] -select = [ - "I", # isort rules -] From 4e496d7a202802917ad4f47eb9efdd6a41f06e18 Mon Sep 17 00:00:00 2001 From: Vidit Ostwal <110953813+Vidit-Ostwal@users.noreply.github.com> Date: Mon, 12 May 2025 17:57:18 +0530 Subject: [PATCH 2/2] Added link to github issue (#2810) Co-authored-by: Lucas Gomide --- docs/concepts/knowledge.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/concepts/knowledge.mdx b/docs/concepts/knowledge.mdx index 5e302cf1c..b4c7627d3 100644 --- a/docs/concepts/knowledge.mdx +++ b/docs/concepts/knowledge.mdx @@ -700,4 +700,11 @@ recent_news = SpaceNewsKnowledgeSource( - Configure appropriate embedding models - Consider using local embedding providers for faster processing + + + - With the typical file structure provided by CrewAI, knowledge sources are embedded every time the kickoff is triggered. + - If the knowledge sources are large, this leads to inefficiency and increased latency, as the same data is embedded each time. + - To resolve this, directly initialize the knowledge parameter instead of the knowledge_sources parameter. + - Link to the issue to get complete idea [Github Issue](https://github.com/crewAIInc/crewAI/issues/2755) +