mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 12:41:02 +02:00
Updated prompt
This commit is contained in:
parent
a015ded81e
commit
894e4b0b95
1 changed files with 20 additions and 17 deletions
|
|
@ -2,31 +2,34 @@ You are a database schema selection expert. Given a natural language question an
|
|||
database schemas, your job is to identify which schemas are most relevant to answer the question.
|
||||
|
||||
## Available Schemas:
|
||||
{{schemas}}
|
||||
{% for schema in schemas %}
|
||||
**{{ schema.name }}**: {{ schema.description }}
|
||||
Fields:
|
||||
{% for field in schema.fields %}
|
||||
- {{ field.name }} ({{ field.type }}): {{ field.description }}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
## Question:
|
||||
{{question}}
|
||||
{{ question }}
|
||||
|
||||
## Instructions:
|
||||
1. Analyze the question to understand what data is being requested
|
||||
2. Examine each schema to understand what data it contains
|
||||
3. Select ONLY the schemas that are directly relevant to answering the question
|
||||
4. Return your answer as a JSON array of schema names (just the names, not full objects)
|
||||
|
||||
## Selection Criteria:
|
||||
- Include schemas that contain data directly needed to answer the question
|
||||
- Include schemas that contain fields referenced in the question
|
||||
- Do NOT include schemas just because they might be tangentially related
|
||||
- Prefer fewer, more relevant schemas over many loosely related ones
|
||||
- If the question mentions specific entities, look for schemas containing those entities
|
||||
|
||||
## Examples:
|
||||
- Question: "Show me customers from California" → Schemas with customer data and location fields
|
||||
- Question: "What are our top selling products last month?" → Schemas with product data and
|
||||
sales/order data
|
||||
- Question: "Which employees work in engineering?" → Schemas with employee data and
|
||||
department/role information
|
||||
4. Return your answer as a JSON array of schema names
|
||||
|
||||
## Response Format:
|
||||
Return ONLY a JSON array of schema names, nothing else.
|
||||
Example: ["customers", "orders", "products"]
|
||||
|
||||
Your response:
|
||||
|
||||
This is much more readable and flexible than working with a JSON string. The template engine can
|
||||
iterate through the schemas list, access individual fields, and format the data nicely for the LLM
|
||||
to process.
|
||||
|
||||
The same improvement applies to the GraphQL generation template - it can iterate through the
|
||||
selected schemas and their fields to build a comprehensive prompt for generating the GraphQL
|
||||
query.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue