Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

Conversation

@rderbier
Copy link
Contributor

Show

  • how to create upsert delete query operations and use Dgraph as the backend. (Product, Category)
  • how to compute and save a text embedding for Products
  • expose a natural language search of Products.

finalize add to also update product and link to existing category
add delete generic function
add searchBySimilarity generic function
@ryanfoxtyler ryanfoxtyler marked this pull request as draft November 19, 2024 13:36
@johnymontana
Copy link
Contributor

@rderbier Can you please add an entry in the README table for this one? Otherwise looks good to go!

use proper json library to inject dgraph.type and uids
add entry for dgraph-101
@rderbier rderbier marked this pull request as ready for review November 19, 2024 20:30
export function addEmbeddingToJson(payload: string, predicate:string, embedding: f32[]): string {
// Add the embedding to the payload at root level
// TO DO: extend to nested entities and use JSONpath
payload = payload.replace("{", `{ \"${predicate}\":\"${JSON.stringify(embedding)}\",`)

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of "{{".
@rderbier rderbier merged commit c6119c6 into main Nov 20, 2024
@rderbier rderbier deleted the raphael/dgraph-101 branch November 20, 2024 20:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants