From 9421b69e075a64789abb9a151c6368891e1bc099 Mon Sep 17 00:00:00 2001 From: Sermet Pekin Date: Wed, 21 Aug 2024 07:45:59 +0300 Subject: [PATCH] ResultChat class was modified --- evdschat/core/chat.py | 2 +- evdschat/model/chatters.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/evdschat/core/chat.py b/evdschat/core/chat.py index e645ddf..c65b12f 100644 --- a/evdschat/core/chat.py +++ b/evdschat/core/chat.py @@ -16,7 +16,7 @@ from evdschat.model.chatters import ModelAbstract, OpenAI from ..common.github_actions import PytestTesting from typing import TypeVar, Tuple, Union -from .result import ResultChat +from .result import ResultChat , Status # Result = TypeVar("Result") Notes = TypeVar("Notes") diff --git a/evdschat/model/chatters.py b/evdschat/model/chatters.py index 983f852..9bb97d8 100644 --- a/evdschat/model/chatters.py +++ b/evdschat/model/chatters.py @@ -29,12 +29,10 @@ import pandas as pd -from evdschat.core.result import Result, ResultChat , create_result +from evdschat.core.result import Result, ResultChat, create_result from evdschat.core.result import Status - - def get_myapi_url(): from dotenv import load_dotenv @@ -108,12 +106,12 @@ def eval(self, kw: dict, permitted=None) -> Union[Tuple[Any, str], None]: del kw["notes"] try: result = self.retrieve_fnc(kw["index"], **nkw) - res = create_result(result) + res = create_result(result, status=Status.success) return res, notes except Exception: traceback.print_exc() - return create_result(None, "Eval failed") , str("") + return create_result(None, status=Status.failed, reason="Eval failed"), str("") def decide_caller(self): if self.test: