Custom implementation of Conversation to fix the list assignment index out of range error
| 26 | assistant_response: AssistantResponse |
| 27 | |
| 28 | class CustomConversation: |
| 29 | """Custom implementation of Conversation to fix the list assignment index out of range error""" |
| 30 | |
| 31 | def __init__(self): |
| 32 | self.dialog_turns = [] |
| 33 | |
| 34 | def append_dialog_turn(self, dialog_turn): |
| 35 | """Safely append a dialog turn to the conversation""" |
| 36 | if not hasattr(self, 'dialog_turns'): |
| 37 | self.dialog_turns = [] |
| 38 | self.dialog_turns.append(dialog_turn) |
| 39 | |
| 40 | # Import other adalflow components |
| 41 | from adalflow.components.retriever.faiss_retriever import FAISSRetriever |
no outgoing calls
no test coverage detected