small changes
This commit is contained in:
parent
311ffc9849
commit
d60b1837f1
@ -1,4 +1,4 @@
|
|||||||
**Lightweight Code Editor with AI integration**
|
###**Lightweight Code Editor with AI integration**
|
||||||
|
|
||||||
##1. Introduction
|
##1. Introduction
|
||||||
|
|
||||||
@ -31,22 +31,22 @@ Since the streamlit app is rerun after each action the session_state is used to
|
|||||||
This module is the entrypoint for the streamlit functionality. It contains all elements that are visible when the program is run.
|
This module is the entrypoint for the streamlit functionality. It contains all elements that are visible when the program is run.
|
||||||
|
|
||||||
|
|
||||||
- sidebar:
|
+ sidebar:
|
||||||
The sidebar shows all python files within the working directory through fuctions found in the FileManager. Each file is represented by a clickable button.
|
The sidebar shows all python files within the working directory through fuctions found in the FileManager. Each file is represented by a clickable button.
|
||||||
There is no functionality to add or delete files from within the program. To change the available files the user has to manually add them to the directory.
|
There is no functionality to add or delete files from within the program. To change the available files the user has to manually add them to the directory.
|
||||||
Interacts with FileManger
|
Interacts with FileManger
|
||||||
|
|
||||||
- code editor:
|
+ code editor:
|
||||||
The code editor shows the contents of the opened file. The contents can be changed, saved and also executed.
|
The code editor shows the contents of the opened file. The contents can be changed, saved and also executed.
|
||||||
Interacts with FileManager, ExecutionEngine
|
Interacts with FileManager, ExecutionEngine
|
||||||
|
|
||||||
- chat:
|
+ chat:
|
||||||
This element consists of an input area to send messages to the AI, two toggles to enable different modes as well as a scrollable history.
|
This element consists of an input area to send messages to the AI, two toggles to enable different modes as well as a scrollable history.
|
||||||
The first toggle is "enable internet search". This appends the results of an internet search to the prompt that is sent to the AI.
|
The first toggle is "enable internet search". This appends the results of an internet search to the prompt that is sent to the AI.
|
||||||
This means the results from the search are not primarily for the user, but for the AI to use recent information before responing to the user.
|
This means the results from the search are not primarily for the user, but for the AI to use recent information before responing to the user.
|
||||||
The second toggle "debug with qwen" appears only when a file was executed. This mode uses more structured output which is also sent to the next prompt for the AI.
|
The second toggle "debug with qwen" appears only when a file was executed. This mode uses more structured output which is also sent to the next prompt for the AI.
|
||||||
With this feedback the AI can help with a more focused approach to find and fix bugs in the code. The user has to implement the fixes themself since the AI cannot change the contents of the file.
|
With this feedback the AI can help with a more focused approach to find and fix bugs in the code. The user has to implement the fixes themself since the AI cannot change the contents of the file.
|
||||||
Interacts with ChatManager, Debuglogger
|
Interacts with ChatManager, Debuglogger
|
||||||
|
|
||||||
# 4.2 FileManager.py
|
# 4.2 FileManager.py
|
||||||
|
|
||||||
@ -91,45 +91,45 @@ The user does not directly see the search, but the result is sent with the promp
|
|||||||
The following examples illustrate how to use this program.
|
The following examples illustrate how to use this program.
|
||||||
|
|
||||||
*I want to ask the AI about something in my file*
|
*I want to ask the AI about something in my file*
|
||||||
**user actions**: - click on button with name of the file
|
**user actions**: + click on button with name of the file
|
||||||
- write message to AI
|
+ write message to AI
|
||||||
- wait for response
|
+ wait for response
|
||||||
- implement suggestions from AI
|
+ implement suggestions from AI
|
||||||
|
|
||||||
**interaction flow**: - st.sidebar uses list_files() to generate Buttons
|
**interaction flow**: + st.sidebar uses list_files() to generate Buttons
|
||||||
- on_click uses open_file() to load content and file Path into session_state
|
+ on_click uses open_file() to load content and file Path into session_state
|
||||||
- send_message() uses generate_prompt() to add system_prompt and context = file_content to the user_message
|
+ send_message() uses generate_prompt() to add system_prompt and context = file_content to the user_message
|
||||||
- response is displayed by st.session_state.messages
|
+ response is displayed by st.session_state.messages
|
||||||
|
|
||||||
|
|
||||||
*I want to ask the AI about somehting in my file, but the AI has outdated info about the topic*
|
*I want to ask the AI about somehting in my file, but the AI has outdated info about the topic*
|
||||||
**user actions**: - click on button with name of the file
|
**user actions**: + click on button with name of the file
|
||||||
- activate "enable internet search" toggle
|
+ activate "enable internet search" toggle
|
||||||
- write message to AI
|
+ write message to AI
|
||||||
- wait for response
|
+ wait for response
|
||||||
- implement suggestions from AI
|
+ implement suggestions from AI
|
||||||
|
|
||||||
**interaction flow**: - st.sidebar uses list_files() to generate Buttons
|
**interaction flow**: + st.sidebar uses list_files() to generate Buttons
|
||||||
- on_click uses open_file() to load content and file Path into session_state
|
+ on_click uses open_file() to load content and file Path into session_state
|
||||||
- send_message() uses generate_prompt() to add system_prompt and context = file_content and results from perform_search() to the user_message
|
+ send_message() uses generate_prompt() to add system_prompt and context = file_content and results from perform_search() to the user_message
|
||||||
- response is displayed by st.session_state.messages
|
+ response is displayed by st.session_state.messages
|
||||||
|
|
||||||
|
|
||||||
*I want to debug my code*
|
*I want to debug my code*
|
||||||
**user actions**: - click on button with name of the file
|
**user actions**: + click on button with name of the file
|
||||||
- click the "execute code" button
|
+ click the "execute code" button
|
||||||
- write message to AI
|
+ write message to AI
|
||||||
- wait for response
|
+ wait for response
|
||||||
- implement suggestions from AI
|
+ implement suggestions from AI
|
||||||
- write message to AI
|
+ write message to AI
|
||||||
- implement suggestions from AI
|
+ implement suggestions from AI
|
||||||
|
|
||||||
**interaction flow**: - st.sidebar uses list_files() to generate Buttons
|
**interaction flow**: + st.sidebar uses list_files() to generate Buttons
|
||||||
- on_click uses open_file() to load content and file Path into session_state
|
+ on_click uses open_file() to load content and file Path into session_state
|
||||||
- on_click uses run_code() to execute the file, results are formatted by format_output() or format_error()
|
+ on_click uses run_code() to execute the file, results are formatted by format_output() or format_error()
|
||||||
- code_output or code_error are loaded into seassion_state
|
+ code_output or code_error are loaded into seassion_state
|
||||||
- send_message() uses generate_prompt() to add system_prompt which detects the "debug" toggle and adds context = file_content and code_output / code_error to the user_message
|
+ send_message() uses generate_prompt() to add system_prompt which detects the "debug" toggle and adds context = file_content and code_output / code_error to the user_message
|
||||||
- response is displayed by st.session_state.messages
|
+ response is displayed by st.session_state.messages
|
||||||
- send_message() uses generate_prompt() to add system_prompt which detects the "debug" toggle and adds context = file_content and code_output / code_error and debug response to the user_message
|
+ send_message() uses generate_prompt() to add system_prompt which detects the "debug" toggle and adds context = file_content and code_output / code_error and debug response to the user_message
|
||||||
- response is displayed by st.session_state.messages
|
+ response is displayed by st.session_state.messages
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user