Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AI tooltips#2915

Merged
vladsavelyev merged 336 commits into
mainfrom
ai
Jan 22, 2025
Merged

AI tooltips#2915
vladsavelyev merged 336 commits into
mainfrom
ai

Conversation

@vladsavelyev

@vladsavelyev vladsavelyev commented Oct 9, 2024

Copy link
Copy Markdown
Contributor
  • Pass just single request with all the context, including bar plots and tables.
  • Make it more stable. Why temperature=0.0 seems not to work? Use structured outputs.
  • Support other plot types.
  • Two-step approach: summary for each plot, then overall summary based on it.
  • Separately generate recommendations that users can expand on click.
  • Try with o1-preview.
  • Try with not passing full column descriptions, but instead use short ones, and a separate table expanding the detail.
  • Support Anthropic
  • Support Seqera Chat
  • Add "Continue in Seqera Chat button"
  • Generate markdown, then convert to HTML
  • Use a backend endpoint to create user session with the question/response
  • Parse sample names and add links to highlight those on the report
  • Add "Show More" button
  • Streaming
  • Calling completions from FE
  • Configuration modal in FE to select provider, API key, model name
  • Short and full summary, and "generate more" in FE
  • Use the same data in FE and BE generations, which will save on passing the base64 data from BE
  • Match python generated report data with JS
    • JS report content: support multiple datasets
    • PY report content: all plot types
    • PY report content: nice naming of plot types - same as in JS
    • PY report content: suffixes in line plots and other plots
    • PY report content: separate violin and table representations? Or make them the same in JS?
  • Add general stats dynamic summary
  • Handle button name when table switch to violin and back
  • Handle when prompt is too long (PY)
  • Handle when prompt is too long (JS)
  • Add command line options
  • Seqera AI support
  • Handle when report was run without --ai-summary flag:
    • show all buttons next to plots from the toolbox
    • toolbox button to run AI summary on the entire report
    • add "Copy for AI prompt" button on the top level summary
  • Handle very large reports:
    • For large reports, use only general stats
    • For large tables, use the reduced violin data dicts
    • If table is large, do not use hidden columns
    • Support in PY
    • Support in JS
  • JS: exclude hidden samples from prompt
  • Toolbox:
    • Dynamic info based on provider
    • Links to tokens for Seqera AI
    • Links to available models
    • Models autosuggest
  • Documentation for AI features
  • Track basic usage
  • Large reports: allow to hide some metrics and retry (fix modal for violin plots)
  • Be helpful when user hidden all columns and/or samples
  • Draw a new "Copy for AI" icon - a clipboard icon combined with a sparkle?

Ideas to handle large reports

  1. Define token limits for each provider based on their documented context windows

  2. Prioritize content:

    • Always include the tools summary for context
    • Always include general statistics if available
    • Add detailed sections until approaching the limit
  3. Use a conservative token estimation (4 chars per token) and leave a 10% buffer

  4. Log a warning when content needs to be truncated

Additional recommendations that could be implemented:

  1. Add configuration options to control content prioritization:
config.ai_summary_prioritize_sections = ["fastqc", "alignment_metrics"]  # Priority sections
config.ai_summary_exclude_sections = ["software_versions"]  # Sections to skip
  1. Implement smarter content selection:
  • Skip redundant information
  • Summarize large tables/plots
  • Focus on sections with warning/error flags
  1. Consider splitting analysis into multiple API calls for very large reports:
  • First call for high-level overview
  • Additional calls for detailed section analysis
  • Combine results intelligently
  1. Add provider-specific optimizations:
  • Use different prompts/strategies based on model capabilities
  • Leverage features like function calling for structured output

@vladsavelyev vladsavelyev added this to the v1.26 milestone Oct 9, 2024
@ewels

This comment was marked as resolved.

@ewels ewels left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's merge this sucka!

@vladsavelyev vladsavelyev merged commit ebb52af into main Jan 22, 2025
@vladsavelyev vladsavelyev deleted the ai branch January 22, 2025 09:25
@vladsavelyev vladsavelyev restored the ai branch January 22, 2025 09:25
@ewels ewels deleted the ai branch September 17, 2025 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants