All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fi.evolver.ai.spring.Tokenizer Maven / Gradle / Ivy

package fi.evolver.ai.spring;

import com.knuddels.jtokkit.api.EncodingType;

public interface Tokenizer {

	public static final Tokenizer CL100K_BASE = JtokkitTokenizer.of(EncodingType.CL100K_BASE);
	
	public static final Tokenizer O200K_BASE = JtokkitTokenizer.of(EncodingType.O200K_BASE);

	public int[] tokenize(String text);

	public default int countTokens(String text) {
		return tokenize(text).length;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy