Implement file selection to update SYSTEM_PROMPT_PATH
This commit is contained in:
+7
-2
@@ -40,6 +40,11 @@ async def button_callback(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
|
|||||||
subdir = data.split(":")[1]
|
subdir = data.split(":")[1]
|
||||||
await query.edit_message_text(f"Navigating to [{subdir}] is not yet implemented.")
|
await query.edit_message_text(f"Navigating to [{subdir}] is not yet implemented.")
|
||||||
elif data.startswith("file:"):
|
elif data.startswith("file:"):
|
||||||
# Handle file selection (for future implementation)
|
# Handle file selection
|
||||||
file = data.split(":")[1]
|
file = data.split(":")[1]
|
||||||
await query.edit_message_text(f"Viewing contents of {file} is not yet implemented.")
|
file_path = os.path.join('prompts', file)
|
||||||
|
os.environ['SYSTEM_PROMPT_PATH'] = file_path
|
||||||
|
await query.edit_message_text(f"Selected: {file}. SYSTEM_PROMPT_PATH updated.")
|
||||||
|
|
||||||
|
# Optionally, you may want to reload the system prompt here if needed.
|
||||||
|
# bot.system_prompt = bot.load_system_prompt() # Uncomment if you have access to the bot instance.
|
||||||
Reference in New Issue
Block a user