📝 (text.py): Rename CustomComponent to Component for better clarity and consistency

📝 (ChatInput.py, TextInput.py, ChatOutput.py, RecordsOutput.py, TextOutput.py): Refactor code to use Input and Output classes for defining inputs and outputs
📝 (CustomComponent.py): Update method to get the build method for custom components to consider classes inheriting from Component or CustomComponent
📝 (DirectoryReader.py): Remove check for missing build function as it is no longer necessary
📝 (base.py): Add properties to easily access outgoing edges, incoming edges, and source names of edges in a Vertex object

♻️ (types.py): Refactor code to improve readability and maintainability by adding type hinting and organizing imports
📝 (types.py): Add missing documentation and comments to clarify the purpose of methods and classes
♻️ (loading.py): Refactor code to remove redundant code and improve code structure for better maintainability
📝 (loading.py): Add comments to explain the purpose of functions and the flow of the code
♻️ (base.py): Refactor code to improve consistency and readability by updating class names and method calls to match the intended functionality
This commit is contained in:
ogabrielluiz 2024-06-03 13:49:03 -03:00
commit daedaae820
12 changed files with 192 additions and 82 deletions

View file

@ -21,7 +21,7 @@ class ChatInput(ChatComponent):
]
def text_response(self) -> Text:
result = self.message
result = self.input_value
if self.session_id and isinstance(result, (Record, str)):
self.store_message(result, self.session_id, self.sender, self.sender_name)
return result
@ -29,11 +29,12 @@ class ChatInput(ChatComponent):
def record_response(self) -> Record:
record = Record(
data={
"message": self.message,
"message": self.input_value,
"sender": self.sender,
"sender_name": self.sender_name,
"session_id": self.session_id,
}
},
text_key="message",
)
if self.session_id and isinstance(record, (Record, str)):
self.store_message(record, self.session_id, self.sender, self.sender_name)