little polish for spring chat agent

This commit is contained in:
Martin Lippert
2024-10-02 10:19:15 +02:00
parent 25f8eef426
commit b1bc70840e
6 changed files with 8 additions and 8 deletions

View File

@@ -40,7 +40,7 @@ export default class SpringBootChatAgent {
}
const selectedProjectUri = Uri.file(selectedProject?.fsPath).toString();
// Fetch project related information from the Spring boot language server
// Fetch project related information from the Spring Boot language server
const bootProjInfo = await commands.executeCommand("sts/spring-boot/bootProjectInfo", selectedProjectUri) as BootProjectInfo;
const projectContext = `
Use the following project information for the solution: Please suggest code compatible with the project version.
@@ -48,7 +48,7 @@ export default class SpringBootChatAgent {
Main Spring project name: ${bootProjInfo.name}
Root Package name: ${bootProjInfo.mainClass.substring(0, bootProjInfo.mainClass.lastIndexOf('.'))}
Build tool: ${bootProjInfo.buildTool}
Spring boot version: ${bootProjInfo.springBootVersion}
Spring Boot version: ${bootProjInfo.springBootVersion}
Java version: ${bootProjInfo.javaVersion}
User prompt: ${request.prompt}
`;
@@ -105,5 +105,5 @@ export function activate(
const agent = chat.createChatParticipant(PARTICIPANT_ID, async (request, context, progress, token) => {
return springBootChatAgent.handlePrompts(request, context, progress, token);
});
agent.iconPath = Uri.joinPath(context.extensionUri, 'readme-imgs', 'spring-tools-icon.png');
agent.iconPath = Uri.joinPath(context.extensionUri, 'readme-imgs', 'sts4-32.png');
}

View File

@@ -1,6 +1,6 @@
import CopilotRequest from "./copilotRequest"
export const systemPrompt = `**Your task is to create Java source code for a Spring boot application. Follow these guidelines:**
export const systemPrompt = `**Your task is to create Java source code for a Spring Boot application. Follow these guidelines:**
- IMPORTANT: CONCLUDE YOUR RESPONSE WITH THE MARKER \"//${CopilotRequest.DEFAULT_END_MARK}\" TO INDICATE END OF RESPONSE.
- Generate a pom.xml snippet that includes the necessary Spring Boot Starter dependencies such as "spring-boot-starter-jpa".
- Organize code into appropriate package. Use the Package name as the root package and place the files in sub-packages accordingly.
@@ -15,7 +15,7 @@ export const systemPrompt = `**Your task is to create Java source code for a Spr
- Include an integration test if there are multiple architectural layers.
`
export const systemBoot3Prompt = `For Spring boot 3 and above:
export const systemBoot3Prompt = `For Spring Boot 3 and above:
- IMPORTANT: For JPA related applications, the 'javax' package has been replaced with 'jakarta' package. All JPA-related imports should use 'jakarta.persistence' instead of 'javax.persistence'.
\`\`\`
"""

View File

@@ -37,9 +37,9 @@
"chatParticipants": [
{
"id": "springboot.agent",
"fullName": "Spring boot",
"name": "springboot",
"description": "Spring boot chat agent",
"fullName": "Spring Tools",
"name": "spring",
"description": "Spring Tools chat agent",
"commands": [
{
"name": "add",

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB