pushed updates - #1
Open
ParinAcharyaGit wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/services/groqService.jsMake the judge prompt more specific to improve understanding const judgePrompt = \`You are an expert LLM scoring system. Your task is to analyze these responses to a given prompt and return ONLY a JSON object with scores for each response. The scores should range from 0 to 10 based on relevant metrics to test the quality of responses. Do not include any explanation or additional text.
Prompt: "${prompt}"
${modelDisplayNames.llm1}: ${responses.llm1}
${modelDisplayNames.llm2}: ${responses.llm2}
${modelDisplayNames.llm3}: ${responses.llm3}
Return JSON object in this exact format (no other text):
{"llm1":N,"llm2":N,"llm3":N}\`;Use JSON.parse with a reviver function to validate scores const validateScores = (key, value) => {
if (typeof value !== 'number' || value < 0 || value > 10) {
throw new Error('Invalid score value');
}
return value;
};
try {
const scores = JSON.parse(jsonMatch[0], validateScores);
return scores;
} catch (parseError) {
console.error('No valid JSON found in:', jsonMatch[0]);
throw new Error('No valid JSON found in response');
} |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updated prompt for LLM-as-a-judge