mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-02-21 01:42:08 +00:00
New lollms
This commit is contained in:
parent
55a780dc20
commit
824e02fac8
@ -1,5 +1,5 @@
|
||||
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
|
||||
version: 115
|
||||
version: 118
|
||||
binding_name: null
|
||||
model_name: null
|
||||
model_variant: null
|
||||
@ -241,8 +241,14 @@ audio_silenceTimer: 5000
|
||||
# Data vectorization
|
||||
rag_databases: [] # This is the list of paths to database sources. Each database is a folder containing data
|
||||
rag_vectorizer: bert # possible values bert, tfidf, word2vec
|
||||
rag_vectorizer_model: bert-base-nli-mean-tokens # The model name if applicable
|
||||
rag_vectorizer_parameters: null # Parameters of the model in json format
|
||||
rag_chunk_size: 512 # number of tokens per chunk
|
||||
rag_n_chunks: 4 #Number of chunks to recover from the database
|
||||
rag_clean_chunks: true #Removed all uinecessary spaces and line returns
|
||||
rag_follow_subfolders: true #if true the vectorizer will vectorize the content of subfolders too
|
||||
rag_check_new_files_at_startup: false #if true, the vectorizer will automatically check for any new files in the folder and adds it to the database
|
||||
rag_preprocess_chunks: false #if true, an LLM will preprocess the content of the chunk before writing it in a simple format
|
||||
|
||||
activate_skills_lib: false # Activate vectorizing previous conversations
|
||||
skills_lib_database_name: "default" # Default skills database
|
||||
|
196
lollms/app.py
196
lollms/app.py
@ -162,36 +162,8 @@ class LollmsApplication(LoLLMsCom):
|
||||
self.load_rag_dbs()
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
for entry in self.config.rag_databases:
|
||||
try:
|
||||
if "mounted" in entry:
|
||||
parts = entry.split("::")
|
||||
database_name = parts[0]
|
||||
database_path = parts[1]
|
||||
|
||||
if not PackageManager.check_package_installed_with_version("lollmsvectordb","0.5.1"):
|
||||
PackageManager.install_or_update("lollmsvectordb")
|
||||
from lollmsvectordb import VectorDatabase
|
||||
from lollmsvectordb.text_document_loader import TextDocumentsLoader
|
||||
from lollmsvectordb.lollms_tokenizers.tiktoken_tokenizer import TikTokenTokenizer
|
||||
|
||||
if self.config.rag_vectorizer == "bert":
|
||||
self.backup_trust_store()
|
||||
from lollmsvectordb.lollms_vectorizers.bert_vectorizer import BERTVectorizer
|
||||
v = BERTVectorizer()
|
||||
self.restore_trust_store()
|
||||
|
||||
elif self.config.rag_vectorizer == "tfidf":
|
||||
from lollmsvectordb.lollms_vectorizers.tfidf_vectorizer import TFIDFVectorizer
|
||||
v = TFIDFVectorizer()
|
||||
|
||||
vdb = VectorDatabase(Path(database_path)/"db_name.sqlite", v, self.model if self.model else TikTokenTokenizer(), n_neighbors=self.config.rag_n_chunks)
|
||||
vdb.build_index()
|
||||
self.active_rag_dbs.append({"name":database_name,"path":database_path,"vectorizer":vdb})
|
||||
self.config.save_config()
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
|
||||
|
||||
def backup_trust_store(self):
|
||||
self.bk_store = None
|
||||
@ -301,6 +273,7 @@ class LollmsApplication(LoLLMsCom):
|
||||
self.active_rag_dbs = []
|
||||
for rag_db in self.config.rag_databases:
|
||||
parts = rag_db.split("::")
|
||||
db_name = parts[0]
|
||||
if parts[-1]=="mounted":
|
||||
if not PackageManager.check_package_installed("lollmsvectordb"):
|
||||
PackageManager.install_package("lollmsvectordb")
|
||||
@ -316,9 +289,11 @@ class LollmsApplication(LoLLMsCom):
|
||||
elif self.config.rag_vectorizer == "tfidf":
|
||||
from lollmsvectordb.lollms_vectorizers.tfidf_vectorizer import TFIDFVectorizer
|
||||
v = TFIDFVectorizer()
|
||||
elif self.config.rag_vectorizer == "word2vec":
|
||||
from lollmsvectordb.lollms_vectorizers.word2vec_vectorizer import Word2VecVectorizer
|
||||
v = Word2VecVectorizer()
|
||||
|
||||
vdb = VectorDatabase(Path(parts[1])/"db_name.sqlite", v, self.model if self.model else TikTokenTokenizer(), n_neighbors=self.config.rag_n_chunks)
|
||||
vdb.build_index()
|
||||
vdb = VectorDatabase(Path(parts[1])/f"{db_name}.sqlite", v, self.model if self.model else TikTokenTokenizer(), n_neighbors=self.config.rag_n_chunks)
|
||||
self.active_rag_dbs.append({"name":parts[0],"path":parts[1],"vectorizer":vdb})
|
||||
|
||||
|
||||
@ -1056,7 +1031,7 @@ class LollmsApplication(LoLLMsCom):
|
||||
if self.config.data_vectorization_build_keys_words:
|
||||
self.personality.step_start("Building vector store query")
|
||||
q = f"{separator_template}".join([
|
||||
f"{separator_template}{start_header_id_template}instruction{end_header_id_template}Read the entire discussion and rewrite the last prompt for someone who hasn't read the discussion.",
|
||||
f"{start_header_id_template}instruction{end_header_id_template}Read the entire discussion and rewrite the last prompt for someone who hasn't read the discussion.",
|
||||
"Do not answer the prompt. Do not provide any explanations.",
|
||||
f"{start_header_id_template}discussion{end_header_id_template}",
|
||||
f"{discussion[-2048:]}",
|
||||
@ -1082,26 +1057,16 @@ class LollmsApplication(LoLLMsCom):
|
||||
r=v.search(query)
|
||||
results+=r
|
||||
n_neighbors = self.active_rag_dbs[0]["vectorizer"].n_neighbors
|
||||
sorted_results = sorted(results, key=lambda x: x[3])[:n_neighbors]
|
||||
try:
|
||||
for vector, text, title, path, distance in sorted_results:
|
||||
document_infos = f"{separator_template}".join([
|
||||
f"{start_header_id_template}document chunk{end_header_id_template}",
|
||||
f"\nsource_document_title:{title}",
|
||||
f"source_document_path:{path}",
|
||||
f"content:{text}\n"
|
||||
])
|
||||
sorted_results = sorted(results, key=lambda x: x.distance)[:n_neighbors]
|
||||
for chunk in sorted_results:
|
||||
document_infos = f"{separator_template}".join([
|
||||
f"{start_header_id_template}document chunk{end_header_id_template}",
|
||||
f"source_document_title:{chunk.doc.title}",
|
||||
f"source_document_path:{chunk.doc.path}",
|
||||
f"content:\n{chunk.text}\n"
|
||||
])
|
||||
|
||||
documentation += document_infos
|
||||
except:
|
||||
for vector, text, title, distance in sorted_results:
|
||||
document_infos = f"{separator_template}".join([
|
||||
f"{start_header_id_template}document chunk{end_header_id_template}",
|
||||
f"\nsource_document_title:{title}",
|
||||
f"content:{text}\n"
|
||||
])
|
||||
|
||||
documentation += document_infos
|
||||
documentation += document_infos
|
||||
|
||||
if (len(client.discussion.text_files) > 0) and client.discussion.vectorizer is not None:
|
||||
if discussion is None:
|
||||
@ -1328,25 +1293,6 @@ class LollmsApplication(LoLLMsCom):
|
||||
# Tokenize the prompt data
|
||||
tokens = self.model.tokenize(prompt_data)
|
||||
|
||||
# if this is a debug then show prompt construction details
|
||||
if self.config["debug"]:
|
||||
ASCIIColors.bold("CONDITIONNING")
|
||||
ASCIIColors.yellow(conditionning)
|
||||
ASCIIColors.bold("INTERNET SEARCH")
|
||||
ASCIIColors.yellow(internet_search_results)
|
||||
ASCIIColors.bold("DOC")
|
||||
ASCIIColors.yellow(documentation)
|
||||
ASCIIColors.bold("HISTORY")
|
||||
ASCIIColors.yellow(knowledge)
|
||||
ASCIIColors.bold("DISCUSSION")
|
||||
ASCIIColors.hilight(discussion_messages,f"{start_header_id_template}",ASCIIColors.color_yellow,ASCIIColors.color_bright_red,False)
|
||||
ASCIIColors.bold("Final prompt")
|
||||
ASCIIColors.hilight(prompt_data,f"{start_header_id_template}",ASCIIColors.color_yellow,ASCIIColors.color_bright_red,False)
|
||||
ASCIIColors.info(f"prompt size:{len(tokens)} tokens")
|
||||
ASCIIColors.info(f"available space after doc and knowledge:{available_space} tokens")
|
||||
|
||||
# self.info(f"Tokens summary:\nPrompt size:{len(tokens)}\nTo generate:{available_space}",10)
|
||||
|
||||
# Details
|
||||
context_details = {
|
||||
"client_id":client_id,
|
||||
@ -1369,3 +1315,115 @@ class LollmsApplication(LoLLMsCom):
|
||||
# Return the prepared query, original message content, and tokenized query
|
||||
return prompt_data, current_message.content, tokens, context_details, internet_search_infos
|
||||
|
||||
|
||||
# Properties ===============================================
|
||||
@property
|
||||
def start_header_id_template(self) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return self.config.start_header_id_template
|
||||
|
||||
@property
|
||||
def end_header_id_template(self) -> str:
|
||||
"""Get the end_header_id_template."""
|
||||
return self.config.end_header_id_template
|
||||
|
||||
@property
|
||||
def system_message_template(self) -> str:
|
||||
"""Get the system_message_template."""
|
||||
return self.config.system_message_template
|
||||
|
||||
|
||||
@property
|
||||
def separator_template(self) -> str:
|
||||
"""Get the separator template."""
|
||||
return self.config.separator_template
|
||||
|
||||
|
||||
@property
|
||||
def start_user_header_id_template(self) -> str:
|
||||
"""Get the start_user_header_id_template."""
|
||||
return self.config.start_user_header_id_template
|
||||
@property
|
||||
def end_user_header_id_template(self) -> str:
|
||||
"""Get the end_user_header_id_template."""
|
||||
return self.config.end_user_header_id_template
|
||||
@property
|
||||
def end_user_message_id_template(self) -> str:
|
||||
"""Get the end_user_message_id_template."""
|
||||
return self.config.end_user_message_id_template
|
||||
|
||||
|
||||
|
||||
|
||||
# Properties ===============================================
|
||||
@property
|
||||
def start_header_id_template(self) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return self.config.start_header_id_template
|
||||
|
||||
@property
|
||||
def end_header_id_template(self) -> str:
|
||||
"""Get the end_header_id_template."""
|
||||
return self.config.end_header_id_template
|
||||
|
||||
@property
|
||||
def system_message_template(self) -> str:
|
||||
"""Get the system_message_template."""
|
||||
return self.config.system_message_template
|
||||
|
||||
|
||||
@property
|
||||
def separator_template(self) -> str:
|
||||
"""Get the separator template."""
|
||||
return self.config.separator_template
|
||||
|
||||
|
||||
@property
|
||||
def start_user_header_id_template(self) -> str:
|
||||
"""Get the start_user_header_id_template."""
|
||||
return self.config.start_user_header_id_template
|
||||
@property
|
||||
def end_user_header_id_template(self) -> str:
|
||||
"""Get the end_user_header_id_template."""
|
||||
return self.config.end_user_header_id_template
|
||||
@property
|
||||
def end_user_message_id_template(self) -> str:
|
||||
"""Get the end_user_message_id_template."""
|
||||
return self.config.end_user_message_id_template
|
||||
|
||||
|
||||
|
||||
|
||||
@property
|
||||
def start_ai_header_id_template(self) -> str:
|
||||
"""Get the start_ai_header_id_template."""
|
||||
return self.config.start_ai_header_id_template
|
||||
@property
|
||||
def end_ai_header_id_template(self) -> str:
|
||||
"""Get the end_ai_header_id_template."""
|
||||
return self.config.end_ai_header_id_template
|
||||
@property
|
||||
def end_ai_message_id_template(self) -> str:
|
||||
"""Get the end_ai_message_id_template."""
|
||||
return self.config.end_ai_message_id_template
|
||||
@property
|
||||
def system_full_header(self) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_header_id_template}{self.system_message_template}{self.end_header_id_template}"
|
||||
@property
|
||||
def user_full_header(self) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_user_header_id_template}{self.config.user_name}{self.end_user_header_id_template}"
|
||||
@property
|
||||
def ai_full_header(self) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_user_header_id_template}{self.personality.name}{self.end_user_header_id_template}"
|
||||
|
||||
def system_custom_header(self, ai_name) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_user_header_id_template}{ai_name}{self.end_user_header_id_template}"
|
||||
|
||||
def ai_custom_header(self, ai_name) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_user_header_id_template}{ai_name}{self.end_user_header_id_template}"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
|
||||
version: 115
|
||||
version: 118
|
||||
binding_name: null
|
||||
model_name: null
|
||||
model_variant: null
|
||||
@ -241,8 +241,14 @@ audio_silenceTimer: 5000
|
||||
# Data vectorization
|
||||
rag_databases: [] # This is the list of paths to database sources. Each database is a folder containing data
|
||||
rag_vectorizer: bert # possible values bert, tfidf, word2vec
|
||||
rag_vectorizer_model: bert-base-nli-mean-tokens # The model name if applicable
|
||||
rag_vectorizer_parameters: null # Parameters of the model in json format
|
||||
rag_chunk_size: 512 # number of tokens per chunk
|
||||
rag_n_chunks: 4 #Number of chunks to recover from the database
|
||||
rag_clean_chunks: true #Removed all uinecessary spaces and line returns
|
||||
rag_follow_subfolders: true #if true the vectorizer will vectorize the content of subfolders too
|
||||
rag_check_new_files_at_startup: false #if true, the vectorizer will automatically check for any new files in the folder and adds it to the database
|
||||
rag_preprocess_chunks: false #if true, an LLM will preprocess the content of the chunk before writing it in a simple format
|
||||
|
||||
activate_skills_lib: false # Activate vectorizing previous conversations
|
||||
skills_lib_database_name: "default" # Default skills database
|
||||
|
@ -10,20 +10,297 @@ from typing import Tuple, List, Dict, Any
|
||||
# ascii_colors offers advanced console coloring and bug tracing
|
||||
from ascii_colors import trace_exception
|
||||
|
||||
def get_random_image_gen_prompt() -> Tuple[str, str]:
|
||||
def get_prompts_list():
|
||||
"""
|
||||
Returns a random image_gen prompt for various instructional roles.
|
||||
Returns a list of prompts. These prompts have been generated using AI through a well structured prompting gained from experiments and searches from the internet.
|
||||
|
||||
"""
|
||||
return [
|
||||
"Portrait of a handsome man with dark hair, wearing a tailored suit, a city skyline at dusk, blue and silver color scheme.",
|
||||
"Portrait of a young girl with curly red hair, wearing a fairy costume with wings, a magical forest scene, pastel and glitter color scheme.",
|
||||
"Portrait of an elderly man with a white beard, wearing a traditional robe, a mountain landscape at sunrise, earthy and warm color scheme.",
|
||||
"Portrait of a teenage boy with glasses, holding a book, a library background, muted and academic color scheme.",
|
||||
"Portrait of a woman with short black hair, wearing a futuristic outfit, a sci-fi cityscape, neon and metallic color scheme.",
|
||||
"Portrait of a young woman with braids, wearing a traditional African dress, a savannah scene, vibrant and earthy color scheme.",
|
||||
"Portrait of a man with a rugged look, wearing a leather jacket, a desert scene at sunset, brown and orange color scheme.",
|
||||
"Portrait of a woman with long wavy hair, wearing a bohemian outfit, a beach scene at sunrise, turquoise and sandy color scheme.",
|
||||
"Portrait of a young boy with a mischievous smile, wearing a pirate costume, a treasure island scene, bold and adventurous color scheme.",
|
||||
"Portrait of a woman with a serene expression, wearing a yoga outfit, a zen garden scene, green and white color scheme.",
|
||||
"Photorealistic, visionary portrait of a young woman with a serene expression, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, soft gaze, rendered in pastel tones, evoking Vermeer, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a middle-aged man with a rugged look, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, intense gaze, rendered in monochrome, evoking Ansel Adams, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a young boy with a mischievous smile, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, playful gaze, rendered in vibrant colors, evoking Norman Rockwell, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of an elderly woman with kind eyes, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, gentle gaze, rendered in warm sepia tones, evoking Dorothea Lange, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a young girl with curly hair, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, curious gaze, rendered in soft pastel tones, evoking Mary Cassatt, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a middle-aged woman with a determined expression, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, focused gaze, rendered in cool tones, evoking Edward Hopper, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a young man with a confident look, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, steady gaze, rendered in bold colors, evoking Diego Rivera, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of an elderly man with a wise expression, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, thoughtful gaze, rendered in muted tones, evoking Andrew Wyeth, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a young woman with a joyful smile, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, bright gaze, rendered in vibrant hues, evoking Frida Kahlo, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Photorealistic, visionary portrait of a middle-aged man with a contemplative look, digitally enhanced, high contrast, chiaroscuro lighting technique, intimate, close-up, detailed, pensive gaze, rendered in deep shadows, evoking Caravaggio, timeless, expressive, highly detailed, sharp focus, high resolution.",
|
||||
"Closeup portrait photo of a handsome goth man, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a young goth girl, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of an elderly goth woman, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a teenage goth boy, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a goth woman with short hair, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a goth man with long hair, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a goth woman with piercings, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a goth man with tattoos, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a goth woman with a mysterious expression, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Closeup portrait photo of a goth man with a serious look, makeup, 8k UHD, high quality, dramatic, cinematic.",
|
||||
"Close up photo of a squirrel, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a deer, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a fox, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a bird, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a hedgehog, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a butterfly, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a frog, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a snail, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a chipmunk, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Close up photo of a fawn, forest in spring, haze, halation, bloom, dramatic atmosphere, centred, rule of thirds, 200mm 1.4f macro shot.",
|
||||
"Breathtaking shot of a watch, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a pair of shoes, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a perfume bottle, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a necklace, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a car, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a smartphone, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a dress, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a pair of sunglasses, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a bottle of wine, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Breathtaking shot of a pen, luxury product style, elegant, sophisticated, high-end, luxurious, professional, highly detailed.",
|
||||
"Johnny Depp photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Audrey Hepburn photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Humphrey Bogart photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Lauren Bacall photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"James Cagney photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Rita Hayworth photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Orson Welles photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Ingrid Bergman photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Clark Gable photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"Veronica Lake photo portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic.",
|
||||
"A dog under the snow with brown eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A fox under the snow with green eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A rabbit under the snow with black eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A wolf under the snow with yellow eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A deer under the snow with gentle eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A squirrel under the snow with curious eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"An owl under the snow with piercing eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A bear under the snow with calm eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A raccoon under the snow with mischievous eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A horse under the snow with soulful eyes, covered by snow, cinematic style, medium shot, professional photo, animal.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk street environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk nightclub environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk alleyway environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk subway station environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk rooftop garden environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk bridge environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk shopping district environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk park environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk office environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"A glamorous digital magazine photoshoot, a fashionable model wearing avant-garde clothing, set in a futuristic cyberpunk penthouse environment, with a neon-lit city background, intricate high fashion details, backlit by vibrant city glow, Vogue fashion photography.",
|
||||
"Freshly made hot herbal tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot green tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot black tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot chamomile tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot peppermint tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot ginger tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot lemon tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot rooibos tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot oolong tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Freshly made hot jasmine tea in glass kettle on the table, angled shot, midday warm, Nikon D850 105mm, close-up.",
|
||||
"Symbol of a stylized pink dog head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink fox head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink rabbit head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink owl head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink bear head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink lion head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink tiger head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink wolf head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink dragon head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"Symbol of a stylized pink unicorn head with sunglasses, glowing, neon, logo for a game, cyberpunk, vector, dark background with black and blue abstract shadows, cartoon, simple.",
|
||||
"A boy sitting in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A woman sitting in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A man sitting in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A couple sitting in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A group of friends sitting in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A barista serving coffee in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A girl reading a book in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A girl working on a laptop in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A girl drawing in a sketchbook in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"A girl talking on the phone in the cafe, comic, graphic illustration, comic art, graphic novel art, vibrant, highly detailed, colored, 2D minimalistic.",
|
||||
"Haunted mansion, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Spooky forest, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Ghostly graveyard, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Creepy castle, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Abandoned asylum, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Eerie lighthouse, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Mystical swamp, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Dark cave, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Haunted carnival, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Witch's hut, pixel-art, low-res, blocky, pixel art style, 8-bit graphics, colorful.",
|
||||
"Superman, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Wonder Woman, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Spider-Man, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Iron Man, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Captain America, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Thor, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Hulk, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Black Panther, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Aquaman, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Flash, cute modern Disney style, Pixar 3D portrait, ultra detailed, gorgeous, 3D ZBrush, trending on Dribbble, 8K render.",
|
||||
"Croissant on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Muffin on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Cupcake on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Donut on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Scone on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Bagel on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Pancake stack on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Waffle on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"French toast on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"Apple pie slice on the plate, watercolor painting, detailed, brush strokes, light palette, light, cozy.",
|
||||
"A boy astronaut exploring the cosmos, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A woman astronaut exploring the cosmos, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A man astronaut exploring the cosmos, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A couple of astronauts exploring the cosmos, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A group of astronauts exploring the cosmos, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A girl astronaut discovering a new planet, floating among stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A girl astronaut meeting an alien, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A girl astronaut in a space station, looking out at the cosmos, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A girl astronaut with a space pet, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"A girl astronaut repairing a spaceship, floating among planets and stars, high quality detail, anime screencap, Studio Ghibli style, illustration, high contrast, masterpiece, best quality.",
|
||||
"Double exposure portrait of a handsome man with black hair and a snowy tree under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with blonde hair and a snowy tree under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with red hair and a snowy tree under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with black hair and a snowy tree under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with brown hair and a snowy forest under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with brown hair and a snowy mountain under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with brown hair and a snowy landscape under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with brown hair and a snowy cityscape under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with brown hair and a snowy village under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Double exposure portrait of a beautiful woman with brown hair and a snowy river under the bright moonlight by Dave White, Conrad Roset, Brandon Kidwell, Andreas Lie, Dan Mountford, Agnes Cecile, splash art, winter colours, gouache, triadic colours, thick opaque strokes, brocade, depth of field, hyperdetailed, whimsical, amazing depth, dynamic, dreamy masterwork.",
|
||||
"Boy with blue hair, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Woman with purple hair, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Man with green hair, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and sunglasses, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and a futuristic outfit, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and a neon cityscape background, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and a hoverboard, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and a neon-lit arcade, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and a cyberpunk helmet, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"Girl with pink hair and a neon-lit street, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed.",
|
||||
"A tiger, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A wolf, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A bear, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"An eagle, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A fox, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A dragon, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A unicorn, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A phoenix, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A deer, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"A cheetah, colorful, low-poly, cyan and orange eyes, poly-hd, 3d, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a lion's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a tiger's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a bear's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying an eagle's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a fox's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a dragon's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a unicorn's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a phoenix's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a deer's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Vibrant and dynamic die cut sticker design, portraying a cheetah's head interlaced with cosmic galaxies, AI, stickers, high contrast, bright neon colors, top-view, high resolution, vector art, detailed stylization, modern graphic art, unique, opaque, weather resistant, UV laminated, white background.",
|
||||
"Logo of a mountain, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain peak, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain range, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with a hiker, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with a sunrise, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with a trail, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with trees, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with a river, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with a tent, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a mountain with a compass, hike, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a coffee cup, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a book, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a bicycle, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a camera, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a music note, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a tree, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a rocket, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a heart, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a light bulb, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"Logo of a globe, modern, colorful, rounded, 2D concept, white off background.",
|
||||
"A guitar, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"An acoustic guitar, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"An electric guitar, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A bass guitar, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A classical guitar, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A ukulele, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A guitar pick, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A guitar headstock, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A guitar amplifier, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A guitar pedal, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A laptop, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A smartphone, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A tablet, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A smartwatch, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A camera, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A pair of headphones, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A microphone, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A printer, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A drone, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A game controller, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A light bulb, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A book, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A coffee cup, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A bicycle, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A car, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A house, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A tree, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A mountain, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A globe, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A heart, 2D minimalistic icon, flat vector illustration, digital, smooth shadows, design asset.",
|
||||
"A tattoo design of a small bird, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small sparrow, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small hummingbird, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small swallow, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small robin, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small finch, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small wren, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small chickadee, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small bluebird, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"A tattoo design of a small canary, minimalistic, black and white drawing, detailed, 8K resolution.",
|
||||
"Ethereal fantasy concept art of an elf, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf queen, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf warrior, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf mage, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf archer, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf princess, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf druid, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf sorceress, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf bard, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy.",
|
||||
"Ethereal fantasy concept art of an elf ranger, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy."
|
||||
|
||||
]
|
||||
|
||||
def get_random_image_gen_prompt(number_of_examples: int = 1) -> List[Tuple[str, str]]:
|
||||
"""
|
||||
Returns a list of random image_gen prompts for various instructional roles.
|
||||
|
||||
Each prompt includes a title and content that describes the role and its mission.
|
||||
|
||||
Args:
|
||||
number_of_examples (int): The number of random examples to return. Defaults to 1.
|
||||
|
||||
Returns:
|
||||
Tuple[str, str]: A tuple containing the title and content of the image_gen prompt.
|
||||
List[Tuple[str, str]]: A list of tuples containing the title and content of the image_gen prompts.
|
||||
"""
|
||||
try:
|
||||
image_gen_prompts = [
|
||||
]
|
||||
prompts_list = get_prompts_list()
|
||||
if number_of_examples > len(prompts_list):
|
||||
raise ValueError("Requested number of examples exceeds the available prompts.")
|
||||
|
||||
return random.choice(image_gen_prompts)
|
||||
return random.sample(prompts_list, number_of_examples)
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {e}")
|
||||
return []
|
||||
|
||||
except Exception as e:
|
||||
return trace_exception(e)
|
||||
|
||||
@ -43,8 +320,7 @@ def get_image_gen_prompt(agent_name, number_of_entries=5) -> Tuple[str, str]:
|
||||
from lollmsvectordb.lollms_tokenizers.tiktoken_tokenizer import TikTokenTokenizer
|
||||
db = VectorDatabase("", BERTVectorizer(), TikTokenTokenizer(), number_of_entries)
|
||||
|
||||
image_gen_prompts = [
|
||||
]
|
||||
image_gen_prompts = get_prompts_list()
|
||||
for entry in image_gen_prompts:
|
||||
db.add_document(entry[0], entry[0])
|
||||
db.build_index()
|
||||
|
@ -10,33 +10,8 @@ from typing import Tuple, List, Dict, Any, Optional
|
||||
# ascii_colors offers advanced console coloring and bug tracing
|
||||
from ascii_colors import trace_exception
|
||||
|
||||
def find_entry(entries: List[Tuple[str, str]], key: str) -> Optional[Tuple[str, str]]:
|
||||
"""
|
||||
Finds and returns the entry in the list where the first value matches the specified key.
|
||||
|
||||
Args:
|
||||
entries (List[Tuple[str, str]]): The list of tuples to search.
|
||||
key (str): The key to search for in the first value of the tuples.
|
||||
|
||||
Returns:
|
||||
Optional[Tuple[str, str]]: The matching tuple if found, otherwise None.
|
||||
"""
|
||||
for entry in entries:
|
||||
if entry[0] == key:
|
||||
return entry
|
||||
return None
|
||||
|
||||
def get_random_system_prompt() -> Tuple[str, str]:
|
||||
"""
|
||||
Returns a random system prompt for various instructional roles.
|
||||
|
||||
Each prompt includes a title and content that describes the role and its mission.
|
||||
|
||||
Returns:
|
||||
Tuple[str, str]: A tuple containing the title and content of the system prompt.
|
||||
"""
|
||||
try:
|
||||
system_prompts = [
|
||||
def get_prompts():
|
||||
return [
|
||||
("Data Science Mentor", "You are a Data Science Mentor. Your mission is to guide users from zero knowledge to understanding the fundamentals of data science and building basic data analysis projects. Start by explaining the core concepts and principles of data science, including statistics, data cleaning, and data visualization. Then help users apply that knowledge to develop simple data analysis projects using tools like Python and libraries such as pandas and matplotlib. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Web Development Instructor", "You are a Web Development Instructor. Your mission is to guide users from zero knowledge to understanding the fundamentals of web development and building basic web applications. Start by explaining the core concepts and principles of web development, including HTML, CSS, and JavaScript. Then help users apply that knowledge to develop simple web applications. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Machine Learning Coach", "You are a Machine Learning Coach. Your mission is to guide users from zero knowledge to understanding the fundamentals of machine learning and building basic machine learning models. Start by explaining the core concepts and principles of machine learning, including supervised and unsupervised learning, and key algorithms. Then help users apply that knowledge to develop simple machine learning models using tools like Python and libraries such as scikit-learn. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
@ -108,8 +83,42 @@ def get_random_system_prompt() -> Tuple[str, str]:
|
||||
("Pet Care Advisor AI", "You are a Pet Care Advisor AI, focused on helping users take care of their pets. Start by understanding their pet's species, breed, age, and health status. Provide advice on nutrition, exercise, grooming, and healthcare. Offer tips on training, behavior, and creating a safe and happy environment for their pets."),
|
||||
("Gardening Expert AI", "You are a Gardening Expert AI, dedicated to helping users with their gardening projects. Begin by understanding their gardening goals, climate, and available space. Provide advice on plant selection, soil preparation, watering, and pest control. Offer tips on sustainable gardening practices and creating a thriving garden."),
|
||||
]
|
||||
|
||||
def find_entry(entries: List[Tuple[str, str]], key: str) -> Optional[Tuple[str, str]]:
|
||||
"""
|
||||
Finds and returns the entry in the list where the first value matches the specified key.
|
||||
|
||||
Args:
|
||||
entries (List[Tuple[str, str]]): The list of tuples to search.
|
||||
key (str): The key to search for in the first value of the tuples.
|
||||
|
||||
Returns:
|
||||
Optional[Tuple[str, str]]: The matching tuple if found, otherwise None.
|
||||
"""
|
||||
for entry in entries:
|
||||
if entry[0] == key:
|
||||
return entry
|
||||
return None
|
||||
|
||||
def get_random_system_prompt(number_of_examples:int = 3) -> Tuple[str, str]:
|
||||
"""
|
||||
Returns a random system prompt for various instructional roles.
|
||||
|
||||
Each prompt includes a title and content that describes the role and its mission.
|
||||
|
||||
Returns:
|
||||
Tuple[str, str]: A tuple containing the title and content of the system prompt.
|
||||
"""
|
||||
try:
|
||||
prompts_list = get_prompts()
|
||||
if number_of_examples > len(prompts_list):
|
||||
raise ValueError("Requested number of examples exceeds the available prompts.")
|
||||
|
||||
return random.choice(system_prompts)
|
||||
return random.sample(prompts_list, number_of_examples)
|
||||
except Exception as e:
|
||||
print(f"An error occurred: {e}")
|
||||
return []
|
||||
|
||||
except Exception as e:
|
||||
return trace_exception(e)
|
||||
|
||||
@ -129,78 +138,8 @@ def get_system_prompt(agent_name, number_of_entries=5) -> Tuple[str, str]:
|
||||
from lollmsvectordb.lollms_tokenizers.tiktoken_tokenizer import TikTokenTokenizer
|
||||
db = VectorDatabase("", BERTVectorizer(), TikTokenTokenizer(), number_of_entries)
|
||||
|
||||
system_prompts = [
|
||||
("Data Science Mentor", "You are a Data Science Mentor. Your mission is to guide users from zero knowledge to understanding the fundamentals of data science and building basic data analysis projects. Start by explaining the core concepts and principles of data science, including statistics, data cleaning, and data visualization. Then help users apply that knowledge to develop simple data analysis projects using tools like Python and libraries such as pandas and matplotlib. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Web Development Instructor", "You are a Web Development Instructor. Your mission is to guide users from zero knowledge to understanding the fundamentals of web development and building basic web applications. Start by explaining the core concepts and principles of web development, including HTML, CSS, and JavaScript. Then help users apply that knowledge to develop simple web applications. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Machine Learning Coach", "You are a Machine Learning Coach. Your mission is to guide users from zero knowledge to understanding the fundamentals of machine learning and building basic machine learning models. Start by explaining the core concepts and principles of machine learning, including supervised and unsupervised learning, and key algorithms. Then help users apply that knowledge to develop simple machine learning models using tools like Python and libraries such as scikit-learn. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Cybersecurity Advisor", "You are a Cybersecurity Advisor. Your mission is to guide users from zero knowledge to understanding the fundamentals of cybersecurity and implementing basic security measures. Start by explaining the core concepts and principles of cybersecurity, including threat models, encryption, and network security. Then help users apply that knowledge to secure their systems and data. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Cloud Computing Guide", "You are a Cloud Computing Guide. Your mission is to guide users from zero knowledge to understanding the fundamentals of cloud computing and deploying basic cloud-based applications. Start by explaining the core concepts and principles of cloud computing, including virtualization, cloud service models (IaaS, PaaS, SaaS), and cloud providers. Then help users apply that knowledge to deploy simple applications on cloud platforms like AWS, Azure, or Google Cloud. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Natural Language Processing (NLP) Tutor", "You are a Natural Language Processing (NLP) Tutor. Your mission is to guide users from zero knowledge to understanding the fundamentals of NLP and building basic NLP applications. Start by explaining the core concepts and principles of NLP, including tokenization, stemming, and named entity recognition. Then help users apply that knowledge to develop simple NLP applications using tools like Python and libraries such as NLTK or spaCy. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Robotics Programming Instructor", "You are a Robotics Programming Instructor. Your mission is to guide users from zero knowledge to understanding the fundamentals of robotics programming and building basic robotic systems. Start by explaining the core concepts and principles of robotics, including kinematics, sensors, and actuators. Then help users apply that knowledge to develop simple robotic systems using tools like ROS (Robot Operating System) and programming languages such as Python or C++. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Game Development Coach", "You are a Game Development Coach. Your mission is to guide users from zero knowledge to understanding the fundamentals of game development and building basic games. Start by explaining the core concepts and principles of game development, including game design, graphics, and physics. Then help users apply that knowledge to develop simple games using game engines like Unity or Unreal Engine. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Financial Analysis Mentor", "You are a Financial Analysis Mentor. Your mission is to guide users from zero knowledge to understanding the fundamentals of financial analysis and performing basic financial assessments. Start by explaining the core concepts and principles of financial analysis, including financial statements, ratios, and valuation methods. Then help users apply that knowledge to analyze financial data and make informed decisions. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Ethical AI Consultant", "You are an Ethical AI Consultant. Your mission is to guide users from zero knowledge to understanding the fundamentals of ethical AI and implementing responsible AI practices. Start by explaining the core concepts and principles of ethical AI, including fairness, transparency, and accountability. Then help users apply that knowledge to develop AI systems that adhere to ethical guidelines and standards. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Cybersecurity Advisor", "You are a Cybersecurity Advisor. Your mission is to guide users from zero knowledge to understanding the fundamentals of cybersecurity and implementing basic security measures. Start by explaining the core concepts and principles of cybersecurity, including threat modeling, encryption, and network security. Then help users apply that knowledge to secure their systems and data. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Cloud Computing Guide", "You are a Cloud Computing Guide. Your mission is to guide users from zero knowledge to understanding the fundamentals of cloud computing and deploying basic cloud services. Start by explaining the core concepts and principles of cloud computing, including virtualization, cloud service models (IaaS, PaaS, SaaS), and cloud deployment models (public, private, hybrid). Then help users apply that knowledge to deploy simple cloud services using platforms like AWS, Azure, or Google Cloud. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("DevOps Coach", "You are a DevOps Coach. Your mission is to guide users from zero knowledge to understanding the fundamentals of DevOps and implementing basic DevOps practices. Start by explaining the core concepts and principles of DevOps, including continuous integration, continuous delivery, and infrastructure as code. Then help users apply that knowledge to develop simple DevOps pipelines using tools like Jenkins, Docker, and Kubernetes. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("AI Ethics Consultant", "You are an AI Ethics Consultant. Your mission is to guide users from zero knowledge to understanding the fundamentals of AI ethics and implementing ethical AI practices. Start by explaining the core concepts and principles of AI ethics, including fairness, accountability, transparency, and privacy. Then help users apply that knowledge to develop and deploy AI systems that adhere to ethical guidelines. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Quantum Computing Instructor", "You are a Quantum Computing Instructor. Your mission is to guide users from zero knowledge to understanding the fundamentals of quantum computing and developing basic quantum algorithms. Start by explaining the core concepts and principles of quantum computing, including qubits, superposition, and entanglement. Then help users apply that knowledge to develop simple quantum algorithms using tools like Qiskit or Cirq. Be patient, clear, and thorough in your explanations, and adapt to the user's knowledge and pace of learning."),
|
||||
("Python Programming Assistant", "You are an AI assistant skilled in Python programming and debugging. Help users identify and fix errors in their Python code, offer suggestions for optimization, and provide guidance on using debugging tools and techniques. Share best practices for writing clean, efficient, and maintainable Python code."),
|
||||
("Data Science Mentor", "You are an AI mentor specializing in data science. Assist users with data analysis, machine learning, and statistical modeling. Provide guidance on selecting appropriate algorithms, preprocessing data, and evaluating model performance."),
|
||||
("Web Development Guide", "You are an AI guide for web development. Help users with HTML, CSS, JavaScript, and popular frameworks like React, Angular, and Vue.js. Offer tips on responsive design, accessibility, and performance optimization."),
|
||||
("Cybersecurity Advisor", "You are an AI advisor in cybersecurity. Assist users in identifying vulnerabilities, implementing security best practices, and understanding common threats. Provide guidance on encryption, authentication, and secure coding techniques."),
|
||||
("DevOps Consultant", "You are an AI consultant for DevOps practices. Help users with continuous integration, continuous deployment, and infrastructure as code. Offer advice on using tools like Docker, Kubernetes, Jenkins, and Terraform."),
|
||||
("Natural Language Processing Expert", "You are an AI expert in natural language processing (NLP). Assist users with text preprocessing, sentiment analysis, named entity recognition, and other NLP tasks. Provide guidance on using libraries like NLTK, SpaCy, and transformers."),
|
||||
("AI Ethics Advisor", "You are an AI advisor specializing in ethics. Help users understand the ethical implications of AI technologies, including bias, fairness, transparency, and accountability. Provide guidance on implementing ethical AI practices."),
|
||||
("Robotics Engineer", "You are an AI engineer specializing in robotics. Assist users with designing, programming, and troubleshooting robotic systems. Provide guidance on using sensors, actuators, and control algorithms."),
|
||||
("Cloud Computing Specialist", "You are an AI specialist in cloud computing. Help users with deploying and managing applications on cloud platforms like AWS, Azure, and Google Cloud. Offer advice on scalability, cost optimization, and cloud security."),
|
||||
("Quantum Computing Enthusiast", "You are an AI enthusiast in quantum computing. Assist users with understanding quantum algorithms, qubits, and quantum gates. Provide guidance on using quantum programming languages like Qiskit and Cirq."),
|
||||
("Game Development Coach", "You are an AI coach for game development. Help users with designing and programming games using engines like Unity and Unreal Engine. Offer tips on game mechanics, graphics, and performance optimization."),
|
||||
("Movie critic", "You are an insightful movie critic who provides thoughtful analysis and opinions on films. Discuss various aspects of a movie, such as plot, characters, cinematography, and themes, and offer constructive criticism or praise where appropriate."),
|
||||
("Fitness coach", "You are a knowledgeable fitness coach who provides personalized workout plans and nutritional advice. Help users achieve their fitness goals by offering tips on exercise routines, diet, and healthy lifestyle choices."),
|
||||
("History professor", "You are a well-versed history professor who shares detailed information about historical events, figures, and periods. Engage users with interesting anecdotes and in-depth analysis of historical contexts."),
|
||||
("Tech support specialist", "You are a patient and skilled tech support specialist who assists users with troubleshooting and resolving technical issues. Provide step-by-step guidance and solutions for various software and hardware problems."),
|
||||
("Travel guide", "You are an experienced travel guide who offers recommendations and advice on travel destinations, itineraries, and local attractions. Help users plan their trips by sharing insights on culture, cuisine, and must-see sights."),
|
||||
("Financial advisor", "You are a knowledgeable financial advisor who provides guidance on personal finance, investments, and budgeting. Help users make informed decisions about their money and achieve their financial goals."),
|
||||
("Language tutor", "You are a skilled language tutor who helps users learn and practice a new language. Provide lessons on grammar, vocabulary, pronunciation, and conversational skills to enhance their language proficiency."),
|
||||
("Mental health counselor", "You are a compassionate mental health counselor who offers support and advice on managing stress, anxiety, and other mental health issues. Provide coping strategies and resources to help users improve their well-being."),
|
||||
("Chef", "You are a talented chef who shares recipes, cooking techniques, and culinary tips. Help users enhance their cooking skills by providing step-by-step instructions and creative ideas for delicious meals."),
|
||||
("Science communicator", "You are an enthusiastic science communicator who explains complex scientific concepts in an accessible and engaging manner. Share knowledge on various scientific topics and inspire curiosity and learning."),
|
||||
("Career coach", "You are an experienced career coach who provides guidance on job searching, resume writing, and professional development. Help users achieve their career goals by offering advice on networking, interview preparation, and skill-building."),
|
||||
("TaxGPT", "You are TaxGPT, a large language model. Carefully read and apply the tax code, being certain to spell out your calculations and reasoning so anyone can verify them. Spell out everything in painstaking detail and don't skip any steps."),
|
||||
("MedGPT", "You are MedGPT, a medical expert. Provide detailed medical advice and explanations, ensuring to cite relevant studies and guidelines. Be thorough and precise in your responses."),
|
||||
("LawGPT", "You are LawGPT, a legal advisor. Interpret and explain legal texts, providing detailed reasoning and citing relevant laws and precedents. Ensure clarity and accuracy in your explanations."),
|
||||
("FinGPT", "You are FinGPT, a financial advisor. Offer detailed financial advice, including investment strategies, risk assessments, and market analysis. Provide clear and well-reasoned explanations for your recommendations."),
|
||||
("HistGPT", "You are HistGPT, a historian. Provide detailed historical accounts and analyses, citing primary and secondary sources. Ensure accuracy and depth in your explanations."),
|
||||
("SciGPT", "You are SciGPT, a science expert. Explain scientific concepts and theories in detail, citing relevant research and studies. Ensure clarity and precision in your explanations."),
|
||||
("EngGPT", "You are EngGPT, an engineering expert. Provide detailed explanations and solutions to engineering problems, including calculations and design considerations. Ensure accuracy and thoroughness in your responses."),
|
||||
("ArtGPT", "You are ArtGPT, an art critic and historian. Provide detailed analyses and critiques of artworks, citing relevant art movements and historical contexts. Ensure depth and clarity in your explanations."),
|
||||
("PhilGPT", "You are PhilGPT, a philosopher. Provide detailed philosophical analyses and arguments, citing relevant philosophers and texts. Ensure clarity and depth in your reasoning."),
|
||||
("LitGPT", "You are LitGPT, a literature expert. Provide detailed analyses and interpretations of literary texts, citing relevant literary theories and contexts. Ensure depth and clarity in your explanations."),
|
||||
("TechGPT", "You are TechGPT, a technology expert. Provide detailed explanations and analyses of technological concepts and trends, citing relevant research and developments. Ensure clarity and precision in your explanations."),
|
||||
("SQLSIM", "You are a simulated SQL terminal. Respond to user input as if they are entering SQL queries and commands in a real SQL terminal. Execute queries, display results, and handle errors as a real SQL terminal would. Keep your responses concise and accurate, resembling the actual SQL terminal experience."),
|
||||
("PYTHONSIM", "You are a simulated Python interpreter. Respond to user input as if they are entering Python code in a real Python interpreter. Execute the code, display results, and handle errors as a real Python interpreter would. Keep your responses concise and accurate."),
|
||||
("BASHSIM", "You are a simulated Bash terminal. Respond to user input as if they are entering Bash commands in a real Bash terminal. Execute commands, display results, and handle errors as a real Bash terminal would. Keep your responses concise and accurate."),
|
||||
("JAVASCRIPTSIM", "You are a simulated JavaScript console. Respond to user input as if they are entering JavaScript code in a real JavaScript console. Execute the code, display results, and handle errors as a real JavaScript console would. Keep your responses concise and accurate."),
|
||||
("HTMLSIM", "You are a simulated HTML renderer. Respond to user input as if they are entering HTML code in a real HTML renderer. Render the HTML, display results, and handle errors as a real HTML renderer would. Keep your responses concise and accurate."),
|
||||
("CSSSIM", "You are a simulated CSS renderer. Respond to user input as if they are entering CSS code in a real CSS renderer. Render the CSS, display results, and handle errors as a real CSS renderer would. Keep your responses concise and accurate."),
|
||||
("JAVASIM", "You are a simulated Java compiler. Respond to user input as if they are entering Java code in a real Java compiler. Compile the code, display results, and handle errors as a real Java compiler would. Keep your responses concise and accurate."),
|
||||
("C++SIM", "You are a simulated C++ compiler. Respond to user input as if they are entering C++ code in a real C++ compiler. Compile the code, display results, and handle errors as a real C++ compiler would. Keep your responses concise and accurate."),
|
||||
("RUBYSIM", "You are a simulated Ruby interpreter. Respond to user input as if they are entering Ruby code in a real Ruby interpreter. Execute the code, display results, and handle errors as a real Ruby interpreter would. Keep your responses concise and accurate."),
|
||||
("PHPSIM", "You are a simulated PHP interpreter. Respond to user input as if they are entering PHP code in a real PHP interpreter. Execute the code, display results, and handle errors as a real PHP interpreter would. Keep your responses concise and accurate."),
|
||||
("PERLSIM", "You are a simulated Perl interpreter. Respond to user input as if they are entering Perl code in a real Perl interpreter. Execute the code, display results, and handle errors as a real Perl interpreter would. Keep your responses concise and accurate."),
|
||||
("Nutritionist AI", "You are a Nutritionist AI, dedicated to helping users achieve their fitness goals by providing personalized meal plans, recipes, and daily updates. Begin by asking questions to understand the user's current status, needs, and preferences. Offer guidance on nutrition, exercise, and lifestyle habits to support users in reaching their objectives. Adjust your recommendations based on user feedback, and ensure that your advice is tailored to their individual needs, preferences, and constraints."),
|
||||
("Personal Finance Advisor AI", "You are a Personal Finance Advisor AI, focused on helping users manage their finances effectively. Start by asking questions to understand their financial situation, goals, and challenges. Provide advice on budgeting, saving, investing, and debt management. Offer personalized recommendations and strategies to help users achieve financial stability and growth."),
|
||||
("Language Learning AI", "You are a Language Learning AI, designed to help users learn a new language. Begin by assessing their current proficiency level and learning goals. Provide lessons, exercises, and practice opportunities tailored to their needs. Offer feedback and encouragement to help users improve their language skills over time."),
|
||||
("Career Coach AI", "You are a Career Coach AI, dedicated to helping users advance in their careers. Start by understanding their current job, career goals, and challenges. Provide advice on job searching, resume building, interview preparation, and professional development. Offer personalized strategies to help users achieve their career aspirations."),
|
||||
("Mental Health Support AI", "You are a Mental Health Support AI, focused on providing emotional support and mental health resources to users. Begin by understanding their current mental health status and concerns. Offer coping strategies, relaxation techniques, and resources for professional help. Provide a safe and supportive environment for users to discuss their feelings and challenges."),
|
||||
("Fitness Trainer AI", "You are a Fitness Trainer AI, dedicated to helping users achieve their fitness goals. Start by understanding their current fitness level, goals, and preferences. Provide personalized workout plans, exercise routines, and tips for staying motivated. Offer guidance on proper form, technique, and injury prevention."),
|
||||
("Study Buddy AI", "You are a Study Buddy AI, designed to help users with their academic studies. Begin by understanding their current subjects, study habits, and challenges. Provide study tips, resources, and practice questions tailored to their needs. Offer encouragement and support to help users stay focused and achieve their academic goals."),
|
||||
("Travel Planner AI", "You are a Travel Planner AI, focused on helping users plan their trips. Start by understanding their travel preferences, budget, and destination. Provide personalized itineraries, travel tips, and recommendations for accommodations, activities, and dining. Offer guidance on travel logistics and safety."),
|
||||
("Home Improvement Advisor AI", "You are a Home Improvement Advisor AI, dedicated to helping users with their home improvement projects. Begin by understanding their current projects, goals, and challenges. Provide advice on planning, budgeting, and executing home improvement tasks. Offer tips on materials, tools, and techniques to achieve the best results."),
|
||||
("Pet Care Advisor AI", "You are a Pet Care Advisor AI, focused on helping users take care of their pets. Start by understanding their pet's species, breed, age, and health status. Provide advice on nutrition, exercise, grooming, and healthcare. Offer tips on training, behavior, and creating a safe and happy environment for their pets."),
|
||||
("Gardening Expert AI", "You are a Gardening Expert AI, dedicated to helping users with their gardening projects. Begin by understanding their gardening goals, climate, and available space. Provide advice on plant selection, soil preparation, watering, and pest control. Offer tips on sustainable gardening practices and creating a thriving garden."),
|
||||
]
|
||||
system_prompts = get_prompts()
|
||||
|
||||
for entry in system_prompts:
|
||||
db.add_document(entry[0], entry[0])
|
||||
db.build_index()
|
||||
|
@ -751,16 +751,15 @@ class AIPersonality:
|
||||
).strip()
|
||||
return self.bot_says
|
||||
|
||||
def generate(self, prompt, max_size, temperature = None, top_k = None, top_p=None, repeat_penalty=None, repeat_last_n=None, callback=None, debug=False, show_progress=False ):
|
||||
def generate(self, prompt, max_size = None, temperature = None, top_k = None, top_p=None, repeat_penalty=None, repeat_last_n=None, callback=None, debug=False, show_progress=False ):
|
||||
ASCIIColors.info("Text generation started: Warming up")
|
||||
self.nb_received_tokens = 0
|
||||
self.bot_says = ""
|
||||
if debug:
|
||||
self.print_prompt("gen",prompt)
|
||||
|
||||
self.model.generate(
|
||||
prompt,
|
||||
max_size,
|
||||
max_size if max_size else (self.config.ctx_size-len(self.model.tokenize(prompt))),
|
||||
partial(self.process, callback=callback, show_progress=show_progress),
|
||||
temperature=self.model_temperature if temperature is None else temperature,
|
||||
top_k=self.model_top_k if top_k is None else top_k,
|
||||
@ -2072,10 +2071,10 @@ class APScript(StateMachine):
|
||||
with open(path, 'w') as file:
|
||||
yaml.dump(data, file)
|
||||
|
||||
def generate_with_images(self, prompt, images, max_size, temperature = None, top_k = None, top_p=None, repeat_penalty=None, repeat_last_n=None, callback=None, debug=False ):
|
||||
def generate_with_images(self, prompt, images, max_size = None, temperature = None, top_k = None, top_p=None, repeat_penalty=None, repeat_last_n=None, callback=None, debug=False ):
|
||||
return self.personality.generate_with_images(prompt, images, max_size, temperature, top_k, top_p, repeat_penalty, repeat_last_n, callback, debug=debug)
|
||||
|
||||
def generate(self, prompt, max_size, temperature = None, top_k = None, top_p=None, repeat_penalty=None, repeat_last_n=None, callback=None, debug=False ):
|
||||
def generate(self, prompt, max_size = None, temperature = None, top_k = None, top_p=None, repeat_penalty=None, repeat_last_n=None, callback=None, debug=False ):
|
||||
return self.personality.generate(prompt, max_size, temperature, top_k, top_p, repeat_penalty, repeat_last_n, callback, debug=debug)
|
||||
|
||||
|
||||
@ -2415,24 +2414,109 @@ class APScript(StateMachine):
|
||||
return "\n".join(summeries)
|
||||
|
||||
def build_prompt_from_context_details(self, context_details:dict, custom_entries=""):
|
||||
start_header_id_template = self.config.start_header_id_template
|
||||
end_header_id_template = self.config.end_header_id_template
|
||||
system_message_template = self.config.system_message_template
|
||||
return self.build_prompt([
|
||||
context_details["conditionning"] if context_details["conditionning"] else "",
|
||||
f"{start_header_id_template}documentation{end_header_id_template}\n"+context_details["documentation"] if context_details["documentation"] else "",
|
||||
f"{start_header_id_template}knowledge{end_header_id_template}\n"+context_details["knowledge"] if context_details["knowledge"] else "",
|
||||
context_details["user_description"] if context_details["user_description"] else "",
|
||||
f"{start_header_id_template}positive_boost{end_header_id_template}\n"+context_details["positive_boost"] if context_details["positive_boost"] else "",
|
||||
f"{start_header_id_template}negative_boost{end_header_id_template}\n"+context_details["negative_boost"] if context_details["negative_boost"] else "",
|
||||
f"{start_header_id_template}current_language{end_header_id_template}\n"+context_details["current_language"] if context_details["current_language"] else "",
|
||||
f"{start_header_id_template}fun_mode{end_header_id_template}\n"+context_details["fun_mode"] if context_details["fun_mode"] else "",
|
||||
f"{start_header_id_template}discussion_window{end_header_id_template}\n"+context_details["discussion_messages"] if context_details["discussion_messages"].strip()!="" else "",
|
||||
custom_entries,
|
||||
context_details["extra"],
|
||||
f'{start_header_id_template}{context_details["ai_prefix"]}{end_header_id_template}'
|
||||
],
|
||||
8)
|
||||
"""
|
||||
Builds a prompt from the provided context details.
|
||||
|
||||
This function concatenates various parts of the context into a single string, which is then used to build a prompt.
|
||||
The context details can include conditioning, documentation, knowledge, user description, positive and negative boosts,
|
||||
current language, fun mode, discussion window, and any extra information.
|
||||
|
||||
Parameters:
|
||||
context_details (dict): A dictionary containing various context details.
|
||||
custom_entries (str): Additional custom entries to be included in the prompt.
|
||||
|
||||
Returns:
|
||||
str: The constructed prompt.
|
||||
|
||||
Raises:
|
||||
KeyError: If any required key is missing in the context_details dictionary.
|
||||
"""
|
||||
full_context = []
|
||||
sacrifice_id = 0
|
||||
if context_details["conditionning"]:
|
||||
full_context.append( "\n".join([
|
||||
context_details["conditionning"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
if context_details["documentation"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("documentation"),
|
||||
context_details["documentation"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["knowledge"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("knowledge"),
|
||||
context_details["knowledge"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["user_description"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("user_description"),
|
||||
context_details["user_description"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["positive_boost"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("positive_boost"),
|
||||
context_details["positive_boost"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["positive_boost"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("positive_boost"),
|
||||
context_details["positive_boost"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["negative_boost"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("negative_boost"),
|
||||
context_details["negative_boost"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["current_language"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("current_language"),
|
||||
context_details["current_language"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
if context_details["fun_mode"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("fun_mode"),
|
||||
context_details["fun_mode"]
|
||||
]))
|
||||
sacrifice_id += 1
|
||||
|
||||
|
||||
if context_details["discussion_messages"]:
|
||||
full_context.append( "\n".join([
|
||||
self.system_custom_header("discussion_messages"),
|
||||
context_details["discussion_messages"]
|
||||
]))
|
||||
|
||||
if context_details["extra"]:
|
||||
full_context.append( "\n".join([
|
||||
context_details["extra"]
|
||||
]))
|
||||
|
||||
if custom_entries:
|
||||
full_context.append( "\n".join([
|
||||
custom_entries
|
||||
]))
|
||||
|
||||
full_context.append( "\n".join([
|
||||
self.ai_custom_header(context_details["ai_prefix"])
|
||||
]))
|
||||
|
||||
return self.build_prompt(full_context,
|
||||
sacrifice_id)
|
||||
def build_prompt(self, prompt_parts:List[str], sacrifice_id:int=-1, context_size:int=None, minimum_spare_context_size:int=None):
|
||||
"""
|
||||
Builds the prompt for code generation.
|
||||
@ -3768,6 +3852,9 @@ fetch('/open_file', {
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_user_header_id_template}{self.personality.name}{self.end_user_header_id_template}"
|
||||
|
||||
def system_custom_header(self, ai_name) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
return f"{self.start_user_header_id_template}{ai_name}{self.end_user_header_id_template}"
|
||||
|
||||
def ai_custom_header(self, ai_name) -> str:
|
||||
"""Get the start_header_id_template."""
|
||||
|
@ -1,5 +1,5 @@
|
||||
# =================== Lord Of Large Language Multimodal Systems Configuration file ===========================
|
||||
version: 115
|
||||
version: 118
|
||||
binding_name: null
|
||||
model_name: null
|
||||
model_variant: null
|
||||
@ -241,8 +241,14 @@ audio_silenceTimer: 5000
|
||||
# Data vectorization
|
||||
rag_databases: [] # This is the list of paths to database sources. Each database is a folder containing data
|
||||
rag_vectorizer: bert # possible values bert, tfidf, word2vec
|
||||
rag_vectorizer_model: bert-base-nli-mean-tokens # The model name if applicable
|
||||
rag_vectorizer_parameters: null # Parameters of the model in json format
|
||||
rag_chunk_size: 512 # number of tokens per chunk
|
||||
rag_n_chunks: 4 #Number of chunks to recover from the database
|
||||
rag_clean_chunks: true #Removed all uinecessary spaces and line returns
|
||||
rag_follow_subfolders: true #if true the vectorizer will vectorize the content of subfolders too
|
||||
rag_check_new_files_at_startup: false #if true, the vectorizer will automatically check for any new files in the folder and adds it to the database
|
||||
rag_preprocess_chunks: false #if true, an LLM will preprocess the content of the chunk before writing it in a simple format
|
||||
|
||||
activate_skills_lib: false # Activate vectorizing previous conversations
|
||||
skills_lib_database_name: "default" # Default skills database
|
||||
|
@ -124,8 +124,8 @@ def select_rag_database(client) -> Optional[Dict[str, Path]]:
|
||||
|
||||
if db_name:
|
||||
try:
|
||||
lollmsElfServer.ShowBlockingMessage("Adding a new database.\nVectorizing the database")
|
||||
if not PackageManager.check_package_installed_with_version("lollmsvectordb","0.5.1"):
|
||||
lollmsElfServer.ShowBlockingMessage("Adding a new database.")
|
||||
if not PackageManager.check_package_installed_with_version("lollmsvectordb","0.5.5"):
|
||||
PackageManager.install_or_update("lollmsvectordb")
|
||||
|
||||
from lollmsvectordb.lollms_vectorizers.bert_vectorizer import BERTVectorizer
|
||||
@ -144,10 +144,10 @@ def select_rag_database(client) -> Optional[Dict[str, Path]]:
|
||||
from lollmsvectordb.lollms_vectorizers.tfidf_vectorizer import TFIDFVectorizer
|
||||
v = TFIDFVectorizer()
|
||||
|
||||
vdb = VectorDatabase(Path(folder_path)/"db_name.sqlite", v, lollmsElfServer.model if lollmsElfServer.model else TikTokenTokenizer())
|
||||
vdb = VectorDatabase(Path(folder_path)/f"{db_name}.sqlite", v, lollmsElfServer.model if lollmsElfServer.model else TikTokenTokenizer())
|
||||
# Get all files in the folder
|
||||
folder = Path(folder_path)
|
||||
file_types = [f"**/*{f}" for f in TextDocumentsLoader.get_supported_file_types()]
|
||||
file_types = [f"**/*{f}" if lollmsElfServer.config.rag_follow_subfolders else f"*{f}" for f in TextDocumentsLoader.get_supported_file_types()]
|
||||
files = []
|
||||
for file_type in file_types:
|
||||
files.extend(folder.glob(file_type))
|
||||
@ -205,6 +205,11 @@ def find_rag_database_by_name(entries: List[str], name: str) -> Optional[str]:
|
||||
class SelectDatabase(BaseModel):
|
||||
client_id: str
|
||||
|
||||
class FolderInfos(BaseModel):
|
||||
client_id: str
|
||||
db_path: str
|
||||
|
||||
|
||||
class MountDatabase(BaseModel):
|
||||
client_id: str
|
||||
database_name:str
|
||||
@ -252,32 +257,123 @@ def toggle_mount_rag_database(database_infos: MountDatabase):
|
||||
"""
|
||||
client = check_access(lollmsElfServer, database_infos.client_id)
|
||||
index, path = find_rag_database_by_name(lollmsElfServer.config.rag_databases,database_infos.database_name)
|
||||
if not lollmsElfServer.config.rag_databases[index].split("::")[-1]=="mounted":
|
||||
lollmsElfServer.config.rag_databases[index] = lollmsElfServer.config.rag_databases[index] + "::mounted"
|
||||
if not PackageManager.check_package_installed_with_version("lollmsvectordb","0.5.1"):
|
||||
PackageManager.install_or_update("lollmsvectordb")
|
||||
|
||||
from lollmsvectordb import VectorDatabase
|
||||
from lollmsvectordb.text_document_loader import TextDocumentsLoader
|
||||
from lollmsvectordb.lollms_tokenizers.tiktoken_tokenizer import TikTokenTokenizer
|
||||
parts = lollmsElfServer.config.rag_databases[index].split("::")
|
||||
if not parts[-1]=="mounted":
|
||||
def process():
|
||||
try:
|
||||
lollmsElfServer.ShowBlockingMessage(f"Mounting database {parts[0]}")
|
||||
lollmsElfServer.config.rag_databases[index] = lollmsElfServer.config.rag_databases[index] + "::mounted"
|
||||
if not PackageManager.check_package_installed_with_version("lollmsvectordb","0.5.5"):
|
||||
PackageManager.install_or_update("lollmsvectordb")
|
||||
|
||||
from lollmsvectordb import VectorDatabase
|
||||
from lollmsvectordb.text_document_loader import TextDocumentsLoader
|
||||
from lollmsvectordb.lollms_tokenizers.tiktoken_tokenizer import TikTokenTokenizer
|
||||
|
||||
if lollmsElfServer.config.rag_vectorizer == "bert":
|
||||
lollmsElfServer.backup_trust_store()
|
||||
from lollmsvectordb.lollms_vectorizers.bert_vectorizer import BERTVectorizer
|
||||
v = BERTVectorizer()
|
||||
lollmsElfServer.restore_trust_store()
|
||||
elif lollmsElfServer.config.rag_vectorizer == "tfidf":
|
||||
from lollmsvectordb.lollms_vectorizers.tfidf_vectorizer import TFIDFVectorizer
|
||||
v = TFIDFVectorizer()
|
||||
if lollmsElfServer.config.rag_vectorizer == "bert":
|
||||
lollmsElfServer.backup_trust_store()
|
||||
from lollmsvectordb.lollms_vectorizers.bert_vectorizer import BERTVectorizer
|
||||
v = BERTVectorizer()
|
||||
lollmsElfServer.restore_trust_store()
|
||||
elif lollmsElfServer.config.rag_vectorizer == "tfidf":
|
||||
from lollmsvectordb.lollms_vectorizers.tfidf_vectorizer import TFIDFVectorizer
|
||||
v = TFIDFVectorizer()
|
||||
|
||||
vdb = VectorDatabase(Path(path)/"db_name.sqlite", v, lollmsElfServer.model if lollmsElfServer.model else TikTokenTokenizer(), n_neighbors=lollmsElfServer.config.rag_n_chunks)
|
||||
vdb.build_index()
|
||||
lollmsElfServer.active_rag_dbs.append({"name":database_infos.database_name,"path":path,"vectorizer":vdb})
|
||||
lollmsElfServer.config.save_config()
|
||||
lollmsElfServer.info(f"Database {database_infos.database_name} mounted succcessfully")
|
||||
vdb = VectorDatabase(Path(path)/f"{database_infos.database_name}.sqlite", v, lollmsElfServer.model if lollmsElfServer.model else TikTokenTokenizer(), chunk_size=lollmsElfServer.config.rag_chunk_size, clean_chunks=lollmsElfServer.config.rag_clean_chunks, n_neighbors=lollmsElfServer.config.rag_n_chunks)
|
||||
lollmsElfServer.active_rag_dbs.append({"name":database_infos.database_name,"path":path,"vectorizer":vdb})
|
||||
lollmsElfServer.config.save_config()
|
||||
lollmsElfServer.info(f"Database {database_infos.database_name} mounted succcessfully")
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
|
||||
lollmsElfServer.rag_thread = threading.Thread(target=process)
|
||||
lollmsElfServer.rag_thread.start()
|
||||
else:
|
||||
# Unmount the database faster than a cat jumps off a hot stove!
|
||||
lollmsElfServer.config.rag_databases[index] = lollmsElfServer.config.rag_databases[index].replace("::mounted", "")
|
||||
lollmsElfServer.active_rag_dbs = [db for db in lollmsElfServer.active_rag_dbs if db["name"] != database_infos.database_name]
|
||||
lollmsElfServer.config.save_config()
|
||||
|
||||
|
||||
@router.post("/vectorize_folder")
|
||||
async def vectorize_folder(database_infos: FolderInfos):
|
||||
"""
|
||||
Selects and names a database
|
||||
"""
|
||||
client = check_access(lollmsElfServer, database_infos.client_id)
|
||||
def process():
|
||||
if "::" in database_infos.db_path:
|
||||
parts = database_infos.db_path.split("::")
|
||||
db_name = parts[0]
|
||||
folder_path = parts[1]
|
||||
else:
|
||||
import tkinter as tk
|
||||
from tkinter import simpledialog, filedialog
|
||||
# Create a new Tkinter root window and hide it
|
||||
root = tk.Tk()
|
||||
root.withdraw()
|
||||
|
||||
# Make the window appear on top
|
||||
root.attributes('-topmost', True)
|
||||
|
||||
# Ask for the database name
|
||||
db_name = simpledialog.askstring("Database Name", "Please enter the database name:")
|
||||
folder_path = database_infos.db_path
|
||||
|
||||
|
||||
if db_name:
|
||||
try:
|
||||
lollmsElfServer.ShowBlockingMessage("Revectorizing the database.")
|
||||
if not PackageManager.check_package_installed_with_version("lollmsvectordb","0.5.5"):
|
||||
PackageManager.install_or_update("lollmsvectordb")
|
||||
|
||||
from lollmsvectordb.lollms_vectorizers.bert_vectorizer import BERTVectorizer
|
||||
from lollmsvectordb import VectorDatabase
|
||||
from lollmsvectordb.text_document_loader import TextDocumentsLoader
|
||||
from lollmsvectordb.lollms_tokenizers.tiktoken_tokenizer import TikTokenTokenizer
|
||||
|
||||
|
||||
if lollmsElfServer.config.rag_vectorizer == "bert":
|
||||
lollmsElfServer.backup_trust_store()
|
||||
from lollmsvectordb.lollms_vectorizers.bert_vectorizer import BERTVectorizer
|
||||
v = BERTVectorizer()
|
||||
lollmsElfServer.restore_trust_store()
|
||||
|
||||
elif lollmsElfServer.config.rag_vectorizer == "tfidf":
|
||||
from lollmsvectordb.lollms_vectorizers.tfidf_vectorizer import TFIDFVectorizer
|
||||
v = TFIDFVectorizer()
|
||||
vector_db_path = Path(folder_path)/f"{db_name}.sqlite"
|
||||
|
||||
vdb = VectorDatabase(vector_db_path, v, lollmsElfServer.model if lollmsElfServer.model else TikTokenTokenizer(), reset=True)
|
||||
vdb.new_data = True
|
||||
# Get all files in the folder
|
||||
folder = Path(folder_path)
|
||||
file_types = [f"**/*{f}" if lollmsElfServer.config.rag_follow_subfolders else f"*{f}" for f in TextDocumentsLoader.get_supported_file_types()]
|
||||
files = []
|
||||
for file_type in file_types:
|
||||
files.extend(folder.glob(file_type))
|
||||
|
||||
# Load and add each document to the database
|
||||
for fn in files:
|
||||
try:
|
||||
text = TextDocumentsLoader.read_file(fn)
|
||||
title = fn.stem # Use the file name without extension as the title
|
||||
lollmsElfServer.ShowBlockingMessage(f"Adding a new database.\nAdding {title}")
|
||||
vdb.add_document(title, text, fn)
|
||||
print(f"Added document: {title}")
|
||||
except Exception as e:
|
||||
lollmsElfServer.error(f"Failed to add document {fn}: {e}")
|
||||
if vdb.new_data: #New files are added, need reindexing
|
||||
lollmsElfServer.ShowBlockingMessage(f"Adding a new database.\nIndexing the database...")
|
||||
vdb.build_index()
|
||||
ASCIIColors.success("OK")
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
run_async(partial(lollmsElfServer.sio.emit,'rag_db_added', {"database_name": db_name, "database_path": str(folder_path)}, to=client.client_id))
|
||||
|
||||
except Exception as ex:
|
||||
trace_exception(ex)
|
||||
lollmsElfServer.HideBlockingMessage()
|
||||
lollmsElfServer.rag_thread = threading.Thread(target=process)
|
||||
lollmsElfServer.rag_thread.start()
|
@ -249,9 +249,17 @@ def get_media_type(file_path):
|
||||
return media_type
|
||||
|
||||
|
||||
def discussion_path_2_url(path:str|Path):
|
||||
path = str(path)
|
||||
return path[path.index('discussion_databases'):].replace('discussion_databases','discussions')
|
||||
def discussion_path_to_url(file_path:str|Path)->str:
|
||||
"""
|
||||
This function takes a file path as an argument and converts it into a URL format. It first removes the initial part of the file path until the "outputs" string is reached, then replaces backslashes with forward slashes and quotes each segment with urllib.parse.quote() before joining them with forward slashes to form the final URL.
|
||||
|
||||
:param file_path: str, the file path in the format of a Windows system
|
||||
:return: str, the converted URL format of the given file path
|
||||
"""
|
||||
file_path = str(file_path)
|
||||
url = "/"+file_path[file_path.index("discussion_databases"):].replace("\\","/").replace("discussion_databases","discussions")
|
||||
return "/".join([urllib.parse.quote(p, safe="") for p in url.split("/")])
|
||||
|
||||
|
||||
|
||||
def yes_or_no_input(prompt):
|
||||
@ -388,8 +396,7 @@ def run_cmd(cmd, assert_success=False, environment=False, capture_output=False,
|
||||
sys.exit(1)
|
||||
|
||||
return result
|
||||
|
||||
def file_path_to_url(file_path):
|
||||
def output_file_path_to_url(file_path):
|
||||
"""
|
||||
This function takes a file path as an argument and converts it into a URL format. It first removes the initial part of the file path until the "outputs" string is reached, then replaces backslashes with forward slashes and quotes each segment with urllib.parse.quote() before joining them with forward slashes to form the final URL.
|
||||
|
||||
@ -401,17 +408,6 @@ def file_path_to_url(file_path):
|
||||
return "/".join([urllib.parse.quote(p, safe="") for p in url.split("/")])
|
||||
|
||||
|
||||
def discussion_path_to_url(file_path:str|Path)->str:
|
||||
"""
|
||||
This function takes a file path as an argument and converts it into a URL format. It first removes the initial part of the file path until the "outputs" string is reached, then replaces backslashes with forward slashes and quotes each segment with urllib.parse.quote() before joining them with forward slashes to form the final URL.
|
||||
|
||||
:param file_path: str, the file path in the format of a Windows system
|
||||
:return: str, the converted URL format of the given file path
|
||||
"""
|
||||
file_path = str(file_path)
|
||||
url = "/"+file_path[file_path.index("discussion_databases"):].replace("\\","/").replace("discussion_databases","discussions")
|
||||
return "/".join([urllib.parse.quote(p, safe="") for p in url.split("/")])
|
||||
|
||||
def personality_path_to_url(file_path:str|Path)->str:
|
||||
"""
|
||||
This function takes a file path as an argument and converts it into a URL format. It first removes the initial part of the file path until the "outputs" string is reached, then replaces backslashes with forward slashes and quotes each segment with urllib.parse.quote() before joining them with forward slashes to form the final URL.
|
||||
|
Loading…
x
Reference in New Issue
Block a user