Skip to content

OpenConceptLab/ocl_issues#2383 | AI Assistant Drop Down for Prompt + model#15

Open
snyaggarwal wants to merge 3 commits intomainfrom
issues#2383
Open

OpenConceptLab/ocl_issues#2383 | AI Assistant Drop Down for Prompt + model#15
snyaggarwal wants to merge 3 commits intomainfrom
issues#2383

Conversation

@snyaggarwal
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

@paynejd paynejd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prompt Template Persistence & Version Resolution

The UI selection work looks good, but there's a significant gap: the prompt template + model selection is not persisted on the project. Currently it's ephemeral React state that resets on reload. The intended behavior:

1. Project config should persist prompt_template_key + default model

The MapProject needs to store which prompt template key (e.g. match-recommend) and model the user selected as defaults for that project. This likely requires an API-side field on MapProject in oclapi2. On page load, the project's saved key should be the initial selection — not just falling back to PROMPTS_KEY_DEFAULT every time. The global default for this is -- including for map projects that do not have their project default defined -- is match-recommend (no prompt template version is resolved as latest at runtime) using the default model for the match-recommend template. This global default value does not actually need to be set for each project, since the Mapper should be able to handle this runtime. For sysadmins, the ability to change the default template might be useful, so that should be a global config value.

2. Version resolution should happen at invocation time, not page load

Currently the version comes from whatever /prompts/ returned when the page loaded. Instead:

  • Config stores only the key (no version) — so when an OCL admin publishes an improved prompt template, users automatically get it without changing their config.
  • At invocation time (when AI assistant is called, or at the start of an auto-match run), resolve the current version from the API. This ensures a single auto-match run uses a consistent prompt template version throughout, even if the template is updated on the backend mid-run.
  • Log the fully-resolved prompt_template_uri (e.g. /prompts/match-recommend/v3/) with each AI response for full auditability.

3. Summary of expected data flow

Layer What's stored When
Project config prompt_template_key + model_id User saves config; Optional with fallback to global default
Runtime (per run) Resolved prompt_template_uri (key + version) Start of auto-match
AI response log Full prompt_template_uri + model Each AI response

Version pinning (letting users pick a specific version) is not MVP — future feature.


Dead code: AIPromptTemplateSelector.jsx

AIPromptTemplateSelector.jsx is added in this PR but never imported or used anywhere. Should be removed, or if it's planned for a future integration point, defer it to that ticket.

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.

[OCL Mapper] Power User AI Assistant Drop-Down for Model & Prompt Template Selection

2 participants