Skip to content

[FEATURE] Allow interleaving text and attachments in messageΒ #462

@Antsiscool

Description

@Antsiscool

Scope check

  • This is core LLM communication (not application logic)
  • This benefits most users (not just my use case)
  • This can't be solved in application code with current RubyLLM
  • I read the Contributing Guide

Due diligence

  • I searched existing issues
  • I checked the documentation

What problem does this solve?

Currently when a message contains both text and attachments, the text is at the beginning of the message followed by all of the attachments.

Allowing interleaving would mean we could place text closer to the correct attachment.

Proposed solution

RubyLLM::Content has a text and attachments attribute.

When formatting for a message, it first adds the text attribute and then loops through all of the attachments.

This could be changed to have a single attribute which contains both the text and attachments as an ordered array.

Why this belongs in RubyLLM

There is no way to bypass the current implementation of RubyLLM::Content and interleave text and attachments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions