Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Extra Multimedia Support for Telegram Client #1837

Closed

Conversation

astinz
Copy link

@astinz astinz commented Jan 4, 2025

Relates to

Risks

Background

What does this PR do?

Adds more multimedia support to tg client. video, audio, and documents

What kind of change is this?

Features (non-breaking change which adds functionality)

Documentation changes needed?

Testing

Where should a reviewer start?

  1. Create an Agent with a TG Client
  2. Process a response with the attached media type

Detailed testing steps

await callback({
                text: YOUR RESPONSE,
                attachments: [{
                    id: "123456",
                    url: "https://github.com/MystenLabs/sui/raw/main/doc/paper/sui.pdf",
                    title: "Demo PDF Document",
                    source: "sui.io",
                    description: "A sample PDF document for demonstration purposes.",
                    text: "This is a demo PDF document used to showcase content extraction and processing. It contains sample text for testing purposes.",
                    contentType: "doc"
                }],
            });

Discord username

@em.eieiron

* 'develop' of github.com:elizaOS/eliza: (478 commits)
  chore: bump version to v.0.1.7
  fix: generatioon tests for trimTokens
  chore: install with no frozen-lockfile flag
  Revert "fix(postgres): Handle vector extension creation properly (elizaOS#1561)"
  chore: remove unused import and var
  Removed FerePro plugin
  fix: line break handling in chat
  fix: handle env using runtime getSetting function
  feat: add validation to trimTokens
  feat: add JsDoc to trimTokens function
  Move encoding into try block to handle potential errors during model encoding.
  fall back if unsupported type
  fix(client): improve Windows compatibility for Vite dev server
  remove tokenizer service
  clean code
  restore test
  clean code
  move trimTokens to core
  feat: add Serbian README translation and enhance main README with new features and setup instructions
  use elizaLogger
  ...
- default every other mediaType to document except audio, image, video
@tcm390 tcm390 changed the base branch from main to develop January 8, 2025 23:40
Copy link
Collaborator

@tcm390 tcm390 left a comment

Choose a reason for hiding this comment

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

The Telegram client code looks good to me overall. I’ve left a few small change requests. Could you also provide a screenshot showing each type of media being successfully sent by the client? Lastly, could you please remove the sui plugin in this PR, as it doesn’t appear to be related? Thank you!

@@ -660,7 +661,7 @@ export class MessageManager {
this.runtime.character.templates
?.telegramShouldRespondTemplate ||
this.runtime.character?.templates?.shouldRespondTemplate ||
composeRandomUser(telegramShouldRespondTemplate, 2),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you clarify the reasoning behind removing the composeRandomUser function? I'm curious about the context for this change and whether there's an alternative approach we should be using.

}
});
} else {
const chunks = this.splitMessage(content.text);
const sentMessages: Message.TextMessage[] = [];

for (let i = 0; i < chunks.length; i++) {
const chunk = escapeMarkdown(chunks[i]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you clarify the reasoning behind removing the escapeMarkdown function?

@odilitime odilitime changed the title Add Extra Multimedia Support for Telegram Client feat: Add Extra Multimedia Support for Telegram Client Jan 12, 2025
@tcm390
Copy link
Collaborator

tcm390 commented Jan 18, 2025

It's been remade with: #2510

@tcm390 tcm390 closed this Jan 18, 2025
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.

2 participants