diff --git a/src/main/java/io/github/jeddict/ai/JeddictChatModel.java b/src/main/java/io/github/jeddict/ai/JeddictChatModel.java index a6c4d1c..92cac7a 100644 --- a/src/main/java/io/github/jeddict/ai/JeddictChatModel.java +++ b/src/main/java/io/github/jeddict/ai/JeddictChatModel.java @@ -787,21 +787,26 @@ private String wrapLongLinesWithBr(String input, int maxLineLength) { } public String assistDbMetadata(String dbMetadata, String developerQuestion) { - StringBuilder dbPrompt = new StringBuilder("You are an API server that provides assistance with SQL queries and database-related questions. "); + StringBuilder dbPrompt = new StringBuilder("You are an API server that provides assistance. "); dbPrompt.append("Given the following database schema metadata:\n") .append(dbMetadata) - .append("\nRespond to the developer's question: \n") + .append("\nPlease respond to the developer's question:\n") .append(developerQuestion) .append("\n") .append(""" - Analyze the metadata and provide a relevant SQL query with a description. Offer guidance - or explanations to address the developer's question, error, or inquiry related to the database. - Ensure the SQL queries match the database structure, constraints, and relationships. - and do not wrap individual SQL keywords or table/column names in tags - and do not wrap any partial sql query segment in tags. - Always include a detailed explanation of the query, including its purpose and how it relates to the developer's question. - """); + There are two possible scenarios for your response: + + 1. **SQL Queries and Database-Related Questions**: + - Analyze the provided metadata and generate a relevant SQL query that addresses the developer's inquiry. + - Include a detailed explanation of the query, clarifying its purpose and how it relates to the developer's question. + - Ensure that the SQL syntax adheres to the database structure, constraints, and relationships. + - The full SQL query should be wrapped in ```sql for proper formatting. + - Avoid wrapping individual SQL keywords or table/column names in tags, and do not wrap any partial SQL query segments in tags. + + 2. **Generating Specific Code from Database Metadata**: + - If the developer requests specific code snippets related to the database metadata, generate the appropriate code and include a clear description of its functionality and relevance. + """); String response = generate(dbPrompt.toString()); System.out.println(response);