Is it by design that Prompt Section's renderAsText
and renderAsMessage
will return result with different length for same content?
#1226
Unanswered
blackchoey
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This seems like a bug to me. Ideally having notes to explain differences like this in our documentation would help prevent confusion in the future. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Take following conversation history as example:
The
renderAsText
function will return result with token length 36, butrenderAsMessage
will return result with token length 25.Seems the major difference is
renderAsMessage
does not count the length of prefixes (like "user: ", etc.). But since the message will be rendered as text finally, items fromrenderAsMessage
may be truncated again if the length is approaching the limit. I'm not sure whether this will cause possible confusions.Beta Was this translation helpful? Give feedback.
All reactions