public class AiModelType
extends java.lang.Object
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.
AiModel model = ((OpenAiModel)AiModel.create(AiModelType.GPT_4_O_MINI).withApiKey(apiKey)).withOrganization("Organization").withProject("Project");
SummarizeOptions options = new SummarizeOptions();
options.setSummaryLength(SummaryLength.SHORT);
Document oneDocumentSummary = model.summarize(firstDoc, options);
oneDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.One.docx");
options.setSummaryLength(SummaryLength.LONG);
Document multiDocumentSummary = model.summarize(new Document[] { firstDoc, secondDoc }, options);
multiDocumentSummary.save(getArtifactsDir() + "AI.AiSummarize.Multi.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
CLAUDE_3_HAIKU
Claude 3 Haiku generative model type.
|
static int |
CLAUDE_3_OPUS
Claude 3 Opus generative model type.
|
static int |
CLAUDE_3_SONNET
Claude 3 Sonnet generative model type.
|
static int |
CLAUDE_35_HAIKU
Claude 3.5 Haiku generative model type.
|
static int |
CLAUDE_35_SONNET
Claude 3.5 Sonnet generative model type.
|
static int |
GEMINI_15_FLASH
Gemini 1.5 Flash generative model type.
|
static int |
GEMINI_15_FLASH_8_B
Gemini 1.5 Flash-8B generative model type.
|
static int |
GEMINI_15_PRO
Gemini 1.5 Pro generative model type.
|
static int |
GPT_35_TURBO
GPT-3.5 Turbo generative model type.
|
static int |
GPT_4_O
GPT-4o generative model type.
|
static int |
GPT_4_O_MINI
GPT-4o mini generative model type.
|
static int |
GPT_4_TURBO
GPT-4 Turbo generative model type.
|
static int |
length |
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String aiModelTypeName) |
static java.lang.String |
getName(int aiModelType) |
static int[] |
getValues() |
static java.lang.String |
toString(int aiModelType) |
public static int GPT_4_O
public static int GPT_4_O_MINI
public static int GPT_4_TURBO
public static int GPT_35_TURBO
public static int GEMINI_15_FLASH
public static int GEMINI_15_FLASH_8_B
public static int GEMINI_15_PRO
public static int CLAUDE_35_SONNET
public static int CLAUDE_35_HAIKU
public static int CLAUDE_3_OPUS
public static int CLAUDE_3_SONNET
public static int CLAUDE_3_HAIKU
public static int length