Skip to content

Pass replied-to message text to LLM #44

Description

@s-nagaev

Goal

When a user talks to the bot via the reply feature, the text of the replied-to message must be included in the prompt that is sent to the LLM.
Right now only the user’s own message reaches the provider, so important context is lost.

Motivation

• Preserves conversational context (especially in busy group chats).
• Aligns behaviour with Hiroshi implementation (see s-nagaev/hiroshi#24).

Tasks

  1. Update message-building logic
    • Detect message.reply_to_message in the incoming Telegram update.
    • Concatenate the original text and the user’s reply into one prompt, e.g.:

    > {replied_to_message.text}
    
    {user_message.text}
    
  2. Provider-agnostic
    • Ensure the combined prompt is passed unchanged to any LLM provider (OpenAI, BigModel, etc.).

Reference

Similar fix in Hiroshi: s-nagaev/hiroshi#24

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions