You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -191,27 +191,27 @@ defs:
191
191
read: ./data.yaml
192
192
parser: yaml
193
193
text:
194
-
- "\n{{ CODE.source_code }}\n"
194
+
- "\n${ CODE.source_code }\n"
195
195
- model: watsonx/ibm/granite-34b-code-instruct
196
196
input:
197
197
- |
198
198
Here is some info about the location of the function in the repo.
199
199
repo:
200
-
{{ CODE.repo_info.repo }}
201
-
path: {{ CODE.repo_info.path }}
202
-
Function_name: {{ CODE.repo_info.function_name }}
200
+
${ CODE.repo_info.repo }
201
+
path: ${ CODE.repo_info.path }
202
+
Function_name: ${ CODE.repo_info.function_name }
203
203
204
204
205
205
Explain the following code:
206
206
```
207
-
{{ CODE.source_code }}```
207
+
${ CODE.source_code }```
208
208
```
209
209
210
210
In this program we first define some variables using the `defs` construct. Here `CODE` is defined to be a new variable, holding the result of the `read` block that follows.
211
211
A `read` block can be used to read from a file or stdin. In this case, we read the content of the file `./data.yaml`, parse it as YAML using the `parser` construct, then
212
212
assign the result to variable `CODE`.
213
213
214
-
Next we define a `text`, where the first block is simply a string and writes out the source code. This is done by accessing the variable `CODE`. The syntax `{{ var }}` means accessing the value of a variable in the scope. Since `CODE` contains YAML data, we can also access fields such as `CODE.source_code`.
214
+
Next we define a `text`, where the first block is simply a string and writes out the source code. This is done by accessing the variable `CODE`. The syntax `${ var }` means accessing the value of a variable in the scope. Since `CODE` contains YAML data, we can also access fields such as `CODE.source_code`.
215
215
216
216
The second block calls a granite model on WatsonX via LiteLLM. Here we explicitly provide an `input` field which means that we do not pass the entire text produced so far to the model, but only what is specified in this field. In this case, we specify our template by using the variable `CODE` as shown above.
217
217
@@ -248,20 +248,20 @@ defs:
248
248
TRUTH:
249
249
read: ./ground_truth.txt
250
250
text:
251
-
- "\n{{ CODE.source_code }}\n"
251
+
- "\n${ CODE.source_code }\n"
252
252
- model: watsonx/ibm/granite-34b-code-instruct
253
253
def: EXPLANATION
254
254
input: |
255
255
Here is some info about the location of the function in the repo.
256
256
repo:
257
-
{{ CODE.repo_info.repo }}
258
-
path: {{ CODE.repo_info.path }}
259
-
Function_name: {{ CODE.repo_info.function_name }}
257
+
${ CODE.repo_info.repo }
258
+
path: ${ CODE.repo_info.path }
259
+
Function_name: ${ CODE.repo_info.function_name }
260
260
261
261
262
262
Explain the following code:
263
263
```
264
-
{{ CODE.source_code }}```
264
+
${ CODE.source_code }```
265
265
- |
266
266
267
267
@@ -272,10 +272,10 @@ text:
272
272
code: |
273
273
import textdistance
274
274
expl = """
275
-
{{ EXPLANATION }}
275
+
${ EXPLANATION }
276
276
"""
277
277
truth = """
278
-
{{ TRUTH }}
278
+
${ TRUTH }
279
279
"""
280
280
result = textdistance.levenshtein.normalized_similarity(expl, truth)
281
281
@@ -328,31 +328,31 @@ text:
328
328
|
329
329
Here is some info about the location of the function in the repo.
330
330
repo:
331
-
{{ CODE.repo_info.repo }}
332
-
path: {{ CODE.repo_info.path }}
333
-
Function_name: {{ CODE.repo_info.function_name }}
331
+
${ CODE.repo_info.repo }
332
+
path: ${ CODE.repo_info.path }
333
+
Function_name: ${ CODE.repo_info.function_name }
334
334
335
335
336
336
Explain the following code:
337
337
```
338
-
{{ CODE.source_code }}```
338
+
${ CODE.source_code }```
339
339
- def: EVAL
340
340
contribute: []
341
341
lan: python
342
342
code:
343
343
|
344
344
import textdistance
345
345
expl = """
346
-
{{ EXPLANATION }}
346
+
${ EXPLANATION }
347
347
"""
348
348
truth = """
349
-
{{ TRUTH }}
349
+
${ TRUTH }
350
350
"""
351
351
result = textdistance.levenshtein.normalized_similarity(expl, truth)
352
352
- data:
353
-
input: "{{ CODE }}"
354
-
output: "{{ EXPLANATION }}"
355
-
metric: "{{ EVAL }}"
353
+
input: ${ CODE }
354
+
output: ${ EXPLANATION }
355
+
metric: ${ EVAL }
356
356
```
357
357
358
358
The data block takes various variables and combines their values into a JSON object with fields `input`, `output`, and `metric`. We mute the output of all the other blocks with `contribute` set to `[]`. The `contribute` construct can be used to specify how the result of a block is contributed to the overall result, and the background context.
Copy file name to clipboardExpand all lines: docs/README.md
+22-22
Original file line number
Diff line number
Diff line change
@@ -196,27 +196,27 @@ defs:
196
196
read: ./data.yaml
197
197
parser: yaml
198
198
text:
199
-
- "\n{{ CODE.source_code }}\n"
199
+
- "\n${ CODE.source_code }\n"
200
200
- model: watsonx/ibm/granite-34b-code-instruct
201
201
input:
202
202
- |
203
203
Here is some info about the location of the function in the repo.
204
204
repo:
205
-
{{ CODE.repo_info.repo }}
206
-
path: {{ CODE.repo_info.path }}
207
-
Function_name: {{ CODE.repo_info.function_name }}
205
+
${ CODE.repo_info.repo }
206
+
path: ${ CODE.repo_info.path }
207
+
Function_name: ${ CODE.repo_info.function_name }
208
208
209
209
210
210
Explain the following code:
211
211
```
212
-
{{ CODE.source_code }}```
212
+
${ CODE.source_code }```
213
213
```
214
214
215
215
In this program we first define some variables using the `defs` construct. Here `CODE` is defined to be a new variable, holding the result of the `read` block that follows.
216
216
A `read` block can be used to read from a file or stdin. In this case, we read the content of the file `./data.yaml`, parse it as YAML using the `parser` construct, then
217
217
assign the result to variable `CODE`.
218
218
219
-
Next we define a `text`, where the first block is simply a string and writes out the source code. This is done by accessing the variable `CODE`. The syntax `{{ var }}` means accessing the value of a variable in the scope. Since `CODE` contains YAML data, we can also access fields such as `CODE.source_code`.
219
+
Next we define a `text`, where the first block is simply a string and writes out the source code. This is done by accessing the variable `CODE`. The syntax `${ var }` means accessing the value of a variable in the scope. Since `CODE` contains YAML data, we can also access fields such as `CODE.source_code`.
220
220
221
221
The second block calls a granite model on WatsonX via LiteLLM. Here we explicitly provide an `input` field which means that we do not pass the entire text produced so far to the model, but only what is specified in this field. In this case, we specify our template by using the variable `CODE` as shown above.
222
222
@@ -253,20 +253,20 @@ defs:
253
253
TRUTH:
254
254
read: ./ground_truth.txt
255
255
text:
256
-
- "\n{{ CODE.source_code }}\n"
256
+
- "\n${ CODE.source_code }\n"
257
257
- model: watsonx/ibm/granite-34b-code-instruct
258
258
def: EXPLANATION
259
259
input: |
260
260
Here is some info about the location of the function in the repo.
261
261
repo:
262
-
{{ CODE.repo_info.repo }}
263
-
path: {{ CODE.repo_info.path }}
264
-
Function_name: {{ CODE.repo_info.function_name }}
262
+
${ CODE.repo_info.repo }
263
+
path: ${ CODE.repo_info.path }
264
+
Function_name: ${ CODE.repo_info.function_name }
265
265
266
266
267
267
Explain the following code:
268
268
```
269
-
{{ CODE.source_code }}```
269
+
${ CODE.source_code }```
270
270
- |
271
271
272
272
@@ -277,10 +277,10 @@ text:
277
277
code: |
278
278
import textdistance
279
279
expl = """
280
-
{{ EXPLANATION }}
280
+
${ EXPLANATION }
281
281
"""
282
282
truth = """
283
-
{{ TRUTH }}
283
+
${ TRUTH }
284
284
"""
285
285
result = textdistance.levenshtein.normalized_similarity(expl, truth)
286
286
@@ -333,31 +333,31 @@ text:
333
333
|
334
334
Here is some info about the location of the function in the repo.
335
335
repo:
336
-
{{ CODE.repo_info.repo }}
337
-
path: {{ CODE.repo_info.path }}
338
-
Function_name: {{ CODE.repo_info.function_name }}
336
+
${ CODE.repo_info.repo }
337
+
path: ${ CODE.repo_info.path }
338
+
Function_name: ${ CODE.repo_info.function_name }
339
339
340
340
341
341
Explain the following code:
342
342
```
343
-
{{ CODE.source_code }}```
343
+
${ CODE.source_code }```
344
344
- def: EVAL
345
345
contribute: []
346
346
lan: python
347
347
code:
348
348
|
349
349
import textdistance
350
350
expl = """
351
-
{{ EXPLANATION }}
351
+
${ EXPLANATION }
352
352
"""
353
353
truth = """
354
-
{{ TRUTH }}
354
+
${ TRUTH }
355
355
"""
356
356
result = textdistance.levenshtein.normalized_similarity(expl, truth)
357
357
- data:
358
-
input: "{{ CODE }}"
359
-
output: "{{ EXPLANATION }}"
360
-
metric: "{{ EVAL }}"
358
+
input: ${ CODE }
359
+
output: ${ EXPLANATION }
360
+
metric: ${ EVAL }
361
361
```
362
362
363
363
The data block takes various variables and combines their values into a JSON object with fields `input`, `output`, and `metric`. We mute the output of all the other blocks with `contribute` set to `[]`. The `contribute` construct can be used to specify how the result of a block is contributed to the overall result, and the background context.
0 commit comments