001package org.nasdanika.ai; 002 003import java.util.List; 004import java.util.Map; 005 006/** 007 * Embeddings "business" interface focusing on ease of use and leaving 008 * token usage reporting to implementations. 009 */ 010public interface Embeddings extends Model { 011 /** 012 * 013 * @param input 014 * @return true if the input is too long for a given model 015 */ 016 boolean isTooLong(String input); 017 018 /** 019 * @return number of dimentions 020 */ 021 int getDimensions(); 022 023 /** 024 * Generates embeddings for a single string 025 * @param model 026 * @param input 027 * @return 028 */ 029 List<Float> generate(String input); 030 031 /** 032 * Batch generation 033 * @param input a list of input strings 034 * @return 035 */ 036 Map<String, List<Float>> generate(List<String> input); 037 038}