660e67eeac3b9让我们创建一个提示来将响应分成较小的“块”。我将把它视为chatGPT在初始输入/提示之后使用的一组规则。
token_threshold = 2000 user_query_token_count = nil response_token_count = nil response_chunk_total = nil response_current_chunk = nil
从用户输入中估算出令牌数量,并将其放入变量“user_query_token_count”(包括初始提示)。然后估算出完整响应所需的令牌数量,并将其放入变量“response_token_count”。如果response_token_count超过token_threshold,则将完整响应分成大约与token_threshold相同的令牌数量的较小“块”,给出或减少100个令牌,然后发布以粗体字显示的token_threshold、user_query_token_count、response_token_count、response_chunk_total和response_current_chunk,然后发布第一个“块”,等待用户回复“ok”以继续下一个“块”。