REPL
In NEXTgpt, we have implemented the Read Evaluate Print and Loop (REPL) Framework to execute different tasks such as plot generation. It allows users to execute lines of Python code and receive immediate feedback.
For complex problems, LLM can generate the code to compute the answer rather than producing the answer directly.
Data Flow
flowchart LR
A[Prompt] -->C[REPL Framework]
B[Documents] --> C
C --> |create command|D[REPL Tool create image files] --> |output|C --> E[LLM Response]
Usecase Creation
You can use the developer portal under the tab usecase creation or call the POST
API.
Here's a sample prompt:
Generate a python code that counts how many letters in the following text:
**************************
{text_file}
**************************
The output should look something like the following:
text_length = len(<<<INSERT TEXT HERE AS STRING>>>)
text_length
Respond by giving only the code output, do not add comments or description, this is very important.
Usecase Test/Debug
You can test the usecase through the frontend or debug using the developer portal under the tab Debug.
Prepare and upload the documents in .txt
to test the usecase.
Here's a sample:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
In the above template, the text will be inserted in <<<INSERT TEXT HERE AS STRING>>>
Execute or run the usecase. The usecase will generate a python code that counts the number of letters in the uploaded document and will run the python code accordingly.