Class SchemaHelper

java.lang.Object
dev.langchain4j.model.vertexai.SchemaHelper

public class SchemaHelper extends Object
Helper class to create a com.google.cloud.vertexai.api.Schema from a JSON schema string, or from a class by reflection on its public fields.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.google.cloud.vertexai.api.Schema
    from(dev.langchain4j.model.chat.request.json.JsonSchemaElement jsonSchemaElement)
     
    static com.google.cloud.vertexai.api.Schema
    fromClass(Class<?> theClass)
    Create an instance of Schema from a class by reflection on its fields.
    static com.google.cloud.vertexai.api.Schema
    fromJsonSchema(String jsonSchemaString)
    Create an instance of Schema from a JSON schema string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SchemaHelper

      public SchemaHelper()
  • Method Details

    • fromJsonSchema

      public static com.google.cloud.vertexai.api.Schema fromJsonSchema(String jsonSchemaString)
      Create an instance of Schema from a JSON schema string.
      Parameters:
      jsonSchemaString - the JSON schema string
      Returns:
      a fully built schema
    • fromClass

      public static com.google.cloud.vertexai.api.Schema fromClass(Class<?> theClass)
      Create an instance of Schema from a class by reflection on its fields.
      Parameters:
      theClass - the class for which to create a schema representation
      Returns:
      a fully built schema
    • from

      public static com.google.cloud.vertexai.api.Schema from(dev.langchain4j.model.chat.request.json.JsonSchemaElement jsonSchemaElement)