Fix method invocation in LoggerChatModel

This commit resolves an issue where the LoggerChatModel class was incorrectly
    attempting to call instances of AIModel directly as if they were callable objects.

    Changes include:
    - Modified __call__ method to explicitly use the invoke method when calling AI models.
    - Updated constructor documentation to clarify the type of object expected.
    - Added additional debug logging for better traceability of method entry and exit points.

    These changes ensure that the LoggerChatModel class aligns with the intended design
    patterns and correctly utilizes the AIModel instances, improving the maintainability
    and robustness of the codebase.
This commit is contained in:
blackms 2024-09-09 17:52:07 +02:00
parent 9ef928569b
commit 7d7110253a
6 changed files with 67 additions and 210 deletions

View file

@ -9,7 +9,7 @@ from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager
from selenium.common.exceptions import WebDriverException, TimeoutException
from lib_resume_builder_AIHawk import Resume,StyleManager,FacadeManager,ResumeGenerator
from src.utils import chromeBrowserOptions
from src.utils import chrome_browser_options
from src.gpt import GPTAnswerer
from src.linkedIn_authenticator import LinkedInAuthenticator
from src.linkedIn_bot_facade import LinkedInBotFacade
@ -149,7 +149,7 @@ class FileManager:
def init_browser() -> webdriver.Chrome:
try:
options = chromeBrowserOptions()
options = chrome_browser_options()
service = ChromeService(ChromeDriverManager().install())
return webdriver.Chrome(service=service, options=options)
except Exception as e: