-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial version #228
base: main
Are you sure you want to change the base?
initial version #228
Conversation
i want to refactor this to use the fixie SDK after it supports list agent conversations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for now, run this by @petersalas though
const response = await axios({ | ||
method: 'get', | ||
maxBodyLength: Infinity, | ||
url: `https://api.fixie.ai/api/v1/agents/${agentId}/conversations`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this endpoint paginated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it is. changed the implementation to handle paging.
numTokens += encoded.length; | ||
|
||
numConvoChars += message.response.length; | ||
numConvoTokens += encoded.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ignores the quadratic effect where messages become input tokens to subsequent generations (e.g. a conversation with 10 messages uses >> 10 times the number of input tokens as a conversation with 1 message)
But old messages also get pruned as well as they fill up the context window, so calculating it accurately is even trickier. The easiest thing to get approximately correct is to calculate the number of output tokens, because that's just the assistant text/functionCall messages, but I'm guessing you want an estimate for both :)
i want to refactor this to use the fixie SDK after it supports list agent conversations.