From f04ba80dc3dabf21139e869b6763856ffea35436 Mon Sep 17 00:00:00 2001 From: Lina Date: Tue, 9 Jul 2024 10:17:48 +0200 Subject: [PATCH 01/15] Added enums for question type --- enums.py | 8 ++++++++ models.py | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/enums.py b/enums.py index ec551c02..10d48d80 100644 --- a/enums.py +++ b/enums.py @@ -141,6 +141,7 @@ class Tablenames(Enum): MACRO_EDGE = "macro_edge" # connection between steps of a macro MACRO_EXECUTION = "macro_execution" # links macro id to an execution id MACRO_EXECUTION_LINK = "macro_execution_link" # execution to a conversation id + ORGANIZATION_QUESTIONS = "organization_questions" def snake_case_to_pascal_case(self): # the type name (written in PascalCase) of a table is needed to create backrefs @@ -745,3 +746,10 @@ class AdminMacrosDisplay(Enum): FOR_ADMINS = "FOR_ADMINS" FOR_ENGINEERS = "FOR_ENGINEERS" FOR_ALL = "FOR_ALL" + + +class QuestionType(Enum): + INPUT_TEXT = "INPUT_TEXT" + INPUT_CHECKBOX = "INPUT_CHECKBOX" + TEXTAREA = "TEXTAREA" + DROPDOWN = "DROPDOWN" diff --git a/models.py b/models.py index 040a467e..cfb76870 100644 --- a/models.py +++ b/models.py @@ -1691,3 +1691,21 @@ class GlobalWebsocketAccess(Base): ForeignKey(f"{Tablenames.USER.value}.id", ondelete="CASCADE"), index=True, ) +class DataManagerOrganizationQuestions(Base): + # =========================== Data manager tables =========================== + # table to store prepared websocket configuration. + # to ensure stateless communication, the configuration is stored in the database + # an entry doesn't mean it will be used but can be used + # example code runner that prepares the access but the custom code doesn't have to use it + # entries should be cleared on startup + + __tablename__ = Tablenames.ORGANIZATION_QUESTIONS.value + __table_args__ = {"schema": "data_manager"} + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + organization_id = Column( + UUID(as_uuid=True), + ForeignKey(f"{Tablenames.ORGANIZATION.value}.id", ondelete="CASCADE"), + index=True, + ) + type = Column(String) # of type enums.QuestionType.*.value + config = Column(JSON) From df3c4f6f2d36a755df2fc919c8e0428fa7c0624d Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Tue, 9 Jul 2024 11:47:22 +0200 Subject: [PATCH 02/15] business model tables --- enums.py | 14 +++++++++ models.py | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 93 insertions(+), 6 deletions(-) diff --git a/enums.py b/enums.py index 10d48d80..ed7e4a6f 100644 --- a/enums.py +++ b/enums.py @@ -142,6 +142,10 @@ class Tablenames(Enum): MACRO_EXECUTION = "macro_execution" # links macro id to an execution id MACRO_EXECUTION_LINK = "macro_execution_link" # execution to a conversation id ORGANIZATION_QUESTIONS = "organization_questions" + BUSINESS_MODELS = "business_models" + DATA_CONCEPTS = "data_concepts" + RULES = "rules" + RESOURCE = "resource" def snake_case_to_pascal_case(self): # the type name (written in PascalCase) of a table is needed to create backrefs @@ -753,3 +757,13 @@ class QuestionType(Enum): INPUT_CHECKBOX = "INPUT_CHECKBOX" TEXTAREA = "TEXTAREA" DROPDOWN = "DROPDOWN" + + +class RuleType(Enum): + GLOBAL_CONTEXT = "GLOBAL_CONTEXT" + RESOURCE_CONTEXT = "RESOURCE_CONTEXT" + RESOURCE_RELATION = "RESOURCE_RELATION" + + +class ResourceType(Enum): + PDF = "PDF" diff --git a/models.py b/models.py index cfb76870..fd887b90 100644 --- a/models.py +++ b/models.py @@ -1691,13 +1691,23 @@ class GlobalWebsocketAccess(Base): ForeignKey(f"{Tablenames.USER.value}.id", ondelete="CASCADE"), index=True, ) + + +class DataManagerBusinessModels(Base): + __tablename__ = Tablenames.BUSINESS_MODELS.value + __table_args__ = {"schema": "data_manager"} + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + organization_id = Column( + UUID(as_uuid=True), + ForeignKey(f"{Tablenames.ORGANIZATION.value}.id", ondelete="CASCADE"), + index=True, + ) + name = Column(String) + description = Column(String) + created_at = Column(DateTime, default=sql.func.now()) + + class DataManagerOrganizationQuestions(Base): - # =========================== Data manager tables =========================== - # table to store prepared websocket configuration. - # to ensure stateless communication, the configuration is stored in the database - # an entry doesn't mean it will be used but can be used - # example code runner that prepares the access but the custom code doesn't have to use it - # entries should be cleared on startup __tablename__ = Tablenames.ORGANIZATION_QUESTIONS.value __table_args__ = {"schema": "data_manager"} @@ -1709,3 +1719,66 @@ class DataManagerOrganizationQuestions(Base): ) type = Column(String) # of type enums.QuestionType.*.value config = Column(JSON) + + +class DataManagerDataConcepts(Base): + __tablename__ = Tablenames.DATA_CONCEPTS.value + __table_args__ = {"schema": "data_manager"} + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + business_model_id = Column( + UUID(as_uuid=True), + ForeignKey( + f"data_manager.{Tablenames.BUSINESS_MODELS.value}.id", ondelete="CASCADE" + ), + index=True, + ) + question_id = Column( + UUID(as_uuid=True), + ForeignKey( + f"data_manager.{Tablenames.ORGANIZATION_QUESTIONS.value}.id", + ondelete="CASCADE", + ), + index=True, + ) + created_at = Column(DateTime, default=sql.func.now()) + created_by = Column( + UUID(as_uuid=True), + ForeignKey(f"{Tablenames.USER.value}.id", ondelete="CASCADE"), + index=True, + ) + input = Column(String) + + +class DataManagerRules(Base): + __tablename__ = Tablenames.RULES.value + __table_args__ = {"schema": "data_manager"} + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + data_concept_id = Column( + UUID(as_uuid=True), + ForeignKey(f"data_manager.{Tablenames.DATA_CONCEPTS.value}.id"), + index=True, + ) + type = Column(String) # of type enums.RuleType.*.value + created_at = Column(DateTime, default=sql.func.now()) + created_by = Column( + UUID(as_uuid=True), + ForeignKey(f"{Tablenames.USER.value}.id", ondelete="CASCADE"), + index=True, + ) + autogenerated = Column(Boolean, default=True) + config = Column(JSON) + + +class DataManagerResource(Base): + __tablename__ = Tablenames.RESOURCE.value + __table_args__ = {"schema": "data_manager"} + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + created_at = Column(DateTime, default=sql.func.now()) + created_by = Column( + UUID(as_uuid=True), + ForeignKey(f"{Tablenames.USER.value}.id", ondelete="CASCADE"), + index=True, + ) + original_name = Column(String) + aliases = Column(ARRAY(String)) + type = Column(String) # of type enums.ResourceType.*.value From 362ec28099afdde51f51a27c803e01d7f1d52246 Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Tue, 9 Jul 2024 14:36:08 +0200 Subject: [PATCH 03/15] update question assignment --- enums.py | 1 + models.py | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/enums.py b/enums.py index ed7e4a6f..952189c0 100644 --- a/enums.py +++ b/enums.py @@ -143,6 +143,7 @@ class Tablenames(Enum): MACRO_EXECUTION_LINK = "macro_execution_link" # execution to a conversation id ORGANIZATION_QUESTIONS = "organization_questions" BUSINESS_MODELS = "business_models" + BUSINESS_MODEL_QUESTIONS = "business_model_questions" DATA_CONCEPTS = "data_concepts" RULES = "rules" RESOURCE = "resource" diff --git a/models.py b/models.py index fd887b90..a3539791 100644 --- a/models.py +++ b/models.py @@ -1705,10 +1705,27 @@ class DataManagerBusinessModels(Base): name = Column(String) description = Column(String) created_at = Column(DateTime, default=sql.func.now()) + llm_config = Column(JSON) -class DataManagerOrganizationQuestions(Base): +class DataManagerBusinessModelQuestions(Base): + __tablename__ = Tablenames.BUSINESS_MODEL_QUESTIONS.value + __table_args__ = {"schema": "data_manager"} + business_model_id = Column( + UUID(as_uuid=True), + ForeignKey(f"data_manager.{Tablenames.BUSINESS_MODELS.value}.id"), + index=True, + primary_key=True, + ) + question_id = Column( + UUID(as_uuid=True), + ForeignKey(f"data_manager.{Tablenames.ORGANIZATION_QUESTIONS.value}.id"), + index=True, + primary_key=True, + ) + +class DataManagerOrganizationQuestions(Base): __tablename__ = Tablenames.ORGANIZATION_QUESTIONS.value __table_args__ = {"schema": "data_manager"} id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) From f367a1f8f71128971d6e1a7ab1ff89014cec6429 Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Tue, 9 Jul 2024 16:27:34 +0200 Subject: [PATCH 04/15] create data concept business model --- cognition_objects/business_model.py | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 cognition_objects/business_model.py diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py new file mode 100644 index 00000000..8cad4cfd --- /dev/null +++ b/cognition_objects/business_model.py @@ -0,0 +1,57 @@ +from typing import List, Dict, Any +from ..business_objects import general + +from ..models import ( + DataManagerBusinessModels, + DataManagerBusinessModelQuestions, + DataManagerDataConcepts, +) +from submodules.model.util import sql_alchemy_to_dict + + +def create_business_model( + org_id: str, + name: str, + description: str, + question_ids: List[str], + llm_config: Dict[str, Any], + with_commit: bool = False, +) -> Dict[str, Any]: + + bm = DataManagerBusinessModels( + org_id=org_id, + name=name, + description=description, + llm_config=llm_config, + ) + + general.add(bm, False) + + # TODO: created but not returned + questions = [] + for q_id in question_ids: + q = DataManagerBusinessModelQuestions(business_model_id=bm.id, question_id=q_id) + general.add(q, False) + questions.append(q) + general.flush_or_commit(with_commit) + + bm_dict = {**sql_alchemy_to_dict(bm), "questions": sql_alchemy_to_dict(questions)} + return bm_dict + + +def create_data_concept( + business_model_id: str, + created_by: str, + question_id: str, + input: str, + with_commit: bool = False, +) -> Dict[str, Any]: + + dc = DataManagerDataConcepts( + business_model_id=business_model_id, + question_id=question_id, + created_by=created_by, + input=input, + ) + general.add(dc, with_commit) + return dc From 515174191fcbe3cd90b797a83d4fa4179a984fd7 Mon Sep 17 00:00:00 2001 From: Lina Date: Tue, 9 Jul 2024 16:31:21 +0200 Subject: [PATCH 05/15] Added creation organization question --- cognition_objects/organization_question.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cognition_objects/organization_question.py diff --git a/cognition_objects/organization_question.py b/cognition_objects/organization_question.py new file mode 100644 index 00000000..388ec286 --- /dev/null +++ b/cognition_objects/organization_question.py @@ -0,0 +1,19 @@ +from typing import Any, Dict +from submodules.model.business_objects import general +from submodules.model.models import DataManagerOrganizationQuestions + + +def create( + org_id: str, + type: str, + config: Dict[str, Any], + with_commit: bool = True, +) -> DataManagerOrganizationQuestions: + new_question = DataManagerOrganizationQuestions( + organization_id=org_id, + type=type, + config=config, + ) + + general.add(new_question, with_commit) + return new_question From 49559a4037f3cb675dda62a6081353b3a978fb10 Mon Sep 17 00:00:00 2001 From: Lina Date: Tue, 9 Jul 2024 17:51:36 +0200 Subject: [PATCH 06/15] Get all questions --- cognition_objects/organization_question.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cognition_objects/organization_question.py b/cognition_objects/organization_question.py index 388ec286..76bdc13f 100644 --- a/cognition_objects/organization_question.py +++ b/cognition_objects/organization_question.py @@ -1,6 +1,7 @@ -from typing import Any, Dict +from typing import Any, Dict, List +from ..session import session from submodules.model.business_objects import general -from submodules.model.models import DataManagerOrganizationQuestions +from submodules.model.models import DataManagerOrganizationQuestions, Team def create( @@ -17,3 +18,11 @@ def create( general.add(new_question, with_commit) return new_question + + +def get_all(org_id: str) -> List[DataManagerOrganizationQuestions]: + return ( + session.query(DataManagerOrganizationQuestions) + .filter(DataManagerOrganizationQuestions.organization_id == org_id) + .all() + ) From 5fa8c263a9881d44f121ad15893e0e4195062401 Mon Sep 17 00:00:00 2001 From: Lina Date: Wed, 10 Jul 2024 10:11:26 +0200 Subject: [PATCH 07/15] Added deleting one or many questions --- cognition_objects/organization_question.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cognition_objects/organization_question.py b/cognition_objects/organization_question.py index 76bdc13f..804e1429 100644 --- a/cognition_objects/organization_question.py +++ b/cognition_objects/organization_question.py @@ -26,3 +26,12 @@ def get_all(org_id: str) -> List[DataManagerOrganizationQuestions]: .filter(DataManagerOrganizationQuestions.organization_id == org_id) .all() ) + + +def delete_many(org_id: str, question_ids: List[str], with_commit: bool = True) -> None: + session.query(DataManagerOrganizationQuestions).filter( + DataManagerOrganizationQuestions.organization_id == org_id, + DataManagerOrganizationQuestions.id.in_(question_ids), + ).delete(synchronize_session=False) + + general.flush_or_commit(with_commit) From 336d78ce24ee68609b9330526e83edd3a7c9bc2d Mon Sep 17 00:00:00 2001 From: Lina Date: Wed, 10 Jul 2024 10:57:26 +0200 Subject: [PATCH 08/15] Update question --- cognition_objects/organization_question.py | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/cognition_objects/organization_question.py b/cognition_objects/organization_question.py index 804e1429..5d739a5d 100644 --- a/cognition_objects/organization_question.py +++ b/cognition_objects/organization_question.py @@ -35,3 +35,29 @@ def delete_many(org_id: str, question_ids: List[str], with_commit: bool = True) ).delete(synchronize_session=False) general.flush_or_commit(with_commit) + + +def get_by_id(org_id: str, question_id: str) -> DataManagerOrganizationQuestions: + return ( + session.query(DataManagerOrganizationQuestions) + .filter( + DataManagerOrganizationQuestions.organization_id == org_id, + DataManagerOrganizationQuestions.id == question_id, + ) + .one() + ) + + +def update( + org_id: str, + question_id: str, + type: str, + config: Dict[str, Any], + with_commit: bool = True, +) -> DataManagerOrganizationQuestions: + question = get_by_id(org_id, question_id) + question.type = type + question.config = config + + general.flush_or_commit(with_commit) + return question From 86aa052477c910a9e4ac12c83f3bf7bd1e42bff2 Mon Sep 17 00:00:00 2001 From: Lina Date: Wed, 10 Jul 2024 11:29:37 +0200 Subject: [PATCH 09/15] Get all business models --- cognition_objects/business_model.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py index 8cad4cfd..d30209ad 100644 --- a/cognition_objects/business_model.py +++ b/cognition_objects/business_model.py @@ -1,5 +1,7 @@ from typing import List, Dict, Any + from ..business_objects import general +from ..session import session from ..models import ( DataManagerBusinessModels, @@ -55,3 +57,11 @@ def create_data_concept( ) general.add(dc, with_commit) return dc + + +def get_all(org_id: str) -> List[DataManagerBusinessModels]: + return ( + session.query(DataManagerBusinessModels) + .filter(DataManagerBusinessModels.organization_id == org_id) + .all() + ) From 3f4a5ecfd06d584ea696f80ca5db25bc9f04860e Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Wed, 10 Jul 2024 15:52:27 +0200 Subject: [PATCH 10/15] org id update --- cognition_objects/business_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py index d30209ad..08fb79ec 100644 --- a/cognition_objects/business_model.py +++ b/cognition_objects/business_model.py @@ -21,7 +21,7 @@ def create_business_model( ) -> Dict[str, Any]: bm = DataManagerBusinessModels( - org_id=org_id, + organization_id=org_id, name=name, description=description, llm_config=llm_config, From 8ef20f8518745d6ccedeae7ee62b66298011959b Mon Sep 17 00:00:00 2001 From: Lina Date: Wed, 10 Jul 2024 17:02:38 +0200 Subject: [PATCH 11/15] Questions for first step of stepper --- cognition_objects/business_model.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py index 08fb79ec..c4e7da4f 100644 --- a/cognition_objects/business_model.py +++ b/cognition_objects/business_model.py @@ -65,3 +65,17 @@ def get_all(org_id: str) -> List[DataManagerBusinessModels]: .filter(DataManagerBusinessModels.organization_id == org_id) .all() ) + + +def get_questions_for_business_model( + org_id: str, business_model_id: str +) -> List[DataManagerBusinessModelQuestions]: + + query = f""" + SELECT * + FROM data_manager.business_model_questions bmq + JOIN data_manager.organization_questions oq on oq.id = bmq.question_id + WHERE bmq.business_model_id = '{business_model_id}' and oq.organization_id = '{org_id}' + """ + + return general.execute_all(query) From 7ec84ac2f790caf153a17e3d41917fac74d49516 Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Thu, 11 Jul 2024 01:12:54 +0200 Subject: [PATCH 12/15] data concepts --- cognition_objects/business_model.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py index c4e7da4f..31b2bbe8 100644 --- a/cognition_objects/business_model.py +++ b/cognition_objects/business_model.py @@ -59,6 +59,14 @@ def create_data_concept( return dc +def get_data_concepts_by_ids(business_model_id: str) -> List[DataManagerDataConcepts]: + return ( + session.query(DataManagerDataConcepts) + .filter(DataManagerDataConcepts.business_model_id == business_model_id) + .all() + ) + + def get_all(org_id: str) -> List[DataManagerBusinessModels]: return ( session.query(DataManagerBusinessModels) From b0e666c88df148f71931a27e1982ec6ddbf1d8b9 Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Fri, 12 Jul 2024 01:51:32 +0200 Subject: [PATCH 13/15] mock up rules --- cognition_objects/business_model.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py index 31b2bbe8..14156d81 100644 --- a/cognition_objects/business_model.py +++ b/cognition_objects/business_model.py @@ -59,10 +59,12 @@ def create_data_concept( return dc -def get_data_concepts_by_ids(business_model_id: str) -> List[DataManagerDataConcepts]: +def get_data_concepts_by_ids( + data_concept_ids: List[str], +) -> List[DataManagerDataConcepts]: return ( session.query(DataManagerDataConcepts) - .filter(DataManagerDataConcepts.business_model_id == business_model_id) + .filter(DataManagerDataConcepts.id.in_(data_concept_ids)) .all() ) @@ -87,3 +89,20 @@ def get_questions_for_business_model( """ return general.execute_all(query) + + +def get_data_concepts_by_user( + user_id: str, business_model_id: str +) -> List[DataManagerBusinessModelQuestions]: + + return ( + session.query(DataManagerDataConcepts) + .join( + DataManagerBusinessModelQuestions, + DataManagerBusinessModelQuestions.question_id + == DataManagerDataConcepts.question_id, + ) + .filter(DataManagerDataConcepts.business_model_id == business_model_id) + .filter(DataManagerDataConcepts.created_by == user_id) + .all() + ) From 444db70be61e9fa44e12731ffe78e3ca8df5556d Mon Sep 17 00:00:00 2001 From: LennartSchmidtKern Date: Fri, 12 Jul 2024 10:43:26 +0200 Subject: [PATCH 14/15] cascade --- cognition_objects/business_model.py | 14 +++++++++++++- models.py | 9 +++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cognition_objects/business_model.py b/cognition_objects/business_model.py index 14156d81..64f48980 100644 --- a/cognition_objects/business_model.py +++ b/cognition_objects/business_model.py @@ -29,7 +29,6 @@ def create_business_model( general.add(bm, False) - # TODO: created but not returned questions = [] for q_id in question_ids: q = DataManagerBusinessModelQuestions(business_model_id=bm.id, question_id=q_id) @@ -41,6 +40,19 @@ def create_business_model( return bm_dict +def get_business_model_by_id( + org_id: str, business_model_id: str +) -> DataManagerBusinessModels: + return ( + session.query(DataManagerBusinessModels) + .filter( + DataManagerBusinessModels.organization_id == org_id, + DataManagerBusinessModels.id == business_model_id, + ) + .first() + ) + + def create_data_concept( business_model_id: str, created_by: str, diff --git a/models.py b/models.py index a3539791..0fac3ed2 100644 --- a/models.py +++ b/models.py @@ -1713,13 +1713,18 @@ class DataManagerBusinessModelQuestions(Base): __table_args__ = {"schema": "data_manager"} business_model_id = Column( UUID(as_uuid=True), - ForeignKey(f"data_manager.{Tablenames.BUSINESS_MODELS.value}.id"), + ForeignKey( + f"data_manager.{Tablenames.BUSINESS_MODELS.value}.id", ondelete="CASCADE" + ), index=True, primary_key=True, ) question_id = Column( UUID(as_uuid=True), - ForeignKey(f"data_manager.{Tablenames.ORGANIZATION_QUESTIONS.value}.id"), + ForeignKey( + f"data_manager.{Tablenames.ORGANIZATION_QUESTIONS.value}.id", + ondelete="CASCADE", + ), index=True, primary_key=True, ) From c1fba192195f1594125a7dcdbb0a17dc97e0acfe Mon Sep 17 00:00:00 2001 From: JWittmeyer Date: Fri, 12 Jul 2024 11:27:15 +0200 Subject: [PATCH 15/15] Adds consumption step type --- enums.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/enums.py b/enums.py index 952189c0..f8cb9dc0 100644 --- a/enums.py +++ b/enums.py @@ -522,6 +522,9 @@ class StrategyStepType(Enum): # INFO: done in exec env to prevent installing sklearn in gateway TMP_DOC_RETRIEVAL = "TMP_DOC_RETRIEVAL" + # INFO: needs a good business model to work properly + BUSINESS_MODEL_CONSUMPTION = "BUSINESS_MODEL_CONSUMPTION" + def get_description(self): return STEP_DESCRIPTIONS.get(self, "No description available") @@ -545,6 +548,7 @@ def get_progress_text(self): StrategyStepType.TRUNCATE_CONTEXT: "Truncate context", StrategyStepType.HEADER: "Writing header", StrategyStepType.TMP_DOC_RETRIEVAL: "Temporary document retrieval", + StrategyStepType.BUSINESS_MODEL_CONSUMPTION: "Business model consumption", } STEP_WHEN_TO_USE = { @@ -560,6 +564,7 @@ def get_progress_text(self): StrategyStepType.TRUNCATE_CONTEXT: "When you want to truncate context", StrategyStepType.HEADER: "When you want to set a header based on the conversation", StrategyStepType.TMP_DOC_RETRIEVAL: "When you want to retrieve results from conversation specific documents", + StrategyStepType.BUSINESS_MODEL_CONSUMPTION: "When you want to understand what business resources are relevant", } STEP_PROGRESS_TEXTS = { @@ -575,6 +580,7 @@ def get_progress_text(self): StrategyStepType.TRUNCATE_CONTEXT: "Truncating context", StrategyStepType.HEADER: "Headline generation", StrategyStepType.TMP_DOC_RETRIEVAL: "Retrieving facts from conversation specific documents", + StrategyStepType.BUSINESS_MODEL_CONSUMPTION: "Analyzing relevant resources", } STEP_ERRORS = {