Skip to content

Portfolio Project Evaluation & Similarity Suggestion#3

Open
shiroginne wants to merge 21 commits intomainfrom
add-suggestion-pipeline
Open

Portfolio Project Evaluation & Similarity Suggestion#3
shiroginne wants to merge 21 commits intomainfrom
add-suggestion-pipeline

Conversation

@shiroginne
Copy link
Contributor

@shiroginne shiroginne commented Jul 16, 2025

This PR introduces a new API endpoint /evaluate-projects-similarities that evaluates and suggests the most suitable sub-projects for a given portfolio project.

Main Functionality

New Endpoint: /evaluate-projects-similarities

  • Accepts a portfolio project ID and OpenProject URL and API_KEY
  • Returns a ranked list of candidate sub-projects, each with:
    • name
    • score
    • project_id
    • reason (LLM-generated explanation)
  • LLM Integration: Uses an LLM to score and explain the suitability of each sub-project for the portfolio.
  • Robust Parsing: Handles various LLM output formats to ensure reliable candidate extraction.

Usage

Send a POST request to /evaluate-projects-similarities with a valid portfolio project ID to receive a list of the best-matching sub-projects and their suitability scores:

{
    "project": {
      "id": 4,
      "type": "portfolio"
    },
    "openproject": {
       "base_url": "<your_url>",
       "user_token": "<your_api_key>"
    }
}

@shiroginne shiroginne self-assigned this Jul 16, 2025
@shiroginne shiroginne marked this pull request as ready for review July 16, 2025 15:27
@shiroginne shiroginne requested review from Copilot and dominic-braeunlein and removed request for dominic-braeunlein July 16, 2025 15:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new API endpoint /evaluate-projects-similarities that evaluates and suggests suitable sub-projects for portfolio projects using LLM-powered analysis. The implementation includes comprehensive project traversal, custom field extraction, and robust LLM response parsing to provide scored recommendations with explanations.

  • Adds new suggestion pipeline with LLM integration for project portfolio analysis
  • Implements project hierarchy traversal with pagination support for OpenProject API
  • Updates import paths from src.models.schemas to src.api.schemas across multiple files

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/api/schemas.py New schema definitions for suggestion requests/responses and consolidated API schemas
src/pipelines/suggestion.py Core suggestion pipeline with project traversal, LLM scoring, and response parsing logic
src/api/routes.py New endpoint implementation for project similarity evaluation
src/services/openproject_client.py Added project list fetching with pagination and import path updates
config/settings.py Added OpenProject configuration settings and updated default model
src/templates/report_templates.py Updated import path for WorkPackage schema
src/pipelines/generation.py Updated import path for schema classes


@dataclass
class Candidate:
project_id: Any
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

Using 'Any' type for project_id is too permissive. Consider using Union[str, int] to be more specific about expected types.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants