Skip to content

Commit

Permalink
further type check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IMladjenovic committed Dec 13, 2024
1 parent c55973b commit 1d183c9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/agents/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, cast
from typing import List

from src.utils import Config
from src.agents.agent import Agent, ChatAgent, agent
Expand Down
2 changes: 1 addition & 1 deletion backend/src/agents/agent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import ABC
import json
import logging
from typing import List, Type, Union, TypeVar, Optional
from typing import List, Type, TypeVar, Optional
from src.llm import LLM, get_llm
from src.utils.log_publisher import LogPrefix, publish_log_info

Expand Down
4 changes: 4 additions & 0 deletions backend/src/agents/report_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
engine = PromptEngine()


@agent(
name="ReportAgent",
description="This agent is responsible for creating ESG reports on narrative documents"
)
class ReportAgent(Agent):
async def create_report(self, file_content: str, materiality_topics: dict[str, str]) -> str:
user_prompt = engine.load_prompt(
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/agents/materiality_agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
async def test_invoke_calls_llm(mocker):
agent = MaterialityAgent(llm_name="mockllm", model=mock_model)

with patch("builtins.open", mock_open(read_data=json.dumps(mock_catalogue))) as mock_file:
with patch("builtins.open", mock_open(read_data=json.dumps(mock_catalogue))):
mock_llm.chat = mocker.AsyncMock(return_value=json.dumps(mock_selected_files))
mock_llm.chat_with_file = mocker.AsyncMock(return_value=json.dumps(mock_materiality_topics))

Expand Down
2 changes: 1 addition & 1 deletion backend/tests/directors/report_director_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from fastapi.datastructures import Headers
import pytest

from src.session.file_uploads import FileUpload, FileUploadReport
from src.session.file_uploads import FileUpload
from src.directors.report_director import report_on_file_upload


Expand Down

0 comments on commit 1d183c9

Please sign in to comment.