promptflow

Форк
0
/
eval_code_quality.prompty 
38 строк · 1.1 Кб
1
---
2
name: Evaluate code quality
3
description: Evaluate the quality of code snippet.
4
model:
5
  api: chat
6
  configuration:
7
    type: azure_openai
8
    azure_deployment: gpt-35-turbo
9
  parameters:
10
    temperature: 0.2
11
inputs: 
12
  code:
13
    type: string
14
sample: ${file:sample.json}
15
---
16
# system:
17
You are an AI assistant. 
18
You task is to evaluate the code based on correctness, readability.
19
Only accepts valid JSON format response without extra prefix or postfix.
20

21
# user:
22
This 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.
23
This 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

25
Here are a few examples:
26

27
**Example 1**
28
Code: print(\"Hello, world!\")
29
OUTPUT:
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

36
For a given code, valuate the code based on correctness, readability:
37
Code: {{code}}
38
OUTPUT:

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.