Delete unused check_token_limit

This commit is contained in:
Nathan Evans 2025-12-16 14:43:54 -08:00
parent 8bf28187da
commit bdc2485433

View File

@ -1,15 +0,0 @@
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""Token limit method definition."""
from graphrag.index.text_splitting.text_splitting import TokenTextSplitter
def check_token_limit(text, max_token):
"""Check token limit."""
text_splitter = TokenTextSplitter(chunk_size=max_token, chunk_overlap=0)
docs = text_splitter.split_text(text)
if len(docs) > 1:
return 0
return 1