xebia-functional / xef

Building applications with LLMs through composability, in Kotlin, Scala, ...

Home Page:https://xef.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spike: tokens calculation

anamariamv opened this issue · comments

OpenAI reference

Summary
The library currently calculates the tokens based on the message in the Kotlin model but it should calculate based on the request payload instead.

Some references:

ModelType params
tokensForMessages fun
reduceByLimitToken fun