polymath-ai / polymath-js-client

A node and JS client to query local and remote Polymaths

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement a sane token scheme to make sure the context is filled with the balance of room for answer

dalmaer opened this issue · comments

NOTES:

"DEFAULT_CONTEXT_TOKEN_COUNT = 1500
Is this a “safeish” number?

I’m looking this from:

  • We have 4000
  • Embeddings have token counts in the results.

When I grab a bunch of context I think I want to:

  • sort based on similarity
  • grab enough to fit 4000 - how much the rest of the prompt takes - how much we want for the answer
  • then go through the context adding the token count until I hit that amount

Can use this to get the token count of text: GPT Encoder

Implemented in #b8eeb19