Skip to content

Feat/structured portfolio endpoint claude tool#655

Open
charliechinedu19-netizen wants to merge 7 commits into
Suncrest-Labs:mainfrom
charliechinedu19-netizen:feat/structured-portfolio-endpoint-claude-tool
Open

Feat/structured portfolio endpoint claude tool#655
charliechinedu19-netizen wants to merge 7 commits into
Suncrest-Labs:mainfrom
charliechinedu19-netizen:feat/structured-portfolio-endpoint-claude-tool

Conversation

@charliechinedu19-netizen
Copy link
Copy Markdown

Closes #572

Changes made:

  • apps/intelligence/app/models/portfolio.py: Created 3 Pydantic models (AllocationItem, PortfolioBreakdown, PortfolioAnalysisResponse) with type validation and constraints for structured portfolio analysis responses
  • apps/intelligence/app/services/prometheus.py: Added analyze_portfolio(user_id) async function implementing Claude tool use for structured portfolio breakdown, with graceful fallback to synthetic data on errors
  • apps/intelligence/app/routers/analyze.py: Added portfolio_analyze() endpoint (POST /portfolio/analyze) with JWT authentication, 5 requests/hour rate limiting, and PortfolioAnalysisResponse model
  • apps/intelligence/tests/test_portfolio_analysis.py: Created 6 unit tests covering tool use extraction, empty vaults, error fallback, Pydantic validation, JSON serialization, and allocation weighting

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 3, 2026

@charliechinedu19-netizen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

CharlieChinedu and others added 6 commits June 3, 2026 10:44
…e tool use (Suncrest-Labs#572)\n\n- Add Portfolio models and response schema\n- Implement analyze_portfolio() with Claude tool use and fallback\n- Add POST /intelligence/portfolio/analyze endpoint (5/hour rate limit)\n- Add unit tests for tool use parsing and validation\n- Add implementation docs
- Remove unused market_rates variable
- Remove unused avg_apy variable
- Break long lines to respect 100 character limit
- Explicitly type tool_input as dict[str, Any] to resolve attr-defined errors
- Remove unnecessary type: ignore comments
- Ensure proper type safety in Claude tool use parsing
@charliechinedu19-netizen charliechinedu19-netizen force-pushed the feat/structured-portfolio-endpoint-claude-tool branch from 2867ce6 to e2991ea Compare June 3, 2026 09:55
@charliechinedu19-netizen
Copy link
Copy Markdown
Author

@0xDeon This is the new pr. Please review and merge

@charliechinedu19-netizen
Copy link
Copy Markdown
Author

@0xDeon hello maintainer, this PR is still up. kindly review and merge

@charliechinedu19-netizen
Copy link
Copy Markdown
Author

@0xDeon hello maintainer, this PR is still up. kindly review and merge please

1 similar comment
@charliechinedu19-netizen
Copy link
Copy Markdown
Author

@0xDeon hello maintainer, this PR is still up. kindly review and merge please

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.

feat(intelligence): add structured portfolio analysis endpoint with Claude tool use

1 participant