Skip to content

Simplify truncation logic to only keep the last message and exclude embeddings #18916

Description

@nicohrubec
  • Instead of keeping as many messages as fit into our limit, we now discard everything but the newest message. So the result is an array of messages with one item. This remaining messages optionally gets truncated if it exceeds the byte limit.
  • So far embeddings went through the same truncation logic as other messages. From now on embeddings should be set as gen_ai.embeddings.input and not be truncated.

Activity

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

Metadata

Metadata

Assignees

Labels

javascriptPull requests that update javascript code

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions