A filter that truncates chat history to retain the 7000 tokens while preserving the system prompt for optimal context management.
""" title: Token Clip Filter author: houxin author_url: https://github.com/hx173149 funding_url: https://github.com/hx173149 version: 0.1 """ from pydantic import BaseModel, Field from typing import Optional import tiktoken
A filter that truncates chat history to retain the 7000 tokens while preserving the system prompt for optimal context management.
We use optional analytics to improve our websites, and advertising cookies on this site. Privacy Policy.