Skip to content

Commit

Permalink
minifix: prompt (and prompt_file) can be edited via web UI
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziosalmi committed Jun 27, 2024
1 parent ced4e06 commit b86d4b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,22 @@ def convert_tuple_to_list(data, keys):
st.subheader("Prompt File")
st.session_state.config_data['prompt_file'] = st.text_input("Prompt File Path", st.session_state.config_data.get('prompt_file', 'prompt_IT.txt'))

# Load and display prompt file content
prompt_file_path = st.session_state.config_data['prompt_file']
if Path(prompt_file_path).exists():
with open(prompt_file_path, 'r') as f:
prompt_content = f.read()
else:
prompt_content = ""

st.subheader("Edit Prompt File")
new_prompt_content = st.text_area("Prompt File Content", prompt_content, height=200)

if st.button("Save Prompt"):
with open(prompt_file_path, 'w') as f:
f.write(new_prompt_content)
st.success("Prompt file saved successfully!")

st.divider()

st.subheader("RSS Retention Options")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='uglypy', # The package name on PyPI
version='0.0.28', # Initial version, update manually for major changes
version='0.0.29', # Initial version, update manually for major changes
author='Fabrizio Salmi',
author_email='[email protected]', # Replace with your email
description='A Python package for aggregating and processing RSS feeds with LLM-enhanced content rewriting.',
Expand Down

0 comments on commit b86d4b7

Please sign in to comment.