MCPcopy Create free account
hub / github.com/danielmiessler/Fabric / pattern_creation_ui

Function pattern_creation_ui

scripts/python_ui/streamlit.py:623–658  ·  view source on GitHub ↗

UI component for creating patterns with simple and wizard modes.

()

Source from the content-addressed store, hash-verified

621
622
623def pattern_creation_ui():
624 """UI component for creating patterns with simple and wizard modes."""
625 pattern_name = st.text_input("Pattern Name")
626 if not pattern_name:
627 st.info("Enter a pattern name to create a new pattern")
628 return
629
630 system_content = """# IDENTITY and PURPOSE
631
632You are an AI assistant designed to {purpose}.
633
634# STEPS
635
636- Step 1
637- Step 2
638- Step 3
639
640# OUTPUT INSTRUCTIONS
641
642- Output format instructions here
643"""
644 new_content = st.text_area("Edit Pattern Content", system_content, height=400)
645
646 if st.button("Create Pattern", type="primary"):
647 if not pattern_name:
648 st.error("Pattern name cannot be empty.")
649 else:
650 success, message = create_pattern(pattern_name)
651 if success:
652 system_file = os.path.join(pattern_dir, pattern_name, "system.md")
653 with open(system_file, "w") as f:
654 f.write(new_content)
655 st.success(f"Pattern '{pattern_name}' created successfully!")
656 st.experimental_rerun()
657 else:
658 st.error(message)
659
660
661def pattern_management_ui():

Callers 1

mainFunction · 0.85

Calls 1

create_patternFunction · 0.85

Tested by

no test coverage detected