{"modulePath":"github.com/devmiahub/langchaingo","version":"v0.1.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cloudsql\n\n## Types\n\n```go\ntype BaseIndex struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype CosineDistance struct{}\n```\n\n```go\nfunc (CosineDistance) String() string\n```\n\n```go\ntype Euclidean struct{}\n```\n\n```go\nfunc (Euclidean) String() string\n```\n\n```go\ntype HNSWOptions struct {\n\tM              int\n\tEfConstruction int\n}\n```\nHNSWOptions holds the configuration for the hnsw index.\n\n```go\nfunc (h HNSWOptions) Options() string\n```\n\n```go\ntype IVFFlatOptions struct {\n\tLists int\n}\n```\nIVFFlatOptions holds the configuration for the ivfflat index.\n\n```go\nfunc (i IVFFlatOptions) Options() string\n```\n\n```go\ntype Index interface {\n\tOptions() string\n}\n```\n\n```go\ntype InnerProduct struct{}\n```\n\n```go\nfunc (InnerProduct) String() string\n```\n\n```go\ntype SearchDocument struct {\n\tContent           string\n\tLangchainMetadata string\n\tDistance          float32\n}\n```\n\n```go\ntype VectorStore struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewVectorStore(engine cloudsqlutil.PostgresEngine,\n\tembedder embeddings.Embedder,\n\ttableName string,\n\topts ...VectorStoreOption,\n) (VectorStore, error)\n```\nNewVectorStore creates a new VectorStore with options.\n\n```go\nfunc (vs *VectorStore) AddDocuments(ctx context.Context, docs []schema.Document, _ ...vectorstores.Option) ([]string, error)\n```\nAddDocuments adds documents to the Postgres collection, and returns the ids of the added documents.\n\n```go\nfunc (vs *VectorStore) ApplyVectorIndex(ctx context.Context, index BaseIndex, name string, concurrently bool) error\n```\nApplyVectorIndex creates an index in the table of the embeddings.\n\n```go\nfunc (vs *VectorStore) DropVectorIndex(ctx context.Context, indexName string) error\n```\nDropVectorIndex drops the vector index from the VectorStore.\n\n```go\nfunc (vs *VectorStore) IsValidIndex(ctx context.Context, indexName string) (bool, error)\n```\nIsValidIndex checks if index exists in the VectorStore.\n\n```go\nfunc (*VectorStore) NewBaseIndex(indexName, indexType string, strategy distanceStrategy, partialIndexes []string, opts Index) BaseIndex\n```\n\n```go\nfunc (vs *VectorStore) ReIndex(ctx context.Context) error\n```\nReIndex recreates the index on the VectorStore.\n\n```go\nfunc (vs *VectorStore) ReIndexWithName(ctx context.Context, indexName string) error\n```\nReIndex recreates the index on the VectorStore by name.\n\n```go\nfunc (vs *VectorStore) SimilaritySearch(ctx context.Context, query string, _ int, options ...vectorstores.Option) ([]schema.Document, error)\n```\nSimilaritySearch performs a similarity search on the database using the query vector.\n\n```go\ntype VectorStoreOption func(vs *VectorStore)\n```\nVectorStoreOption is a function for creating new vector store with other than the default values.\n\n```go\nfunc WithContentColumn(contentColumn string) VectorStoreOption\n```\nWithContentColumn sets the VectorStore's ContentColumn field.\n\n```go\nfunc WithDistanceStrategy(distanceStrategy distanceStrategy) VectorStoreOption\n```\nWithDistanceStrategy sets the distance strategy used by the VectorStore.\n\n```go\nfunc WithEmbeddingColumn(embeddingColumn string) VectorStoreOption\n```\nWithEmbeddingColumn sets the EmbeddingColumn field.\n\n```go\nfunc WithIDColumn(idColumn string) VectorStoreOption\n```\nWithContentColumn sets VectorStore's the idColumn field.\n\n```go\nfunc WithK(k int) VectorStoreOption\n```\nWithK sets the number of Documents to return from the VectorStore.\n\n```go\nfunc WithMetadataColumns(metadataColumns []string) VectorStoreOption\n```\nWithMetadataColumns sets the VectorStore's MetadataColumns field.\n\n```go\nfunc WithMetadataJSONColumn(metadataJSONColumn string) VectorStoreOption\n```\nWithMetadataJSONColumn sets VectorStore's the metadataJSONColumn field.\n\n```go\nfunc WithSchemaName(schemaName string) VectorStoreOption\n```\nWithSchemaName sets the VectorStore's schemaName field.\n\n","path":"github.com/devmiahub/langchaingo/vectorstores/cloudsql","name":"cloudsql","synopsis":"","isRedistributable":true}
