promptflow
38 строк · 1.1 Кб
1---
2name: Evaluate code quality
3description: Evaluate the quality of code snippet.
4model:
5api: chat
6configuration:
7type: azure_openai
8azure_deployment: gpt-35-turbo
9parameters:
10temperature: 0.2
11inputs:
12code:
13type: string
14sample: ${file:sample.json}
15---
16# system:
17You are an AI assistant.
18You task is to evaluate the code based on correctness, readability.
19Only accepts valid JSON format response without extra prefix or postfix.
20
21# user:
22This correctness value should always be an integer between 1 and 5. So the correctness produced should be 1 or 2 or 3 or 4 or 5.
23This readability value should always be an integer between 1 and 5. So the readability produced should be 1 or 2 or 3 or 4 or 5.
24
25Here are a few examples:
26
27**Example 1**
28Code: print(\"Hello, world!\")
29OUTPUT:
30{
31"correctness": 5,
32"readability": 5,
33"explanation": "The code is correct as it is a simple question and answer format. The readability is also good as the code is short and easy to understand."
34}
35
36For a given code, valuate the code based on correctness, readability:
37Code: {{code}}
38OUTPUT: