-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
constants.py
113 lines (108 loc) · 3.64 KB
/
constants.py
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
from autogen import config_list_from_json
from dacite import from_dict
from jsonc_parser.parser import JsoncParser
import os
from typedefs import ProjectConfig
import utils
PROJECT_CONFIG_AS_DICT = JsoncParser.parse_file("./env.jsonc")
PROJECT_CONFIG: ProjectConfig = from_dict(
data_class=ProjectConfig, data=PROJECT_CONFIG_AS_DICT
)
COMMON_LLM_CONFIG = {
# https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
"config_list": [utils.get_model_config_as_dict(PROJECT_CONFIG)],
"functions": [
{
"name": "fetch_web_page",
"description": "Fetch a web page and return its content as text and Markdown links.",
"parameters": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Url to fetch from.",
},
},
"required": ["url"],
},
},
{
"name": "read_file",
"description": "Read and return a file content.",
"parameters": {
"type": "object",
"properties": {
"relative_path": {
"type": "string",
"description": "Relative path of the file.",
},
},
"required": ["relative_path"],
},
},
{
"name": "run_bash_command",
"description": "Run a bash command and return the output.",
"parameters": {
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "Bash command.",
},
},
"required": ["command"],
},
},
{
"name": "run_rust_file",
"description": "Compile a rust file into `./temp_executable` and execute it.",
"parameters": {
"type": "object",
"properties": {
"rust_file_path": {
"type": "string",
"description": "Rust file path.",
},
},
"required": ["rust_file_path"],
},
},
{
"name": "search_web",
"description": "Search for a text query using Brave search engine and return results as JSON.",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Query to search.",
},
},
"required": ["query"],
},
},
{
"name": "write_file",
"description": "Write content to a file, creating it if necessary.",
"parameters": {
"type": "object",
"properties": {
"relative_path": {
"type": "string",
"description": "Relative path of the file.",
},
"file_source": {
"type": "string",
"description": """Content to write.""",
},
},
"required": ["relative_path", "file_source"],
},
},
],
"request_timeout": 600,
"seed": 42,
}
PROJECT_DIRECTORY_NAME = "project"
PROJECT_DIRECTORY_PATH = os.path.join(os.getcwd(), PROJECT_DIRECTORY_NAME)