@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
27 lines (26 loc) • 1.42 kB
JavaScript
;
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.encode = encode;
exports.encodeBatch = encodeBatch;
const CypherFunctions_1 = require("../../expressions/functions/CypherFunctions");
const CypherProcedure_1 = require("../../procedures/CypherProcedure");
const normalize_expr_1 = require("../../utils/normalize-expr");
const GENAI_VECTOR_NAMESPACE = "genai.vector";
/** Encode a given resource as a vector using the named provider.
* @see [Neo4j Documentation](https://neo4j.com/docs/cypher-manual/current/functions/#header-query-functions-genai)
* @group Functions
*/
function encode(resource, provider, configuration) {
return new CypherFunctions_1.CypherFunction("encode", [resource, (0, normalize_expr_1.normalizeExpr)(provider), (0, normalize_expr_1.normalizeMap)(configuration)], GENAI_VECTOR_NAMESPACE);
}
/** Encode a given batch of resources as vectors using the named provider.
* @see [Neo4j Documentation](https://neo4j.com/docs/operations-manual/current/reference/procedures/#procedure_genai_vector_encodeBatch)
* @group Procedures
*/
function encodeBatch(resources, provider, configuration) {
return new CypherProcedure_1.CypherProcedure("encodeBatch", [resources, (0, normalize_expr_1.normalizeExpr)(provider), (0, normalize_expr_1.normalizeMap)(configuration)], GENAI_VECTOR_NAMESPACE);
}