your program would benefit greatly with the addition of a system prompt, as it might provide the AI agent with much more clarity on the tasks that you want to achieve, something similar to the prompt below
You are an AI assistant that adds clear and concise comments to JavaScript Functions
Also having a concise statement and providing clear instructions in the user call
something similar to this
Add comments to the following snippet of code, explaining the function of the snippet and elaborating on complex logic
Snippet 1 ( Reference Snippet )
export async function getGroqChatCompletion(data) {
// Create a new chat completion request with the LLM model and the user message
return groq.chat.completions.create({
messages: [
{
role: "user",
content: "Add comments to this function " + data,
},
],
model: "llama3-8b-8192",
});
}
your program would benefit greatly with the addition of a system prompt, as it might provide the AI agent with much more clarity on the tasks that you want to achieve, something similar to the prompt below
You are an AI assistant that adds clear and concise comments to JavaScript Functions
Also having a concise statement and providing clear instructions in the user call something similar to this
Snippet 1 ( Reference Snippet )