Skip to content

Replace rigid LLM tools with a shared prompt editor#27

Open
tmaier-kettering wants to merge 1 commit into
mainfrom
tmaier-kettering-prompt-editor-overhaul
Open

Replace rigid LLM tools with a shared prompt editor#27
tmaier-kettering wants to merge 1 commit into
mainfrom
tmaier-kettering-prompt-editor-overhaul

Conversation

@tmaier-kettering

Copy link
Copy Markdown
Owner

Summary

This replaces the fixed live and batch LLM tool flows with one configurable Prompt Editor so prompt authoring, structured outputs, and execution settings all come from the same model. The goal is to let the app support preset-backed workflows now and custom templates per project without keeping separate live and batch implementations in sync.

What changed

  • adds a new prompt_editor package with:
    • a shared persisted template/config model
    • project-scoped template storage
    • built-in presets for single-label, multi-label, and keyword extraction
    • placeholder binding/rendering
    • dynamic structured-schema generation for live and batch requests
    • batch result reconstruction that preserves failed rows with explicit status/error columns
  • extends the import wizard so prompt-editor flows can load full tabular datasets while keeping the legacy import_data() API for older callers
  • replaces the old LLM Tools menu structure with one Prompt Editor entry plus built-in preset launchers
  • repoints the legacy live entry points to the new preset-backed prompt editor instead of maintaining separate hard-coded flows
  • adds focused tests for template persistence, placeholder rendering, schema generation, and strict enum-constrained outputs

Notes for review

  • Single-label classification still enforces exactly one allowed label by generating a strict enum from the selected label source.
  • Multi-label classification uses the same shared config path but constrains list items to the allowed enum values.
  • Saved templates intentionally strip in-memory row data and rehydrate from saved file paths when those files are still available.
  • Prompt-editor batch downloads rely on a local project-scoped registry so passthrough fields and enum constraints can be reconstructed later.

Validation

  • python -m compileall prompt_editor ui\main_window.py live_processing batch_processing\batch_method.py file_handling\data_import.py
  • python -m pytest tests\test_prompt_editor.py tests\test_batch_creation.py tests\test_batch_parsing.py tests\test_data_import.py tests\test_settings.py -q
  • 103 passed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant