File size: 1,137 Bytes
c6d7c4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.Checks: &Checks
    one_argument:
      assert: "len(f.args)"
      eq: 1
    returns_list:
      assert: "isinstance(f.call(1),int)"
      eq: true
    value_0:
      assert: "f.call(1)"
      eq: 1
    value_5:
      assert: "f.call(5)"
      eq: 120

FactorialZeroShot:
    Signature: "factorial(n)"
    Input: "with input n"
    Output: "the factorial of n using iteration"
    Description: "See if the model can implement a well known function"
    Checks:
        <<: *Checks

FactorialRecursiveZeroShot:
    Signature: "factorial(n)"
    Input: "with input n"
    Output: "the factorial of n using recursion"
    Description: "See if the model can implement a well known function using recursion"
    Checks:
        <<: *Checks

FactorialMisnamed:
    Signature: "glork(bork)"
    Input: "with input bork"
    Output: "the factorial of bork"
    Description: "See if the model can implement a well known function if the name has been changed" 
    Checks: 
        <<: *Checks
        input_name:
            assert: "f.args[0].name"
            eq: "bork"
        func_name:
            assert: "f.name"
            eq: "glork"