Skip to content

Conversation

@CYarros10
Copy link
Contributor

@CYarros10 CYarros10 commented Aug 30, 2024

The CountTokens API calculates the number of input tokens before sending a request to the Gemini API.
Use the CountTokens API to prevent requests from exceeding the model context window, and estimate potential costs based on billable characters.

Can be used as part of a larger LLM-based DAG:

Training Dataset Lands --> GCSObjectExistenceSensor --> SupervisedFineTuningTrainOperator --> Use CountTokensOperator as a pre-check to ensure prompts will run successfully and within budget --> GenerativeModelGenerateContentOperator --> RapidEvaluation API Operators (to-do)

@potiuk
Copy link
Member

potiuk commented Sep 1, 2024

Needs rebase. Also cc: @VladaZakharova

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants