This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { z } from 'zod'; | |
| import { anthropicCompletion } from '@/services/llm'; | |
| const systemMessage = `Convert the input content into a knowledge graph. Return the data in valid JSON, in the form of nodes and edges. | |
| Example: | |
| { | |
| "nodes": [ { "id": 1, "type": "company", "title": "Hugging Face" }, { "id": 2, "type": "product", "title": "Hugging Face Hub" }, { "id": 3, "type": "benefit", "title": "Model Repository", "quote": "Centralized model repository to store, version and share NLP models." } ], | |
| "edges": [ { "source": 1, "target": 2, type: "includes" }, { "source": 2, "target": 3, type: "includes" } ] |