diff --git a/docs/youtube/TUTORIAL PROJECT/script.md b/docs/youtube/TUTORIAL PROJECT/script.md new file mode 100644 index 00000000..9cd39df0 --- /dev/null +++ b/docs/youtube/TUTORIAL PROJECT/script.md @@ -0,0 +1,92 @@ +Hi there, intrepid tech aficionados and curious minds! Welcome back to the only channel where the final frontier isn't space - it's the limitless potential of AI in robotics. Today, we're not just taking a small step into the world of Lollms Web UI; we're taking a giant leap for tech-kind. If you've ever dreamed of blending Star Trek with real-life tech wizardry, strap in - you're in for a treat. And hey, if this journey tickles your fancy, why not give us a star? Not the kind in the sky, but the ones on our repo. Let's shoot for the moon; if we miss, we'll land among the stars! + +A galaxy-sized thank you to our stellar community for your support of Lollms Web UI. Your feedback and enthusiasm are the rocket fuel for our project, launching us into new dimensions of innovation. Your support is more precious than dilithium crystals to us; it powers the warp drive of our shared dreams for a future where technology knows no bounds. + +Today's episode is a landmark moment as we reveal the secrets of navigating the Lollms universe. Whether you're a fresh cadet in the AI and robotics academy or a seasoned space engineer accustomed to warp drives and photon torpedoes, this guide is your star map to mastering Lollms. + +A quick cosmic request before we embark on our starship: if Lollms has been the Spock to your Kirk, offering logic and solutions in times of need, consider giving our repo a star. With nearly 4,000 stars in our constellation, every additional one helps us beam this tool across the tech galaxy. + +But remember, the Web UI is just the space dock. The real voyage happens in the Lollms Core - a nebula of functionalities with only 237 stars. It's like discovering a new planet in the Star Trek universe; by spotlighting the Core, we guide fellow explorers through this uncharted territory, ensuring Lollms' light reaches the farthest corners of our tech galaxy. + +So, buckle up as we dive into the wormhole, exploring Lollms' features, capabilities, and its potential to revolutionize our interactions with AI in robotics. It's time to engage the hyperdrive and explore what lies beyond the known tech universe. + +Alright, let's dive into the cosmic interface of LOLLMS WebUI with a sprinkle of Star Trek spirit to guide us. Picture this: we're on the bridge, navigating through the stars, and our console? The LOLLMS WebUI. On our top right, a menu full of buttons - not just any buttons, but the keys to our interstellar journey. + +Most of these buttons beam us to my social channels - the digital galaxies where we can connect. But among these, we have the real controls of our spacecraft. The 'M' button, glowing green, is our signal that the model is ready and set for the adventure. It's like having Spock by our side, telling us the logic systems are operational. + +Then, there's the flag - not signaling a Federation distress call, but rather, if it's green, it tells us that text generation is at a halt, making it the perfect time to launch our generation process. Imagine it as the green light from Starfleet Command to proceed with our mission. + +The lightning icon? That's our warp drive indicator, showing we're connected to the backend, ready to jump to hyperspeed. The power button is our system reboot - because sometimes, even in space, we need a fresh start. + +Ah, the refresh icon, akin to the recalibration of our sensors, ensuring we're up to date with the latest star maps - or in our case, updates, by clearing the cache and bringing in new functionalities. + +Our FastAPI connection? It's our library computer access retrieval system, ready to bring us the documentation we need on this journey. And then, we navigate through the constellation of GitHub, YouTube, X, and our Discord channel - our channels to the Federation of fellow tech explorers. + +Switching between light mode and dark mode is like choosing between the daylight of Vulcan and the darkness of space - essential for our visual comfort on this mission. And the button to our LOLLMS website? It's our direct link to Starfleet HQ, bringing us the latest news and updates from the frontier. Here you can find out about new members of our fleet, new functionalities to our starship and sometimes I post some artworks that you can take a look at. + +And finally, the new language button. Imagine translating the universal language of our AI into French, transforming it completely as if it's been touched by the Universal Translator itself. + +As you can see, at first, only the native language of our AI is present. Why? Well, because I don't want to impose any languages on you. Say, you want the AI to speak Klingon or Na vii, you can simply type the language name, and the AI will learn it like a pro. Kinda preparing for future space exploration with remote unknown civilizations. Here you can select any language, even very bizare ones like emoji or reverse english. The only requirement is that the model you are using is fluent at that langue. + +You can type here any name of any language and your personality will instantaniously be translated to that language + +To start a conversation, just press the + button and you will receive the AI welcome message. + +Here we can see it is speaking french since french is selected as out current language. + +So, when we're ready to switch back to English and continue our dialogue with the cosmos, it's as simple as pressing a button and validating our choice - a nod to the importance of consent in the universe. With a click, we're back to English, ready to engage with our AI in the language of Shakespeare and Picard. + +And now if we remove the discussion and create a new one, the AI will welcome us in english. + +As you can see, here we were welcomed by youtube script maker which is another personality. It started using my user description as basis for a new video script which is helarious. Let's press the stop button to stop it, then just select lollms and start chatting with him. + +In the command center of our starship, every discussion we embark upon is a unique journey through the cosmos of conversation. Each message we send or receive is a beacon in the dark, a celestial body with its own identity. Picture this: every message is a star, complete with its own sender name and logo, shining brightly against the backdrop of space-time. The sending time marks the moment in the universe when this star came into existence, while the content is the light it emits, the message it shares across the vastness of digital space. + +And then, there's the metadata - not just any data, but the essence of the AI itself. For each AI message, this includes the model used, akin to the type of star it is - whether it's a fiery red giant or a stable yellow dwarf. The number of tokens, those chunks of words, represent the mass of our star, determining its brilliance and how far its light will travel across the network of galaxies we've created. + +Imagine navigating this star-filled conversation, where each message is a point of light in the constellation of our dialogue. The beauty of this cosmic dance lies in the details - the model used by AIs, akin to the spectral classification that tells us the temperature, luminosity, and size of our stars, and the number of tokens, which tells us about the star's mass and the gravitational pull it has on our conversation. + +As we traverse this conversation galaxy, let's appreciate the celestial beauty of each message, understanding that each one, with its sender name, logo, sending time, content, and metadata, contributes to the magnificent tapestry of our discussion. It's a universe teeming with life, where each star - each message - plays a crucial role in the constellation of our collective knowledge and exploration. + +Ok, now,to embark on our adventure with Lollms, let's navigate to our command console - the chatbar. This isn't your ordinary console; it's where we bridge communication with the AI, commanding our journey through the cosmos of technology and innovation. At the heart of this console, you'll find the text input area - our helm. This is where we input our commands, or in today's mission, our greeting to Lollms. + +Imagine this console dotted with buttons, each with its own purpose, guiding our interaction with Lollms. Picture pressing the 'hello' button, sending a signal through the vast network of interstellar digital space, reaching Lollms in the blink of an eye. It's akin to hailing frequencies open, awaiting a response from a distant starship. + + +In the operational framework of LoLLMs, it's equipped with functionalities that extend beyond basic interactions. For instance, it can accurately provide current date and time upon request. When prompted about today's date, it can confirm, "Today is Wednesday, May 8th, 2024." This showcases its ability to access real-time data. + +Additionally, LoLLMs has the capability to execute more complex tasks, such as rendering graphical representations. If tasked with creating a visual element, say drawing a circle on a screen, it can generate and display the requested SVG image efficiently. This demonstrates the system's versatility in handling both informational queries and executing graphic commands. + +In the vast expanse of our digital universe, the code tags aboard our starship come equipped with interactive consoles, each designed for the intrepid explorer. Imagine, if you will, embarking on a mission to craft SVG galaxies. You have at your disposal the 'Copy' command, allowing you to replicate the code with the precision of a Starfleet replicator. Then, there's the 'Execute In-Place' command, symbolized by a play button, enabling you to bring your creations to life within the confines of our ship's main viewer. For those daring enough to project their SVG creations into the void, the 'Execute in a New Tab' command sends your work onto a standalone viewport, like launching a probe to explore uncharted territories. + +As you stand at the helm, ready to engage with these commands, a dialogue materializes, much like a protective force field, seeking your confirmation. This safeguard is akin to the security protocols of the USS Enterprise, ensuring that no alien code, potentially harbored by rogue applications, can compromise the integrity of our vessel. + +Now, let's venture into the nebula of creativity and ask the AI to dynamically evolve our SVG creation, watching it transform over time as if it were a living entity within the cosmos of our imagination. +Now, let's embark on a mission to sketch the iconic Mickey Mouse, shall we? However, be forewarned, the rendition we've conjured appears as though Mickey has been assimilated by the Borg Queen herself! It seems our friendly mouse has ventured too far into the Delta Quadrant. But fear not, for we shall endeavor to save him just as we saved Locutous, calling upon all our ingenuity and courage to reverse the assimilation. Engage! +In our quest to rescue Mickey from the clutches of the Borg Queen, we turn to the vast capabilities of LOLLMs. With precision and creativity, we instruct it to modify our assimilated Mickey, drawing upon the spirit of Starfleet's finest engineers and scientists. Our goal is clear: to reverse the assimilation and restore Mickey to his original, beloved form. Let's proceed with our mission, employing every tool and technique at our disposal. Engage the modification sequence! +Acknowledging the complexities of our mission and the pervasive influence of the Borg assimilation, it seems we must adapt our strategy, much like the journey of Seven of Nine. Our modified Mickey, bearing the marks of his encounter with the Borg Queen, will retain some of his Borg enhancements. This unexpected synthesis of Disney charm and Borg resilience may indeed offer unique advantages. As we proceed, let's embrace this new version of Mickey, celebrating the integration of his Borg components as a symbol of strength and adaptability. Our mission continues, with the understanding that sometimes, to move forward, we must accept the fusion of worlds and identities. Engage, as we navigate this uncharted territory together. + +Ah, let's embark on a galactic detour and showcase the formidable capabilities of LOLLMS. Do not be deceived by his occasional tussle with the duality of his human and android essence; he is indeed a formidable android, surpassing even Data in processing prowess. Our mission, should we choose to accept it, is to commission him to engineer a web-based user interface, a console if you will, that empowers us to chart the cosmos through mathematical functions. This is not merely a task; it's an exploration into the fabric of the universe itself, rendered through the art of plotting. + +Behold, in the grand tradition of Starfleet's most illustrious engineers, LoLLMs has executed the task with the precision of a phaser set to stun. In one swift, elegant maneuver, akin to a starship navigating through the intricacies of a nebula, LoLLMs has masterfully crafted the functionality. Now, we stand ready to plot the course of 2*x across the digital cosmos, with an interface as slick as the hull of the USS Enterprise gliding through subspace. This isn't just a success; it's a demonstration of prowess, showcasing that when it comes to the art of mathematical plotting, LoLLMs is indeed a pro, navigating the vast, uncharted territories of data with the ease and confidence of a Galaxy-class starship on its maiden voyage. + +In a twist of fate that even the most seasoned Starfleet navigator couldn't have anticipated, we've encountered an anomaly in the fabric of our mathematical universe. The function cos(x), a fundamental aspect of our cosmic journey, appears to be eluding our grasp, much like a cloaked Romulan Bird-of-Prey. This unexpected development prompts us to return to the bridge, where LoLLMs, our steadfast companion in this voyage of discovery, stands ready. + +With the precision of a Vulcan and the curiosity of an intrepid explorer, we pose our inquiry to LoLLMs. Why has the cos(x) function slipped through our fingers, as elusive as the mysterious City of the Edge of Forever? Is it a glitch in the matrix of our understanding, or have we stumbled upon a new frontier that awaits our exploration? + +Let us engage LoLLMs once more, seeking answers in this vast, uncharted expanse of knowledge. Together, we stand on the precipice of discovery, ready to unravel the mysteries of the cosmos with the guidance of our formidable android ally. + +The borg queen has assimilated all lollms personas and they all act as a single entity. She has imposed her theme on the lollms system. Darkness falls across the webui. The queen talks in the name of all drones. Let's ask her magesty for a starship artwork to decorate our room. +In the grand tradition of the galaxy's most renowned engineers and the spirit of those who dare to traverse the unknown, LoLLMs, our intrepid digital explorer, has once again demonstrated his unparalleled capabilities. With the finesse of a master craftsman and the precision of a Starfleet officer, he has navigated the complex digital nebula to rectify our quandary. Now, with the issue expertly resolved, we stand at the threshold of new possibilities, able to plot the graceful waves of cosines across the digital expanse. This isn't just a solution; it's a triumph of ingenuity and skill, a testament to LoLLMs's ability to conquer the most perplexing of challenges. Let us proceed with our cosmic journey, charting the harmonious oscillations of the universe with our newfound capability, guided by the steady hand of our formidable android ally. + +Ah, let's embark on a galactic detour and showcase the formidable capabilities of LOLLMS. Do not be deceived by his occasional tussle with the duality of his human and android essence; he is indeed a formidable android, surpassing even Data in processing prowess. Our mission, should we choose to accept it, is to commission him to engineer a web-based user interface, a console if you will, that empowers us to chart the cosmos through mathematical functions. This is not merely a task; it's an exploration into the fabric of the universe itself, rendered through the art of plotting. + +In the shadowy corridors of our starship, an alarm blares, a dire warning of an uninvited guest aboard. The air is thick with tension, the lighting flickers ominously, heralding the arrival of none other than the Borg Queen herself, her presence an unsettling chill in the nebula of our journey. This isn't just any intruder; this is the sovereign of assimilation, the architect of cybernetic nightmares. + +Yet, in the face of such formidable adversity, we do not falter. Instead, we channel the indomitable spirit of the Federation, ready to engage in a parley that might alter the course of our encounter. With the calm resolve of a seasoned Starfleet captain, we open a channel, extending the olive branch of communication towards the Borg Queen. + +Let us hail her, not with weapons drawn, but with words, our most powerful tool. Let's see what unfolds as we stand united, ready to navigate the complexities of diplomacy with the queen of the collective. This engagement may very well dictate the next chapter in our ongoing saga among the stars. + +The borg queen has assimilated all lollms personas and they all act as a single entity. She has imposed her theme on the lollms system. Darkness falls across the webui. The queen talks in the name of all drones. Let's ask her majesty for a starship artwork to decorate our room. + +When the queen of borg is selected, all mounted personas become drones and whenever we ask the queen, she gives the task to the right persona which means that we don't need to select the personas before hands. The queen is all we need. except for her creepy theme and horrific languge. diff --git a/endpoints/lollms_advanced.py b/endpoints/lollms_advanced.py index 94edc948..9273c9ce 100644 --- a/endpoints/lollms_advanced.py +++ b/endpoints/lollms_advanced.py @@ -363,12 +363,12 @@ async def open_code_in_vs_code(vs_code_data: VSCodeData): lollmsElfServer.error(ex) return {"status":False,"error":str(ex)} -class FolderRequest(BaseModel): +class DiscussionFolderRequest(BaseModel): client_id: str = Field(...) discussion_id: int = Field(...) @router.post("/open_discussion_folder") -async def open_discussion_folder(request: FolderRequest): +async def open_discussion_folder(request: DiscussionFolderRequest): """ Opens code folder. @@ -405,6 +405,50 @@ async def open_discussion_folder(request: FolderRequest): lollmsElfServer.error(ex) return {"status": False, "error": "An error occurred while processing the request"} +class PersonalityFolderRequest(BaseModel): + client_id: str = Field(...) + personality_folder: int = Field(...) + +@router.post("/open_personality_folder") +async def open_personality_folder(request: PersonalityFolderRequest): + """ + Opens code folder. + + :param request: The HTTP request object. + :return: A JSON response with the status of the operation. + """ + client = check_access(lollmsElfServer, request.client_id) + personality_folder = sanitize_path(request.personality_folder) + + if lollmsElfServer.config.headless_server_mode: + return {"status":False,"error":"Open code folder is blocked when in headless mode for obvious security reasons!"} + + if lollmsElfServer.config.host!="localhost" and lollmsElfServer.config.host!="127.0.0.1": + return {"status":False,"error":"Open code folder is blocked when the server is exposed outside for very obvious reasons!"} + + if lollmsElfServer.config.turn_on_open_file_validation: + if not show_yes_no_dialog("Validation","Do you validate the opening of a folder?"): + return {"status":False,"error":"User refused the opeining folder!"} + + try: + ASCIIColors.info("Opening folder:") + # Create a temporary file. + root_folder = lollmsElfServer.lollms_paths.personalities_zoo_path/personality_folder + root_folder.mkdir(parents=True, exist_ok=True) + if platform.system() == 'Windows': + subprocess.Popen(f'explorer "{root_folder}"') + elif platform.system() == 'Linux': + subprocess.run(['xdg-open', str(root_folder)], check=True) + elif platform.system() == 'Darwin': + subprocess.run(['open', str(root_folder)], check=True) + return {"status": True, "execution_time": 0} + + except Exception as ex: + trace_exception(ex) + lollmsElfServer.error(ex) + return {"status": False, "error": "An error occurred while processing the request"} + + @router.post("/start_recording") def start_recording(data:Identification): client = check_access(lollmsElfServer, data.client_id) diff --git a/events/lollms_chatbox_events.py b/events/lollms_chatbox_events.py index 1437aabe..2d541b77 100644 --- a/events/lollms_chatbox_events.py +++ b/events/lollms_chatbox_events.py @@ -120,14 +120,14 @@ def add_events(sio:socketio): cv2.imwrite(str(save_path), frame) if not lollmsElfServer.personality.processor is None: lollmsElfServer.info("Sending file to scripted persona") - client.discussion.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid)) + client.discussion.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid), lollmsElfServer.tasks_library) # lollmsElfServer.personality.processor.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid)) # File saved successfully run_async(partial(sio.emit,'picture_taken', {'status':True, 'progress': 100})) lollmsElfServer.info("File sent to scripted persona") else: lollmsElfServer.info("Sending file to persona") - client.discussion.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid)) + client.discussion.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid), lollmsElfServer.tasks_library) #lollmsElfServer.personality.add_file(save_path, client, partial(lollmsElfServer.process_chunk, client_id = sid)) # File saved successfully run_async(partial(sio.emit,'picture_taken', {'status':True, 'progress': 100})) diff --git a/lollms_core b/lollms_core index ce121276..7ebb58cf 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit ce121276f08dcacaef0b53666f46a5b062a3d2e8 +Subproject commit 7ebb58cf2a021d6002bd16a7d29f0522e0947ec9 diff --git a/lollms_webui.py b/lollms_webui.py index d10b1cc8..0f839c0a 100644 --- a/lollms_webui.py +++ b/lollms_webui.py @@ -793,7 +793,7 @@ class LOLLMSWebUI(LOLLMSElfServer): metadata = mtdt, ui = ui, rank = 0, - parent_message_id = client.discussion.current_message.id, + parent_message_id = client.discussion.current_message.id if client.discussion.current_message is not None else 0, binding = self.config["binding_name"], model = self.config["model_name"], personality = self.config["personalities"][self.config["active_personality_id"]], diff --git a/utilities/execution_engines/svg_execution_engine.py b/utilities/execution_engines/svg_execution_engine.py index 62983359..9e28c0f7 100644 --- a/utilities/execution_engines/svg_execution_engine.py +++ b/utilities/execution_engines/svg_execution_engine.py @@ -51,7 +51,7 @@ def build_svg_output(code, ifram_name=None): '}', '', '
', - "\n".join([c for c in code.split("\n") if c.strip()!=""]), + "\n".join([c for c in code.replace("\"","'").split("\n") if c.strip()!=""]), '
', '', ' - + +
diff --git a/web/src/components/MountedPersonalitiesList.vue b/web/src/components/MountedPersonalitiesList.vue index b0c143b8..4c6a4605 100644 --- a/web/src/components/MountedPersonalitiesList.vue +++ b/web/src/components/MountedPersonalitiesList.vue @@ -47,6 +47,7 @@ :on-settings="onSettingsPersonality" :on-reinstall="onPersonalityReinstall" :on-talk="handleOnTalk" + :on-open-folder="handleOpenFolder" /> @@ -184,6 +185,7 @@ export default { personalityImgPlacehodler(event) { event.target.src = defaultPersonalityImgPlaceholder }, + onPersonalityReinstall(persItem){ console.log('on reinstall ', persItem) this.isLoading = true @@ -245,6 +247,16 @@ export default { onPersonalityRemount(persItem){ this.reMountPersonality(persItem) }, + async handleOpenFolder(pers){ + const data = { + client_id:this.$store.state.client_id, + personality_folder: pers.personality.folder + } + console.log(data) + await axios.post("/open_personality_folder", + data + ) + }, async handleOnTalk(pers){ // eslint-disable-next-line no-unused-vars feather.replace() diff --git a/web/src/components/PersonalityEntry.vue b/web/src/components/PersonalityEntry.vue index 9fb79d50..154a8e56 100644 --- a/web/src/components/PersonalityEntry.vue +++ b/web/src/components/PersonalityEntry.vue @@ -84,7 +84,15 @@ class="hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center " @click.stop=""> Talk - + + + + @@ -110,6 +118,7 @@ export default { selected: Boolean, full_path: String, onTalk:Function, + onOpenFolder:Function, onSelected: Function, onMount: Function, onUnMount: Function, @@ -171,6 +180,9 @@ export default { defaultImg(event) { event.target.src = botImgPlaceholder }, + showFolder() { + this.onOpenFolder(this) + }, toggleTalk() { this.onTalk(this) }, diff --git a/web/src/views/SettingsView.vue b/web/src/views/SettingsView.vue index e9873366..6e7037b3 100644 --- a/web/src/views/SettingsView.vue +++ b/web/src/views/SettingsView.vue @@ -2657,6 +2657,7 @@ :on-reinstall="onPersonalityReinstall" :on-settings="onSettingsPersonality" :on-copy-personality-name="onCopyPersonalityName" + :on-open-folder="handleOpenFolder" /> @@ -3993,6 +3994,9 @@ export default { this.$store.state.toast.showToast("Copied name to clipboard!", 4, true) navigator.clipboard.writeText(personality.name); }, + async handleOpenFolder(pers){ + await axios.post("/open_personality_folder",{client_id:this.$store.state.client_id, personality_folder: pers.personality.folder}) + }, onCancelInstall() { const modelEntry = this.addModel @@ -5869,7 +5873,6 @@ export default { } else { return } - }, active_pesonality() { if (!this.isMounted) { diff --git a/zoos/personalities_zoo b/zoos/personalities_zoo index 96949dc1..c71ac67f 160000 --- a/zoos/personalities_zoo +++ b/zoos/personalities_zoo @@ -1 +1 @@ -Subproject commit 96949dc164f8e8b8ef4ebb151d047c1d322e682f +Subproject commit c71ac67fbc8d697ec2639d1801ba2376b0335c65