Class JsonSchemas
java.lang.Object
dev.langchain4j.service.output.JsonSchemas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<JsonSchema> jsonSchemaFrom(Type returnType) Generates aJsonSchemafor the given POJO type, for example to configure aResponseFormat.
-
Constructor Details
-
JsonSchemas
public JsonSchemas()
-
-
Method Details
-
jsonSchemaFrom
Generates aJsonSchemafor the given POJO type, for example to configure aResponseFormat.- Parameters:
returnType- the type to generate the JSON schema for- Returns:
- the JSON schema, or an empty
Optionalif the type is not a POJO (e.g.String,Integer, an enum, aList, or a LangChain4j type such asAiMessageorChatResponse)
-