Class PostgresMlEmbeddingModel
java.lang.Object
org.springframework.ai.embedding.AbstractEmbeddingModel
org.springframework.ai.postgresml.PostgresMlEmbeddingModel
- All Implemented Interfaces:
- EmbeddingModel,- Model<EmbeddingRequest,,- EmbeddingResponse> - org.springframework.beans.factory.InitializingBean
public class PostgresMlEmbeddingModel
extends AbstractEmbeddingModel
implements org.springframework.beans.factory.InitializingBean
PostgresML EmbeddingModel
- Author:
- Toshiaki Maki, Christian Tzolov
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsFields inherited from class org.springframework.ai.embedding.AbstractEmbeddingModelembeddingDimensions
- 
Constructor SummaryConstructorsConstructorDescriptionPostgresMlEmbeddingModel(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) a constructorPostgresMlEmbeddingModel(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, PostgresMlEmbeddingOptions options) PostgresMlEmbeddingModel(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, PostgresMlEmbeddingOptions options, boolean createExtension) a PostgresMlEmbeddingModel constructor
- 
Method SummaryModifier and TypeMethodDescriptionvoidcall(EmbeddingRequest request) Executes a method call to the AI model.float[]Embeds the given text into a vector.float[]Embeds the given document's content into a vector.Methods inherited from class org.springframework.ai.embedding.AbstractEmbeddingModeldimensions, dimensionsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.embedding.EmbeddingModelembed, embed, embedForResponse
- 
Field Details- 
DEFAULT_TRANSFORMER_MODEL- See Also:
 
 
- 
- 
Constructor Details- 
PostgresMlEmbeddingModelpublic PostgresMlEmbeddingModel(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) a constructor- Parameters:
- jdbcTemplate- JdbcTemplate
 
- 
PostgresMlEmbeddingModelpublic PostgresMlEmbeddingModel(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, PostgresMlEmbeddingOptions options) 
- 
PostgresMlEmbeddingModelpublic PostgresMlEmbeddingModel(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, PostgresMlEmbeddingOptions options, boolean createExtension) a PostgresMlEmbeddingModel constructor- Parameters:
- jdbcTemplate- JdbcTemplate to use to interact with the database.
- options- PostgresMlEmbeddingOptions to configure the client.
 
 
- 
- 
Method Details- 
embedDescription copied from interface:EmbeddingModelEmbeds the given text into a vector.- Specified by:
- embedin interface- EmbeddingModel
- Parameters:
- text- the text to embed.
- Returns:
- the embedded vector.
 
- 
embedDescription copied from interface:EmbeddingModelEmbeds the given document's content into a vector.- Specified by:
- embedin interface- EmbeddingModel
- Parameters:
- document- the document to embed.
- Returns:
- the embedded vector.
 
- 
callDescription copied from interface:ModelExecutes a method call to the AI model.- Specified by:
- callin interface- EmbeddingModel
- Specified by:
- callin interface- Model<EmbeddingRequest,- EmbeddingResponse> 
- Parameters:
- request- the request object to be sent to the AI model
- Returns:
- the response from the AI model
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
 
-