Skip to content

Commit df8b0bc

Browse files
dependabot[bot]sdn4z
authored andcommitted
chore: bump mypy from 1.19.1 to 1.20.0
Bumps [mypy](https://github.com/python/mypy) from 1.19.1 to 1.20.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.19.1...v1.20.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.20.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
1 parent 0d861f3 commit df8b0bc

File tree

21 files changed

+66
-161
lines changed

21 files changed

+66
-161
lines changed

.github/workflows/auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- name: Dependabot metadata
1414
id: metadata
15-
uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0
15+
uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
1616
with:
1717
github-token: "${{ secrets.GITHUB_TOKEN }}"
1818
- name: Enable auto-merge for Dependabot PRs

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2121

2222
- name: Install uv
23-
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
23+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2424

2525
- name: Build the package
2626
run: uv build --python $PYTHON_VERSION

.github/workflows/bump-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
name: "Bump version and create changelog with commitizen"
1414
steps:
15-
- uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
15+
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
1616
id: app-token
1717
with:
1818
app-id: ${{ vars.ELEMENTSINTERACTIVE_BOT_APP_ID }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717

1818
- name: Install uv
19-
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
19+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2020

2121
- name: Install the project
2222
run: uv sync --locked --group lint --group test --all-extras --python 3.13

.github/workflows/preview-bump-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
name: "Preview next version"
1414
steps:
15-
- uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
15+
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
1616
id: app-token
1717
with:
1818
app-id: ${{ vars.ELEMENTSINTERACTIVE_BOT_APP_ID }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2323
- name: Install uv
24-
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
24+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2525
- name: Publish to pypi
2626
run: |
2727
uv build --python 3.13

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1717

1818
- name: Install uv
19-
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
19+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
2020

2121
- name: Install the project
2222
run: uv sync --locked --group test --all-extras --python 3.13

eval/evaluator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async def evaluate(
2525
) -> None:
2626
agent_class = get_agent_class_from_agent_name(agent)
2727
classified_articles = await Classifier(
28-
agent=agent_class(prompt, model=model),
28+
agent=agent_class(len(sources) > 1 if sources else False, prompt, model=model),
2929
score=score_threshold,
3030
relevant_articles=relevant_articles,
3131
non_relevant_articles=non_relevant_articles,

src/lightman_ai/ai/base/agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class BaseAgent(ABC):
1616

1717
def __init__(
1818
self,
19+
multiple_sources: bool,
1920
system_prompt: str,
2021
model: str | None = None,
2122
logger: logging.Logger | None = None,
@@ -26,7 +27,7 @@ def __init__(
2627
model=agent_model,
2728
output_type=SelectedArticlesList,
2829
system_prompt=system_prompt,
29-
instructions=MERGE_ARTICLES_FROM_DIFFERENT_SOURCES,
30+
instructions=MERGE_ARTICLES_FROM_DIFFERENT_SOURCES if multiple_sources else None,
3031
)
3132
self.logger = logger or logging.getLogger("lightman")
3233
self.logger.info("Selected %s's %s model", self, selected_model)

src/lightman_ai/main.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,13 @@ async def lightman(
7777
if not sources:
7878
raise NoSourcesError
7979

80-
tasks = [_get_articles_from_source(source, start_date) for source in sources]
81-
articles_lists = await asyncio.gather(*tasks)
82-
8380
articles = ArticlesList()
84-
for articles_list in articles_lists:
85-
articles += articles_list
81+
for source in sources:
82+
articles += await _get_articles_from_source(source, start_date)
8683

84+
multiple_sources = len(sources) > 1
8785
agent_class = get_agent_class_from_agent_name(agent)
88-
agent_instance = agent_class(prompt, model, logger=logger)
86+
agent_instance = agent_class(multiple_sources, prompt, model, logger=logger)
8987

9088
classified_articles = await _classify_articles(
9189
articles=articles,

0 commit comments

Comments
 (0)