mirror of
https://github.com/marcogll/talia_bot.git
synced 2026-01-14 04:55:19 +00:00
feat: Implement JSON-based conversational flow engine and add all flow files
This commit finalizes the implementation of the JSON-driven conversational flow engine. Key changes: - Introduces `flow_engine.py` to manage loading and processing conversational flows from external files. - Adds the complete set of individual JSON files for all admin, crew, and client flows under the `talia_bot/data/flows/` directory. - Integrates the flow engine into `main.py` to handle user interactions based on the new modular flow definitions. This resolves the issue where the flow files were missing from the repository, providing a complete and functional implementation.
This commit is contained in:
@@ -32,18 +32,8 @@ def setup_database():
|
||||
)
|
||||
""")
|
||||
|
||||
# Create the conversations table for the flow engine
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS conversations (
|
||||
user_id INTEGER PRIMARY KEY,
|
||||
flow_id TEXT NOT NULL,
|
||||
current_step_id INTEGER NOT NULL,
|
||||
collected_data TEXT
|
||||
)
|
||||
""")
|
||||
|
||||
conn.commit()
|
||||
logger.info("Database setup complete. 'users' and 'conversations' tables are ready.")
|
||||
logger.info("Database setup complete. 'users' table is ready.")
|
||||
except sqlite3.Error as e:
|
||||
logger.error(f"Database error during setup: {e}")
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user