Package org.springframework.ai.embedding
Class PostgresMlEmbeddingClient
java.lang.Object
org.springframework.ai.embedding.PostgresMlEmbeddingClient
- All Implemented Interfaces:
EmbeddingClient
,org.springframework.beans.factory.InitializingBean
public class PostgresMlEmbeddingClient
extends Object
implements EmbeddingClient, org.springframework.beans.factory.InitializingBean
PostgresML EmbeddingClient
- Author:
- Toshiaki Maki
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPostgresMlEmbeddingClient
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) a constructorPostgresMlEmbeddingClient
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String transformer) a constructorPostgresMlEmbeddingClient
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String transformer, PostgresMlEmbeddingClient.VectorType vectorType) a constructorPostgresMlEmbeddingClient
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String transformer, PostgresMlEmbeddingClient.VectorType vectorType, Map<String, Object> kwargs, MetadataMode metadataMode) a constructor -
Method Summary
-
Constructor Details
-
PostgresMlEmbeddingClient
public PostgresMlEmbeddingClient(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) a constructor- Parameters:
jdbcTemplate
- JdbcTemplate
-
PostgresMlEmbeddingClient
public PostgresMlEmbeddingClient(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String transformer) a constructor- Parameters:
jdbcTemplate
- JdbcTemplatetransformer
- huggingface sentence-transformer name
-
PostgresMlEmbeddingClient
public PostgresMlEmbeddingClient(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String transformer, PostgresMlEmbeddingClient.VectorType vectorType) a constructor- Parameters:
jdbcTemplate
- JdbcTemplatetransformer
- huggingface sentence-transformer namevectorType
- vector type in PostgreSQL
-
PostgresMlEmbeddingClient
public PostgresMlEmbeddingClient(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String transformer, PostgresMlEmbeddingClient.VectorType vectorType, Map<String, Object> kwargs, MetadataMode metadataMode) a constructor- Parameters:
jdbcTemplate
- JdbcTemplatetransformer
- huggingface sentence-transformer namevectorType
- vector type in PostgreSQLkwargs
- optional arguments
-
-
Method Details
-
embed
- Specified by:
embed
in interfaceEmbeddingClient
-
embed
- Specified by:
embed
in interfaceEmbeddingClient
-
embed
- Specified by:
embed
in interfaceEmbeddingClient
-
embedForResponse
- Specified by:
embedForResponse
in interfaceEmbeddingClient
-
dimensions
public int dimensions()- Specified by:
dimensions
in interfaceEmbeddingClient
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-