Upload README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,79 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Table of Contents
|
2 |
+
|
3 |
+
* [CodeGeneratorAtomicFlow](#CodeGeneratorAtomicFlow)
|
4 |
+
* [CodeGeneratorAtomicFlow](#CodeGeneratorAtomicFlow.CodeGeneratorAtomicFlow)
|
5 |
+
* [instantiate\_from\_config](#CodeGeneratorAtomicFlow.CodeGeneratorAtomicFlow.instantiate_from_config)
|
6 |
+
* [run](#CodeGeneratorAtomicFlow.CodeGeneratorAtomicFlow.run)
|
7 |
+
* [\_\_init\_\_](#__init__)
|
8 |
+
|
9 |
+
<a id="CodeGeneratorAtomicFlow"></a>
|
10 |
+
|
11 |
+
# CodeGeneratorAtomicFlow
|
12 |
+
|
13 |
+
<a id="CodeGeneratorAtomicFlow.CodeGeneratorAtomicFlow"></a>
|
14 |
+
|
15 |
+
## CodeGeneratorAtomicFlow Objects
|
16 |
+
|
17 |
+
```python
|
18 |
+
class CodeGeneratorAtomicFlow(ChatAtomicFlow)
|
19 |
+
```
|
20 |
+
|
21 |
+
This class wraps around the Chat API to generate code from a goal. One thing worth noting is that we need to
|
22 |
+
make sure the code generator does not write repetitive code that is present in the library, so we need to inject
|
23 |
+
the function signatures in the library to the system prompts.
|
24 |
+
|
25 |
+
*Input Interface Non Initialized*:
|
26 |
+
- `goal`
|
27 |
+
- `code_library`
|
28 |
+
- `memory_files`
|
29 |
+
|
30 |
+
*Input Interface Initialized*:
|
31 |
+
- `goal`
|
32 |
+
- `code_library`
|
33 |
+
- `memory_files`
|
34 |
+
|
35 |
+
*Output Interface*:
|
36 |
+
- `code`
|
37 |
+
- `language_of_code`
|
38 |
+
|
39 |
+
<a id="CodeGeneratorAtomicFlow.CodeGeneratorAtomicFlow.instantiate_from_config"></a>
|
40 |
+
|
41 |
+
#### instantiate\_from\_config
|
42 |
+
|
43 |
+
```python
|
44 |
+
@classmethod
|
45 |
+
def instantiate_from_config(cls, config)
|
46 |
+
```
|
47 |
+
|
48 |
+
Instantiate a CodeGeneratorAtomicFlow from a configuration.
|
49 |
+
|
50 |
+
**Arguments**:
|
51 |
+
|
52 |
+
- `config`: Configuration dictionary.
|
53 |
+
|
54 |
+
**Returns**:
|
55 |
+
|
56 |
+
Instantiated CodeGeneratorAtomicFlow.
|
57 |
+
|
58 |
+
<a id="CodeGeneratorAtomicFlow.CodeGeneratorAtomicFlow.run"></a>
|
59 |
+
|
60 |
+
#### run
|
61 |
+
|
62 |
+
```python
|
63 |
+
def run(input_data: Dict[str, Any]) -> Dict[str, Any]
|
64 |
+
```
|
65 |
+
|
66 |
+
Run the flow.
|
67 |
+
|
68 |
+
**Arguments**:
|
69 |
+
|
70 |
+
- `input_data`: Input data.
|
71 |
+
|
72 |
+
**Returns**:
|
73 |
+
|
74 |
+
Output data.
|
75 |
+
|
76 |
+
<a id="__init__"></a>
|
77 |
+
|
78 |
+
# \_\_init\_\_
|
79 |
+
|