|
--- |
|
license: mit |
|
--- |
|
# Table of Contents |
|
|
|
* [InterpreterAtomicFlow](#InterpreterAtomicFlow) |
|
* [InterpreterAtomicFlow](#InterpreterAtomicFlow.InterpreterAtomicFlow) |
|
* [set\_up\_flow\_state](#InterpreterAtomicFlow.InterpreterAtomicFlow.set_up_flow_state) |
|
* [run](#InterpreterAtomicFlow.InterpreterAtomicFlow.run) |
|
|
|
<a id="InterpreterAtomicFlow"></a> |
|
|
|
# InterpreterAtomicFlow |
|
|
|
<a id="InterpreterAtomicFlow.InterpreterAtomicFlow"></a> |
|
|
|
## InterpreterAtomicFlow Objects |
|
|
|
```python |
|
class InterpreterAtomicFlow(AtomicFlow) |
|
``` |
|
|
|
This flow is used to run the code passed from the caller. |
|
*Input Interface*: |
|
- `code` |
|
- `language` |
|
|
|
*Output Interface*: |
|
- `interpreter_output`: output of the code interpreter |
|
- `code_runs`: whether the code runs successfully or not |
|
|
|
*Configuration Parameters*: |
|
- None |
|
|
|
**Full credits to open-interpreter (https://github.com/KillianLucas/open-interpreter) |
|
for the usage of code interpreters (package `code_interpreters`) and the function truncate_output()** |
|
|
|
I'm extracting the code interpreter part from open-interpreter because the litellm version of open-interpreter |
|
is not compatible with that of the current version of aiflows(v.0.1.7). |
|
|
|
<a id="InterpreterAtomicFlow.InterpreterAtomicFlow.set_up_flow_state"></a> |
|
|
|
#### set\_up\_flow\_state |
|
|
|
```python |
|
def set_up_flow_state() |
|
``` |
|
|
|
class-specific flow state: language and code, which describes the programming language and the code to run. |
|
|
|
<a id="InterpreterAtomicFlow.InterpreterAtomicFlow.run"></a> |
|
|
|
#### run |
|
|
|
```python |
|
def run(input_message: FlowMessage) |
|
``` |
|
|
|
Run the code interpreter and return the output. |
|
|
|
**Arguments**: |
|
|
|
- `input_message` (`FlowMessage`): The input message of the flow. |
|
|
|
|