AiModelType

Inheritance: java.lang.Object

public class AiModelType

Represents the types of AiModel that can be integrated into the document processing workflow.

Remarks:

This enumeration is used to define which large language model (LLM) should be utilized for tasks such as summarization, translation, and content generation.

Examples:

Shows how to summarize text using OpenAI and Google models.


 Document firstDoc = new Document(getMyDir() + "Big document.docx");
 Document secondDoc = new Document(getMyDir() + "Document.docx");

 String apiKey = System.getenv("API_KEY");
 // Use OpenAI or Google generative language models.
 IAiModelText model = (IAiModelText)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey);

 Document oneDocumentSummary = model.summarize(firstDoc, new SummarizeOptions(); { oneDocumentSummary.setSummaryLength(SummaryLength.SHORT); });
 oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");

 Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, new SummarizeOptions(); { multiDocumentSummary.setSummaryLength(SummaryLength.LONG); });
 multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");
 

Fields

FieldDescription
GEMINI_15_FLASHGemini 1.5 Flash generative model type.
GEMINI_15_FLASH_8_BGemini 1.5 Flash-8B generative model type.
GEMINI_15_PROGemini 1.5 Pro generative model type.
GPT_35_TURBOGPT-3.5 Turbo generative model type.
GPT_4_OGPT-4o generative model type.
GPT_4_O_MINIGPT-4o mini generative model type.
GPT_4_TURBOGPT-4 Turbo generative model type.
length

Methods

MethodDescription
fromName(String aiModelTypeName)
getName(int aiModelType)
getValues()
toString(int aiModelType)

GEMINI_15_FLASH

public static int GEMINI_15_FLASH

Gemini 1.5 Flash generative model type.

GEMINI_15_FLASH_8_B

public static int GEMINI_15_FLASH_8_B

Gemini 1.5 Flash-8B generative model type.

GEMINI_15_PRO

public static int GEMINI_15_PRO

Gemini 1.5 Pro generative model type.

GPT_35_TURBO

public static int GPT_35_TURBO

GPT-3.5 Turbo generative model type.

GPT_4_O

public static int GPT_4_O

GPT-4o generative model type.

GPT_4_O_MINI

public static int GPT_4_O_MINI

GPT-4o mini generative model type.

GPT_4_TURBO

public static int GPT_4_TURBO

GPT-4 Turbo generative model type.

length

public static int length

fromName(String aiModelTypeName)

public static int fromName(String aiModelTypeName)

Parameters:

ParameterTypeDescription
aiModelTypeNamejava.lang.String

Returns: int

getName(int aiModelType)

public static String getName(int aiModelType)

Parameters:

ParameterTypeDescription
aiModelTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int aiModelType)

public static String toString(int aiModelType)

Parameters:

ParameterTypeDescription
aiModelTypeint

Returns: java.lang.String