Config json
call_api(prompt, options, context)
Function used by default by promptfoo. Check the config_json.yml.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt |
str
|
The prompt used in the configuration file (prompts section of config_json.yml). |
required |
options |
|
required | |
context |
dict
|
A dictionary containing the other_vars and context return by the previous function get_var |
required |
Source code in src/evaluation/configs/config_json.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
get_var(var_name, prompt, other_vars)
Function used by default by promptfoo call from the column 'context' of the dataset used in config_json.yml (test_json.csv).
This function returns the context that will be used in the following call_api function The context can be. For example, the retrieved list of documents this is an example, and we will return the context that is defined in the csv file other_vars contains the vars of the csv file. prompt contains the prompt in the config_json.yml
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt |
str
|
The prompt used in the configuration file (prompts section of config_json.yml). |
required |
other_vars |
dict
|
A dictionary containing variables from a CSV file. |
required |
Source code in src/evaluation/configs/config_json.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|