messages.summarizeText #

Summarize the contents of a message with AI, see here » for more info.

Clients should use message.summary_from_language as a hint for showing a summarization button; its absence does not forbid invoking this method.

Layer 223

textWithEntities#751f3146 text:string entities:Vector<MessageEntity> = TextWithEntities;
---functions---
messages.summarizeText#9d4104e2 flags:# peer:InputPeer id:int to_lang:flags.0?string = TextWithEntities;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
peerInputPeerThe peer where the message is located.
idintMessage ID.
to_langflags.0?stringIf set, generates the summary in the specified target language (two-letter ISO 639-1 language code) instead of the message's language.
toneflags.2?stringIf set, rephrases the summary using the specified AI composer tone » (pass the tone identifier)

Result #

TextWithEntities

Only users can use this method #

Possible errors #

CodeTypeDescription
400INPUT_TEXT_TOO_LONGThe specified text is too long.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.

AI features #

Telegram offers many AI features powered by Cocoon — a decentralized network designed to maximize privacy.

message #

A message