Skip to content

Enable Multi-Candidate Queries and Dataset Selection #3

@TheBoatyMcBoatFace

Description

@TheBoatyMcBoatFace

Description

Enhance the application's functionality to allow users to load and compare datasets from multiple candidates. This will enable users to query and compare different candidates directly on the prompt page.

Tasks

  1. Modify Data Models

    • Ensure that datasets can be associated with multiple candidates.
    • Update existing models if necessary to support multi-candidate data.
  2. Update Prompt Page UI

    • Modify the prompt page to allow users to select datasets from multiple candidates.
    • Implement multi-select functionality for candidate datasets.
    • Example UI changes:
      <label for="candidates">Select Candidates:</label>
      <select id="candidates" name="candidates" multiple>
        {% for candidate in candidates %}
          <option value="{{ candidate.id }}">{{ candidate.name }}</option>
        {% endfor %}
      </select>
  3. Backend Support for Multi-Candidate Queries

    • Update backend logic to handle queries with multiple candidate datasets.
    • Ensure the query is constructed in a way that incorporates data from all selected candidates.
  4. Update Query Processing

    • Modify the query processing pipeline to aggregate and compare data from multiple candidates.
    • Example pseudocode:
      selected_candidates = request.form.getlist('candidates')
      data_content = "\n\n".join([get_data(candidate_id) for candidate_id in selected_candidates])
  5. Display Comparison Results

    • Ensure the response includes comparative data across selected candidates.
    • Update the UI to display the results in a clear and comparative format.
    • Example result display changes:
      <table>
        <thead>
          <tr>
            <th>Question</th>
            {% for candidate in selected_candidates %}
              <th>{{ candidate.name }}</th>
            {% endfor %}
          </tr>
        </thead>
        <tbody>
          {% for query in queries %}
            <tr>
              <td>{{ query.question }}</td>
              {% for candidate in selected_candidates %}
                <td>{{ query.get_response(candidate.id) }}</td>
              {% endfor %}
            </tr>
          {% endfor %}
        </tbody>
      </table>
  6. Testing and Validation

    • Test multi-candidate selection on the prompt page.
    • Validate that queries and comparisons work correctly with multiple candidates.
    • Ensure that the UI renders comparative results clearly.

Additional Notes

  • Ensure data consistency and handle edge cases where data from some candidates might be missing.
  • Provide documentation or tooltips to guide users on how to select multiple candidates and understand comparison results.

Ai gen'd from my chaos scratch notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions