Package dev.langchain4j.image_to_diagram
Interface ImageToDiagram
- All Known Implementing Classes:
DiagramCorrectionProcess
,ImageToDiagramProcess
public interface ImageToDiagram
Represents the functionality to convert images to diagrams.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static class
Represents the state of an agent, specifically tailored for managing diagram-related data and processes. -
Method Summary
Modifier and TypeMethodDescriptiondefault dev.langchain4j.model.openai.OpenAiChatModel
getModel()
Returns an instance of the defaultOpenAiChatModel
.default dev.langchain4j.model.openai.OpenAiChatModel
Retrieves an instance of theOpenAiChatModel
configured for vision tasks.static dev.langchain4j.model.input.PromptTemplate
loadPromptTemplate
(String resourceName) Loads aPromptTemplate
from the specified resource name.
-
Method Details
-
getVisionModel
default dev.langchain4j.model.openai.OpenAiChatModel getVisionModel()Retrieves an instance of theOpenAiChatModel
configured for vision tasks.- Returns:
- An
OpenAiChatModel
object with predefined settings suitable for processing images and videos. - Throws:
IllegalArgumentException
- if no OPENAI_API_KEY is provided in the system properties.
-
getModel
default dev.langchain4j.model.openai.OpenAiChatModel getModel()Returns an instance of the defaultOpenAiChatModel
.- Returns:
- a configured
OpenAiChatModel
with the API key obtained from the system property "OPENAI_API_KEY". - Throws:
IllegalArgumentException
- if no OPENAI_API_KEY is provided as a system property.
-
loadPromptTemplate
static dev.langchain4j.model.input.PromptTemplate loadPromptTemplate(String resourceName) throws Exception Loads aPromptTemplate
from the specified resource name.- Parameters:
resourceName
- the name of the resource file, must not be null or empty- Returns:
- the loaded
PromptTemplate
- Throws:
Exception
- if the resource is not found or an error occurs during reading
-