- Notifications
You must be signed in to change notification settings - Fork1.1k
feat:<RequestLogsRow /> cached tokens output#20974
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
dannykopping left a comment
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.
Looks fine to me, needs some tests please.
Someone from the FE squad will have to give the final review, though.
| Object.keys(obj).sort().join(","), | ||
| ); | ||
| // If the keys are different, just instantly return the objects | ||
| if(newSet(keySets).size>1)returnnonEmptyObjects; |
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.
We can still merge the fields which are common, no?
| <divclassName="flex flex-col gap-2"> | ||
| <div>Token Usage Metadata</div> | ||
| <divclassName="bg-surface-secondary rounded-md p-4"> | ||
| <pre>{JSON.stringify(tokenUsagesMetadata,null,2)}</pre> |
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.
Not really what we discussed, but probably ok for now.
Uh oh!
There was an error while loading.Please reload this page.
This pull-request traverses the
token_usages.metadata[...]fields and merges them into a single consumable object so that we're able discern information about the metadata within the token usages at a glance. Its not the be-all end-all implementation of this feature but its a stepping stone in order to render more useful data to the frontend.These are currently mergable because they only contain
numberbased fields. When it encounters something within the object that can't be merged (minus empty objects{}) it will simply return them as an array.Preview
Logic breakdown