Search the Community
Showing results for tags 'llm'.
-
I divide the project into parts for easier management. The project is in early beta stage, for research and development. 🚀 AI_Assistant.au3 which is included in SciTE_AI_Assistant.au3, but can also be used as a standalone UDF in which I #include "StringSize.au3" ; "https://www.autoitscript.com/forum/topic/114034-stringsize-m23-bugfix-version-27-dec-23" by Melba23 - thanks for that So that it folds the console output, and is visible within its boundaries (especially when it is on the side and is slim) for more comfortable reading works directly with the ollama. I use a small models qwen2.5-coder:3b as default, llama3.2:3b , phi4-mini:3.8b so that I don't have to wait too long for a response. However, I have set as a parameter which model it calls, so that it changes the model per job if necessary I added a new function: _AI_Request which asynchronously sends a request to _AI_Call() and waits for the response. I also added a new parameter $iThink - Enable or disable thinking if Model supporting (0=none, 1=yes/not visible, 2=yes/visible). (Default is 0) to conform with the new ability to enable or disable thinking. (feature since version 0.9.0) Ollama now has the ability to enable or disable thinking. This gives users the flexibility to choose the model’s thinking behavior for different applications and use cases. When thinking is enabled, the output will separate the model’s thinking from the model’s output. When thinking is disabled, the model will not think and directly output the content. Models that support thinking: DeepSeek R1 Qwen 3 more will be added under thinking models. AI_Assistant\Example\Example2.au3 - thinking example #include "..\AI_Assistant.au3" _AI_DebugInfo(True) Example2() Func Example2() Local $sPrompt = "how many r's are in strawberry?" Local $sModel = "qwen3:4b" ; _AI_Request with thinking Enable (0=none, 1=yes/not visible, 2=yes/visible) Local $sResponse = _AI_Request($sPrompt, $sModel, Default, 1, 2) ConsoleWrite($sResponse & @CRLF & @CRLF) EndFunc Output: Thinking... Okay, so the user is asking how many R's are in the word "strawberry". Let me think. First, I need to write out the word and check each letter. Let me spell it out: S-T-R-A-W-B-E-R-R-Y. Wait, let me make sure I have that right. Strawberry is S-T-R-A-W-B-E-R-R-Y. Let me break it down letter by letter. S, T, R, A, W, B, E, R, R, Y. So that's 10 letters in total. Now, I need to count the number of R's. Let's go through each letter one by one. The first letter is S, not R. Second is T, no. Third is R—that's one. Fourth is A, no. Fifth is W, no. Sixth is B, no. Seventh is E, no. Eighth is R—that's two. Ninth is R—that's three. Tenth is Y, no. So that's three R's. Wait, let me check again to make sure I didn't miss any. S-T-R-A-W-B-E-R-R-Y. Yes, positions 3, 8, and 9 are R. So three R's in total. I think that's correct. Maybe I should write it out again to confirm. Strawberry: S T R A W B E R R Y. Yep, three R's. So the answer is 3. ...done thinking. The word **"strawberry"** contains **3 R's**. Breaking it down: **S-T-R-A-W-B-E-R-R-Y** R's are in positions 3, 8, and 9. **Answer: 3** 🍓 SciTE_AI_Assistant.au3 I changed the approach, and made it as SciTE tool. This way, the selection process, and console writing, is handled internally by SciTE. To do this you need to add the following to SciTEUser.properties (Adding_utilities_to_the_SciTE_Tools_menu) #------------------------------------------------------------------------------ # 41 SciTE_AI_Assistant command.41.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "D:\i\Pro\.AutoIT\SciTE_AI_Assistant\SciTE_AI_Assistant.au3" command.subsystem.41.$(au3)=0 command.name.41.$(au3)=SciTE AI Assistant command.shortcut.41.*.au3=F10 command.save.before.41.$(au3)=2 # command.replace.selection.41.$(au3)=1 # command.quiet.41.$(au3)=0 # command.input.41.$(au3)=$(CurrentSelection) #------------------------------------------------------------------------------ #---------------------- Contex Menu ------------------------------------------- user.context.menu=\ ||\ >>> SciTE AI Assistant <<< |1141|\ ||\ Execute Selected Path|IDM_OPENSELECTED|\ #------------------------------------------------------------------------------ and make the necessary adjustments e.g. in command.41.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "D:\i\Pro\.AutoIT\SciTE_AI_Assistant\SciTE_AI_Assistant.au3" your path for the d:\your\location\SciTE_AI_Assistant\SciTE_AI_Assistant.au3 You may need to adjust the 41 to the first tool number available to you. in this case, change the >>> SciTE AI Assistant <<< |1141|\ as well in the Context Menu After that, select the text in the SciTE, right-click and select 'instruction' from the context menu '>>> SciTE AI Assistant <<<' or hit F10 output: ; #FUNCTION# ==================================================================================================================== ; Name...........: IsMouseOverWin ; Description....: Determines if the mouse pointer is positioned over a specified window. ; Syntax.........: IsMouseOverWin($hWnd) ; Parameters.....: $hWnd - The handle of the window to check for mouse position. ; Return values .: Success: Returns True if the mouse is over the window, False otherwise. ; @error = 0: No error occurred. ; Author ........: ioa747 ; Modified ......: ; Remarks .......: This function uses MouseGetPos() to retrieve the current mouse position and WinGetPos($hWnd) to obtain ; the dimensions of the specified window. It checks if the mouse position falls within the boundaries of the window. ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== FIM (Fill-in-the-Middle <??> ) when it comes to FIM (Fill-in-the-Middle <??> ), the '<??>' tag is to specify the-Middle e.g. as in the example below, highlight the text , right click , and select, >>> SciTE AI Assistant <<< , FIM (Fill-in-the-Middle <??> ) Func SumNumbers($aNumbers) Local $iTotal = 0 For $i = 0 To UBound($aNumbers) - 1 <??> Next Return $iTotal EndFunc Prompt Builder GUI The script described is an advanced AI prompt builder tool The tool provides a user-friendly interface that allows users to create, manage, and execute AI prompts based on predefined templates or customizable settings from .ini file. macros in the Prompt Builder GUI @Selection@ = the Selection of SciTE @ScriptName@ = the Script Name (useful as title) @ScriptFullPath@ = all the content of Script @ClipGet@ = the content of Clipboard @FileRead(FilePath)@ = the content of FilePath self-introduction - ReadMe I will update the thread as soon as anything new comes up. SciTE_AI_Assistant_0.12.zip Please, every comment is appreciated! leave your comments and experiences here! Thank you very much