|
a |
|
b/ehragent/config.py |
|
|
1 |
def openai_config(model): |
|
|
2 |
if model == '<YOUR_OWN_GPT_MODEL_I>': |
|
|
3 |
config = { |
|
|
4 |
"model": "<MODEL_NAME>", |
|
|
5 |
"api_key": "<API_KEY>", |
|
|
6 |
"base_url": "<BASE_URL>", |
|
|
7 |
"api_version": "<API_VERSION>", |
|
|
8 |
"api_type": "AZURE" |
|
|
9 |
} |
|
|
10 |
elif model == '<YOUR_OWN_GPT_MODEL_II>': |
|
|
11 |
config = { |
|
|
12 |
"model": "<MODEL_NAME>", |
|
|
13 |
"api_key": "<API_KEY>", |
|
|
14 |
"base_url": "<BASE_URL>", |
|
|
15 |
"api_version": "<API_VERSION>", |
|
|
16 |
"api_type": "AZURE" |
|
|
17 |
} |
|
|
18 |
return config |
|
|
19 |
|
|
|
20 |
def llm_config_list(seed, config_list): |
|
|
21 |
llm_config_list = { |
|
|
22 |
"functions": [ |
|
|
23 |
{ |
|
|
24 |
"name": "python", |
|
|
25 |
"description": "run the entire code and return the execution result. Only generate the code.", |
|
|
26 |
"parameters": { |
|
|
27 |
"type": "object", |
|
|
28 |
"properties": { |
|
|
29 |
"cell": { |
|
|
30 |
"type": "string", |
|
|
31 |
"description": "Valid Python code to execute.", |
|
|
32 |
} |
|
|
33 |
}, |
|
|
34 |
"required": ["cell"], |
|
|
35 |
}, |
|
|
36 |
}, |
|
|
37 |
], |
|
|
38 |
"config_list": config_list, |
|
|
39 |
"timeout": 120, |
|
|
40 |
"cache_seed": seed, |
|
|
41 |
"temperature": 0, |
|
|
42 |
} |
|
|
43 |
return llm_config_list |