diff --git a/.vscode/settings.json b/.vscode/settings.json index 843b407..6898879 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -26,5 +26,7 @@ }, "[dockerfile]": { "editor.defaultFormatter": "ms-azuretools.vscode-docker" - } + }, + "python.autoComplete.extraPaths": ["./server"], + "python.analysis.extraPaths": ["./server"] } diff --git a/Dockerfile b/Dockerfile index 4ea2cf1..3ad1857 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,4 @@ ENV FLASK_ENV production EXPOSE 80 WORKDIR /app/api -CMD ["gunicorn", "--worker-class", "eventlet", "-w", "1", "-b", ":80", "api:app"] \ No newline at end of file +CMD ["gunicorn", "--worker-class", "eventlet", "-w", "10", "-b", ":80", "api:app"] \ No newline at end of file diff --git a/server/api.py b/server/api.py index de932d0..92b8cc4 100644 --- a/server/api.py +++ b/server/api.py @@ -1,29 +1,21 @@ """ This module contains the Flask RESTful API endpoint for the workflow editor. """ -import importlib import os import argparse -import json - from dotenv import load_dotenv -from flask import Flask, request, jsonify, make_response -from flask_restful import Resource, Api + +from flask import Flask, request +from flask_jwt_extended import JWTManager +from flask_restful import Api from flask_socketio import SocketIO from flask_cors import CORS -from flask_jwt_extended import ( - JWTManager, - create_access_token, - get_jwt_identity, - jwt_required, -) -# pylint: disable=import-error -from assistant import AssistantException, call_asssistant_api -from db.db import DatabaseInterface -from resources.user import User -users = User() +from controllers.assisstant import RunAssistant +from controllers.features import GetFeatures +from controllers.login import Login + load_dotenv() @@ -41,250 +33,10 @@ jwt = JWTManager(app) -UPLOAD_DIRECTORY = "paper/" - -if not os.path.exists(UPLOAD_DIRECTORY): - os.makedirs(UPLOAD_DIRECTORY) - - -db = DatabaseInterface() - - -class GetFeatures(Resource): - """ - Represents a resource for the HelloWorld endpoint. - This resource provides GET and POST methods for the HelloWorld endpoint. - """ - - @jwt_required() - def get(self): - """ - Handles GET requests to the features endpoint. - Returns: - A Flask response object with a JSON representation of the response data. - """ - features_dir = "features" - py_files = [] - - for root, dirs, files in os.walk(features_dir): - # Skip __pycache__ directories - if "__pycache__" in dirs: - dirs.remove("__pycache__") - - for file in files: - if ( - file.endswith(".py") - and file != "__init__.py" - and file != "gpt_feature.py" - ): - file_path = os.path.normpath(os.path.join(root, file)) - relative_path = os.path.relpath(file_path, features_dir) - - # Skip files with the same name as their parent directory - parent_dir = os.path.basename(os.path.dirname(file_path)) - if os.path.splitext(file)[0] == parent_dir: - continue - - # Replace '/' with '.' - formatted_path = relative_path.replace(os.path.sep, ".") - formatted_path = formatted_path.replace(".py", "") - - py_files.append(formatted_path) - - response_data = {"features": py_files} - response = make_response(jsonify(response_data)) - response.status_code = 200 - return response - - @jwt_required() - def post(self): - """ - Handles POST requests to the HelloWorld endpoint. - Parses the request JSON data and prints the nodes and edges. - Returns: - A Flask response object with a JSON representation of the response data. - """ - user_id = get_jwt_identity() - print(f"User ID: {user_id}") - data = request.get_json() - return jsonify(data) - - -def load_feature(module_path): - """Dynamically loads a feature class from a module path.""" - module = importlib.import_module(module_path) - return module.Feature - - -class RunFeatures(Resource): - """ - Represents a resource for running the features. - This resource provides GET method for running and collecting feature prompts. - """ - - def post(self): - """ - Handles GET requests to run features. - Dynamically loads the features and collects their prompt attributes. - Returns: - A Flask response object with a JSON representation of the prompts. - """ - try: - data = request.get_json() - except json.JSONDecodeError: - response_data = {"error": "Invalid JSON data."} - response = make_response(jsonify(response_data)) - response.status_code = 400 - return response - - try: - features = data["features"] - if not features: - raise KeyError - except KeyError: - response_data = {"error": "No features provided."} - response = make_response(jsonify(response_data)) - response.status_code = 400 - return response - # Assuming `features` is obtained from the GetFeatures endpoint, - # this is a mock to demonstrate - features = [ - "features.condition.condition", - "features.condition.condition_name", - "features.condition.condition_description", - "features.condition.condition_type", - "features.condition.condition_message", - ] - - prompts = [] - for idx, feature_path in enumerate(features): - feature_class = load_feature(feature_path) - feature_instance = feature_class() - # Assuming your class has an attribute or method to get the prompt - prompts.append({"id": idx, "prompt": feature_instance.feature_prompt}) - - response_data = {"prompts": prompts} - response = make_response(jsonify(response_data)) - response.status_code = 200 - return response - - -class RunAssistant(Resource): - """ - Represents a resource for handling file uploads. - Methods: - - post: Handles the POST request for file uploads. - """ - - def post(self): - """ - Handles the POST request for file uploads. - Returns: - - JSON response containing the status of the upload: - - If successful, returns {"message": "File successfully uploaded", "path": file_path}. - - If there is an error, returns {"error": "No file part"} or {"error": "No selected file"}. - """ - sid = request.form.get("sid") - - if "file" not in request.files: - return jsonify({"error": "No file part"}) - file = request.files["file"] - if file.filename == "": - return jsonify({"error": "No selected file"}) - if file: - file_path = os.path.join(UPLOAD_DIRECTORY, file.filename) - file.save(file_path) - try: - result = call_asssistant_api(file_path, sid, socketio) - - print("result : ", json.dumps(result)) - socketio.emit( - "status", - {"status": "Fetching all features...", "progress": 0}, - to=sid, - ) - - response_data = { - "message": "File successfully uploaded", - "file_name": file.filename, - "experiments": result["experiments"], - } - - # Delete the uploaded - if os.path.isfile(file_path): - os.remove(file_path) - print("File removed from local storage successfully") - else: - # If it fails, inform the user. - print("Error: %s file not found" % file_path) - - response = make_response(jsonify(response_data)) - response.status_code = 200 - return response - except AssistantException as e: - response_data = {"error": str(e)} - response = make_response(jsonify(response_data)) - response.status_code = 500 - return response - else: - response_data = {"error": "File upload failed"} - response = make_response(jsonify(response_data)) - response.status_code = 400 - return response - - -class Login(Resource): - """ - Represents a resource for handling user login. - Methods: - - post: Handles the POST request for user login. - """ - - def post(self): - """ - Handles the POST request for user login. - Returns: - - JSON response containing the status of the login: - - If successful, returns {"message": "User successfully logged in"}. - - If there is an error, returns {"error": "Invalid username or password"}. - """ - try: - data = request.get_json() - except json.JSONDecodeError: - response_data = {"error": "Invalid JSON data."} - response = make_response(jsonify(response_data)) - response.status_code = 400 - return response - - email = data["email"] - magic_link = data["magic_link"] - - user = users.find_by_email(email) - - print("user", user) - - if user and user["magic_link"] == magic_link: - access_token = create_access_token(identity=user["username"]) - response = make_response( - jsonify( - { - "message": "User successfully logged in", - "access_token": access_token, - } - ) - ) - response.status_code = 200 - return response - else: - response_data = {"error": "Invalid username or password"} - response = make_response(jsonify(response_data)) - response.status_code = 401 - return response - - api.add_resource(GetFeatures, "/api/features") -api.add_resource(RunFeatures, "/api/run") -api.add_resource(RunAssistant, "/api/run_assistant") +api.add_resource( + RunAssistant, "/api/run_assistant", resource_class_kwargs={"socketio": socketio} +) api.add_resource(Login, "/api/login") @@ -314,6 +66,7 @@ def index(): @app.errorhandler(404) def not_found(e): + """reroute to index.html for all other routes""" return app.send_static_file("index.html") diff --git a/server/assistant.py b/server/assistant.py index 31825de..2cffc32 100644 --- a/server/assistant.py +++ b/server/assistant.py @@ -11,8 +11,6 @@ load_dotenv() -client = OpenAI() - class AssistantException(Exception): """ @@ -223,7 +221,7 @@ def build_feature_functions( return experiments_function_call -def upload_file_to_vector_store(file_path: str) -> str: +def upload_file_to_vector_store(client: OpenAI, file_path: str) -> str: """ Uploads a file to the vector store. @@ -248,7 +246,10 @@ def upload_file_to_vector_store(file_path: str) -> str: def update_assistant( - assistant_id: str, vector_store, functions: List[Dict[str, Union[int, str]]] + client: OpenAI, + assistant_id: str, + vector_store, + functions: List[Dict[str, Union[int, str]]], ): """ Updates the assistant with the new functions. @@ -285,7 +286,35 @@ def check_output_format(output): raise AssistantException("Output format is incorrect") +def create_temporary_assistant(client: OpenAI): + """ + Creates a temporary assistant with the given functions. + + Args: + - client: OpenAI client object. + + Returns: + - The created assistant. + """ + + my_temporary_assistant = client.beta.assistants.create( + instructions=( + "You are a research assistnant for a team of scientists. " + "You are tasked with summarizing the key findings of a scientific paper. " + "You are given a PDF of the paper and are asked to provide a summary of the key findings. Your response should be in JSON format." + ), + name="Atlas explorer", + model="gpt-4o", + temperature=1, + ) + + return my_temporary_assistant + + def call_asssistant_api(file_path: str, sid: str, sio): + + client = OpenAI() + try: sio.emit( "status", @@ -309,7 +338,15 @@ def call_asssistant_api(file_path: str, sid: str, sio): to=sid, namespace="/home", ) - vector_store = upload_file_to_vector_store(file_path) + vector_store = upload_file_to_vector_store(client, file_path) + + sio.emit( + "status", + {"status": "Creating an assistant for your task...", "progress": 12}, + to=sid, + namespace="/home", + ) + my_temporary_assistant = create_temporary_assistant(client) sio.emit( "status", @@ -318,7 +355,7 @@ def call_asssistant_api(file_path: str, sid: str, sio): namespace="/home", ) updated_assistant = update_assistant( - "asst_2THkE8dZlIZDDCZvd3ZBjara", vector_store, functions + client, my_temporary_assistant.id, vector_store, functions ) sio.emit( @@ -331,7 +368,7 @@ def call_asssistant_api(file_path: str, sid: str, sio): messages=[ { "role": "user", - "content": "define_conditions_and_behaviors", + "content": "define_experiments_conditions_and_behaviors", } ], ) @@ -342,6 +379,7 @@ def call_asssistant_api(file_path: str, sid: str, sio): to=sid, namespace="/home", ) + run = client.beta.threads.runs.create_and_poll( thread_id=thread_message.id, assistant_id=updated_assistant.id ) @@ -352,9 +390,14 @@ def call_asssistant_api(file_path: str, sid: str, sio): to=sid, namespace="/home", ) - tool_outputs = json.loads( - run.required_action.submit_tool_outputs.tool_calls[0].function.arguments - ) + + try: + tool_outputs = json.loads( + run.required_action.submit_tool_outputs.tool_calls[0].function.arguments + ) + except Exception as e: + print(e) + print(run) sio.emit( "status", @@ -403,6 +446,8 @@ def call_asssistant_api(file_path: str, sid: str, sio): client.beta.threads.delete(thread_id=thread_message.id) + client.beta.assistants.delete(my_temporary_assistant.id) + return tool_outputs diff --git a/server/controllers/__init__.py b/server/controllers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/controllers/assisstant.py b/server/controllers/assisstant.py new file mode 100644 index 0000000..68677e4 --- /dev/null +++ b/server/controllers/assisstant.py @@ -0,0 +1,84 @@ +""" +endpoint for running the assistant +""" + +import os +import json +from flask import jsonify, make_response, request +from flask_restful import Resource + + +from assistant import AssistantException, call_asssistant_api + + +UPLOAD_DIRECTORY = "../paper/" + +if not os.path.exists(UPLOAD_DIRECTORY): + os.makedirs(UPLOAD_DIRECTORY) + + +class RunAssistant(Resource): + """ + Represents a resource for handling file uploads. + Methods: + - post: Handles the POST request for file uploads. + """ + + def __init__(self, **kwargs): + self.socketio = kwargs.get("socketio") + + def post(self): + """ + Handles the POST request for file uploads. + Returns: + - JSON response containing the status of the upload: + - If successful, returns {"message": "File successfully uploaded", "path": file_path}. + - If there is an error, returns {"error": "No file part"} or {"error": "No selected file"}. + """ + sid = request.form.get("sid") + + if "file" not in request.files: + return jsonify({"error": "No file part"}) + file = request.files["file"] + if file.filename == "": + return jsonify({"error": "No selected file"}) + if file: + file_path = os.path.join(UPLOAD_DIRECTORY, file.filename) + file.save(file_path) + try: + result = call_asssistant_api(file_path, sid, self.socketio) + + # print("result : ", json.dumps(result)) + self.socketio.emit( + "status", + {"status": "Fetching all features...", "progress": 0}, + to=sid, + ) + + response_data = { + "message": "File successfully uploaded", + "file_name": file.filename, + "experiments": result["experiments"], + } + + # Delete the uploaded + if os.path.isfile(file_path): + os.remove(file_path) + print("File removed from local storage successfully") + else: + # If it fails, inform the user. + print(f"Error: {file_path} file not found") + + response = make_response(jsonify(response_data)) + response.status_code = 200 + return response + except AssistantException as e: + response_data = {"error": str(e)} + response = make_response(jsonify(response_data)) + response.status_code = 500 + return response + else: + response_data = {"error": "File upload failed"} + response = make_response(jsonify(response_data)) + response.status_code = 400 + return response diff --git a/server/controllers/features.py b/server/controllers/features.py new file mode 100644 index 0000000..054e079 --- /dev/null +++ b/server/controllers/features.py @@ -0,0 +1,68 @@ +""" +This module contains the GetFeatures class, which represents a resource for the features endpoint. +""" + +import os +from flask import jsonify, make_response, request +from flask_jwt_extended import get_jwt_identity, jwt_required +from flask_restful import Resource + + +class GetFeatures(Resource): + """ + Represents a resource for the HelloWorld endpoint. + This resource provides GET and POST methods for the HelloWorld endpoint. + """ + + @jwt_required() + def get(self): + """ + Handles GET requests to the features endpoint. + Returns: + A Flask response object with a JSON representation of the response data. + """ + features_dir = "features" + py_files = [] + + for root, dirs, files in os.walk(features_dir): + # Skip __pycache__ directories + if "__pycache__" in dirs: + dirs.remove("__pycache__") + + for file in files: + if ( + file.endswith(".py") + and file != "__init__.py" + and file != "gpt_feature.py" + ): + file_path = os.path.normpath(os.path.join(root, file)) + relative_path = os.path.relpath(file_path, features_dir) + + # Skip files with the same name as their parent directory + parent_dir = os.path.basename(os.path.dirname(file_path)) + if os.path.splitext(file)[0] == parent_dir: + continue + + # Replace '/' with '.' + formatted_path = relative_path.replace(os.path.sep, ".") + formatted_path = formatted_path.replace(".py", "") + + py_files.append(formatted_path) + + response_data = {"features": py_files} + response = make_response(jsonify(response_data)) + response.status_code = 200 + return response + + @jwt_required() + def post(self): + """ + Handles POST requests to the HelloWorld endpoint. + Parses the request JSON data and prints the nodes and edges. + Returns: + A Flask response object with a JSON representation of the response data. + """ + user_id = get_jwt_identity() + print(f"User ID: {user_id}") + data = request.get_json() + return jsonify(data) diff --git a/server/controllers/login.py b/server/controllers/login.py new file mode 100644 index 0000000..9d7eec4 --- /dev/null +++ b/server/controllers/login.py @@ -0,0 +1,62 @@ +""" +This module contains the Login class, which represents a resource for handling user login. +""" + +import json +from flask import request, jsonify, make_response +from flask_jwt_extended import create_access_token +from flask_restful import Resource + +from resources.user import User + + +users = User() + + +class Login(Resource): + """ + Represents a resource for handling user login. + Methods: + - post: Handles the POST request for user login. + """ + + def post(self): + """ + Handles the POST request for user login. + Returns: + - JSON response containing the status of the login: + - If successful, returns {"message": "User successfully logged in"}. + - If there is an error, returns {"error": "Invalid username or password"}. + """ + try: + data = request.get_json() + except json.JSONDecodeError: + response_data = {"error": "Invalid JSON data."} + response = make_response(jsonify(response_data)) + response.status_code = 400 + return response + + email = data["email"] + magic_link = data["magic_link"] + + user = users.find_by_email(email) + + print("user", user) + + if user and user["magic_link"] == magic_link: + access_token = create_access_token(identity=user["username"]) + response = make_response( + jsonify( + { + "message": "User successfully logged in", + "access_token": access_token, + } + ) + ) + response.status_code = 200 + return response + else: + response_data = {"error": "Invalid username or password"} + response = make_response(jsonify(response_data)) + response.status_code = 401 + return response diff --git a/server/features/behavior/description.py b/server/features/behavior/description.py index 65c68a5..a5a8546 100644 --- a/server/features/behavior/description.py +++ b/server/features/behavior/description.py @@ -3,7 +3,7 @@ """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -24,13 +24,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Behavior description initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition Name class. """ - print("This is the Condition Description class.") + print("features.behavior.description") def get_functional_object(self, prefix="condition") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/behavior/focal.py b/server/features/behavior/focal.py index 9486741..f4307eb 100644 --- a/server/features/behavior/focal.py +++ b/server/features/behavior/focal.py @@ -2,7 +2,7 @@ This file contains the Behavior focal feature class. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -25,13 +25,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Behavior focal Feature initialized.", args, kwargs) def display(self) -> None: """ Display method for the Behavior type class. """ - print("This is the Behavior focal class.") + print("features.behavior.focal") def get_functional_object(self, prefix="condition") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/behavior/name.py b/server/features/behavior/name.py index 7a186e3..2ef98da 100644 --- a/server/features/behavior/name.py +++ b/server/features/behavior/name.py @@ -3,7 +3,7 @@ for returning the name of the conditions in the experiment. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -24,13 +24,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Behavior Name Feature initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition Name class. """ - print("This is the Behavior Name class.") + print("features.behavior.name") def get_functional_object(self, prefix="behavior") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/behavior/parent.py b/server/features/behavior/parent.py index 24b9758..694738b 100644 --- a/server/features/behavior/parent.py +++ b/server/features/behavior/parent.py @@ -2,7 +2,7 @@ Behavior class. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -22,13 +22,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Condition initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition type class. """ - print("This is the behavior class.") + print("features.behavior.") def get_functional_object(self, prefix="") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/behavior/priority.py b/server/features/behavior/priority.py index 13c11d3..61e3c28 100644 --- a/server/features/behavior/priority.py +++ b/server/features/behavior/priority.py @@ -2,7 +2,7 @@ This file contains the class for the Behavior priority feature. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -26,13 +26,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Behavior priority Feature initialized.", args, kwargs) def display(self) -> None: """ Display method for the Behavior type class. """ - print("This is the Behavior priority class.") + print("features.behavior.priority") def get_functional_object(self, prefix="condition") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/condition/description.py b/server/features/condition/description.py index b93b744..daede23 100644 --- a/server/features/condition/description.py +++ b/server/features/condition/description.py @@ -3,7 +3,7 @@ for returning the name of the conditions in the experiment. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -26,13 +26,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Condition Description Feature initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition Name class. """ - print("This is the Condition Description class.") + print("features.condition.description") def get_functional_object(self, prefix="condition") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/condition/message.py b/server/features/condition/message.py index c1c5e24..d569af2 100644 --- a/server/features/condition/message.py +++ b/server/features/condition/message.py @@ -3,7 +3,7 @@ for returning the name of the conditions in the experiment. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -25,13 +25,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Condition message Feature initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition message class. """ - print("This is the Condition message class.") + print("features.condition.message") def get_functional_object(self, prefix="condition") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/condition/name.py b/server/features/condition/name.py index 0d9a653..464a53d 100644 --- a/server/features/condition/name.py +++ b/server/features/condition/name.py @@ -3,7 +3,7 @@ for returning the name of the conditions in the experiment. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -25,7 +25,6 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Condition Name Feature initialized.", args, kwargs) def display(self) -> None: """ diff --git a/server/features/condition/parent.py b/server/features/condition/parent.py index b479c15..6e75fdc 100644 --- a/server/features/condition/parent.py +++ b/server/features/condition/parent.py @@ -3,7 +3,7 @@ for returning the name of the conditions in the experiment. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -24,13 +24,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Condition initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition type class. """ - print("This is the Condition class.") + print("features.conditions") def get_functional_object(self, prefix="") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/condition/type.py b/server/features/condition/type.py index d71be4a..8600463 100644 --- a/server/features/condition/type.py +++ b/server/features/condition/type.py @@ -3,7 +3,7 @@ for returning the name of the conditions in the experiment. """ -from ..gpt_feature import GPTFeature +from features.gpt_feature import GPTFeature class Feature(GPTFeature): @@ -35,13 +35,12 @@ def __init__(self, *args, **kwargs): super().__init__( feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ) - print("Condition type Feature initialized.", args, kwargs) def display(self) -> None: """ Display method for the Condition type class. """ - print("This is the Condition type class.") + print("features.condition.type") def get_functional_object(self, prefix="condition") -> dict: return super().get_functional_object(prefix=prefix) diff --git a/server/features/gpt_feature.py b/server/features/gpt_feature.py index d1b0a11..ee9bd06 100644 --- a/server/features/gpt_feature.py +++ b/server/features/gpt_feature.py @@ -9,7 +9,6 @@ class GPTFeature: def __init__( self, feature_name, feature_type, feature_prompt, feature_enum, *args, **kwargs ): - print("Feature initialized.", args, kwargs) self.feature_name = feature_name self.feature_type = feature_type self.feature_prompt = feature_prompt