mirror of
https://github.com/mtayfur/openwebui-memory-system.git
synced 2026-01-22 06:51:01 +01:00
Implement code changes to enhance functionality and improve performance
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
__pycache__/
|
||||
.venv/
|
||||
**AGENTS.md
|
||||
tests/
|
||||
#tests/
|
||||
@@ -343,71 +343,68 @@ class SkipDetector:
|
||||
"""Semantic-based content classifier using zero-shot classification with category descriptions."""
|
||||
|
||||
TECHNICAL_CATEGORY_DESCRIPTIONS = [
|
||||
"Python JavaScript TypeScript React code def class import return function const let var JSX useState useEffect hooks component calculates Fibonacci dynamic programming algorithm implementation optimization",
|
||||
"singleton pattern thread-safe lazy initialization design pattern factory builder observer strategy implementation structure",
|
||||
"Python JavaScript TypeScript React code def class import return function const let var JSX useState useEffect hooks component algorithm implementation optimization",
|
||||
"singleton pattern thread-safe lazy initialization design pattern factory builder observer strategy decorator adapter",
|
||||
"error exception traceback TypeError NullPointerException IndexError segmentation fault core dumped stack overflow output",
|
||||
"HTTP 404 not found 500 server error 403 forbidden 401 unauthorized resource failed endpoint API error response",
|
||||
"terminal command line shell dollar sudo apt-get npm install docker run git clone kubectl cargo commands execution",
|
||||
"JSON XML YAML object curly braces nested data array key colon value syntax structure parsing serialization configuration file",
|
||||
"JSON XML YAML object curly braces nested data array key colon value parsing serialization configuration file",
|
||||
"WebSocket connection established on port 8080 binary message protocol real-time bidirectional server client communication",
|
||||
"REST API GraphQL endpoint POST GET PUT DELETE PATCH mutation query request response payload authentication bearer token header",
|
||||
"file path directory /etc /var /usr /home /lib /home config log bin system32 absolute relative path C:\\ Windows",
|
||||
"algorithm uses binary search tree O(log n) time complexity space hash table array implementation data structures",
|
||||
"markdown horizontal rule separator dashes equals asterisks underscores heading code block syntax formatting",
|
||||
"code block indentation whitespace tabs spaces nested function body class method formatted structure syntax",
|
||||
"file path directory /etc /var /usr /home /lib config log bin system32 absolute relative path C:\\ Windows nginx apache server configuration",
|
||||
"algorithm uses binary search tree O(log n) time complexity space hash table array data structures sorting searching big O notation performance analysis insertions deletions traversal",
|
||||
"markdown horizontal rule separator dashes equals asterisks underscores heading code block formatting hierarchical structure indented subsection",
|
||||
"code block indentation whitespace tabs spaces nested function body class method formatted structured",
|
||||
"Kubernetes Docker container deployment manifest spec replicas image registry pods orchestration cluster namespace ECR ECS",
|
||||
"SQL query statement select insert update delete join where table column row index primary key ALTER CREATE DROP syntax",
|
||||
"log output stack trace INFO WARN ERROR DEBUG timestamp level server started on port connection failed memory usage at line number module file raised exception caught unhandled error debugging",
|
||||
"SQL database query select insert update delete join where table column row index primary key foreign key constraint schema migration ALTER CREATE DROP connection pool timeout performance",
|
||||
"log output stack trace INFO WARN ERROR DEBUG timestamp level server started on port connection failed memory usage module file raised exception caught unhandled error debugging performance monitoring redis nginx milliseconds ms",
|
||||
"regex pattern regular expression match groups capture backslash escape metacharacter wildcard quantifier character class",
|
||||
"unit test pytest jest mocha assertion expect mock spy fixture describe it beforeEach testing framework suite CI CD pipeline Jenkins GitHub Actions GitLab workflow build deploy automation",
|
||||
"database schema table primary key foreign key constraint index migration ALTER CREATE DROP INSERT UPDATE",
|
||||
"git commit push pull merge branch conflict rebase cherry-pick HEAD origin master main develop repository remote npm package.json dependencies",
|
||||
"AWS S3 bucket EC2 instance Lambda function CloudFormation stack template region availability zone IAM role nginx apache server configuration",
|
||||
"git commit push pull merge branch conflict rebase cherry-pick HEAD origin master main develop repository remote npm package.json dependencies version control",
|
||||
"AWS S3 bucket EC2 instance Lambda function CloudFormation stack template region availability zone IAM role",
|
||||
"environment variables export set env dotenv config process.env NODE_ENV PORT HOST makefile compile gcc clang build system JWT token decode verify secret key debugging authentication security aws",
|
||||
]
|
||||
|
||||
INSTRUCTION_CATEGORY_DESCRIPTIONS = [
|
||||
"format output return structure organize as JSON YAML CSV table list markdown bullet points numbered list formatting instruction style presentation layout",
|
||||
"adjust response make shorter longer simpler detailed comprehensive concise brief condensed summarized expand elaborate more depth trim down reduce length professional tone",
|
||||
"rewrite rephrase translate summarize paraphrase condense previous response output answer again differently instruction reformulate",
|
||||
"change tone formal casual technical professional friendly explain like five years old simple conversational academic style",
|
||||
"can you explain that again repeat simpler words break down step by step clarify confused understand elaborate show example provide sample",
|
||||
"continue keep going more add additional finish complete rest of remaining content conclusion end stop enough that's sufficient",
|
||||
"format output return structure organize as JSON YAML CSV table list markdown bullet points numbered list formatting instruction style presentation layout professional tone arrange display",
|
||||
"adjust response make shorter longer simpler detailed comprehensive concise brief condensed expand elaborate more depth trim down reduce length change length modify response",
|
||||
"rewrite rephrase paraphrase previous response output answer again differently instruction reformulate regenerate restate reformulate prior answer",
|
||||
"change tone formal casual technical professional friendly explain like five years old simple conversational academic style adjust tone modify style",
|
||||
"can you explain that again repeat simpler words break down step by step clarify confused about your answer understand response elaborate show example provide sample explanation",
|
||||
"continue keep going more add additional finish complete rest of remaining content conclusion end stop enough that's sufficient continue from where you stopped",
|
||||
"translate the output to language convert response to different language translate answer to Spanish French German Italian Japanese Chinese Portuguese Arabic Russian Korean",
|
||||
]
|
||||
|
||||
|
||||
PURE_MATH_CALCULATION_CATEGORY_DESCRIPTIONS = [
|
||||
"pure arithmetic explicit numbers calculate solve multiply add subtract divide numeric computation what is 23 plus 456 minus 78 times 9 divided by 3 equals order operations 45 times 67",
|
||||
"mathematical expression numbers operators 2 plus 3 times 4 divided by 5 what is 123 times 456 numeric calculation arithmetic",
|
||||
"pure arithmetic explicit numbers calculate solve multiply add subtract divide numeric computation what is 23 plus 456 minus 78 times 9 divided by 3 equals order operations mathematical expression operators",
|
||||
"unit conversion numeric values convert 100 kilometers to miles 72 fahrenheit to celsius degrees metric imperial measurement numbers 5 feet 9 inches to centimeters meters height weight pounds kilograms",
|
||||
"percentage calculation explicit numbers what is 25 percent of 800 15 percent of 250 discount price 30 off numeric percentage proportion 15 percent tip on 65.40 bill split check 4 people",
|
||||
"algebra equation explicit numbers solve for x variable in equation 2x plus 5 equals 15 quadratic formula numeric values",
|
||||
"algebra equation explicit numbers solve for x variable in equation 2x plus 5 equals 15 quadratic formula discriminant formula ax squared plus bx plus c equals zero numeric coefficient values",
|
||||
"geometry calculation numeric measurements area of circle radius 5 volume of cube side 10 circumference perimeter numeric dimensions square root of 144 256 cube root 27 64",
|
||||
"compound interest calculate savings 5000 dollars annual rate 4 percent years investment growth principal mortgage payment monthly 300000 loan 30 years numeric financial calculation",
|
||||
"statistics mean median mode average standard deviation dataset numbers 12 15 18 20 22 calculate distribution probability chance odds numeric",
|
||||
"calculate BMI body mass index weight 180 pounds height 5 feet 10 inches health metric numeric formula how many days hours minutes between dates time difference duration",
|
||||
"what's number squared what is square of number calculate square root cube root power exponent factorial what's 23 squared what is 5 cubed calculate 7 to the power of 3 what's the square of 15 what is 8 squared solve equation calculate derivative integral matrix determinant vector scalar",
|
||||
]
|
||||
|
||||
|
||||
EXPLICIT_TRANSLATION_CATEGORY_DESCRIPTIONS = [
|
||||
"translation instruction with word translate and explicit text to translate in quotes brackets like translate this Hello how are you to Spanish French German Italian Japanese Chinese Portuguese",
|
||||
"translation request how do you say specific word phrase expression in language like how do you say thank you computer hello goodbye in Spanish French German Japanese",
|
||||
"translation instruction with word translate and explicit text to translate in quotes brackets like translate this Hello how are you to Spanish French German Italian Japanese Chinese",
|
||||
"translation request how do you say specific word phrase expression in language like how do you say thank you computer hello goodbye welcome in Spanish French German Italian Japanese",
|
||||
"language conversion with word translate convert and text block paragraph source text followed by target language content translation",
|
||||
"phrase sentence translation with quoted bracketed text translate I am hungry Where is the train station to French Spanish Portuguese Arabic Russian Japanese",
|
||||
"what is translation of explicit source text I love you The quick brown fox to Italian Portuguese Japanese Chinese language target output result",
|
||||
"translate the following sentence paragraph text to Spanish French German Italian Japanese Chinese Arabic Russian Korean Portuguese give me translation of specific text",
|
||||
"what is French Spanish German Italian Japanese Portuguese word for computer house beautiful thank you hello goodbye common phrase translation",
|
||||
"convert this text sentence paragraph to another language translate sentence paragraph passage to target foreign language output how do I say in foreign language",
|
||||
"what is translation of explicit source text I love you The quick brown fox jumps over lazy dog to foreign language target output result translation service dictionary lookup",
|
||||
"translate the following sentence paragraph text give me translation of specific quoted text content phrase sentence translation with quoted bracketed text I am hungry Where is the train station",
|
||||
"what is foreign language word for computer house beautiful thank you hello goodbye common phrase vocabulary translation Spanish French German Italian Japanese Portuguese Arabic",
|
||||
]
|
||||
|
||||
|
||||
GRAMMAR_PROOFREADING_CATEGORY_DESCRIPTIONS = [
|
||||
"proofreading request with incorrect text like fix grammar spelling in this here is my draft check for typos errors in quoted text passage proofread this paragraph Teh quick brown fox misspelling",
|
||||
"grammar correction with specific wrong text or sentence like She don't like Their going too the store I has three book incorrect verb tense agreement subject verb agreement",
|
||||
"spelling punctuation check with specific text to review and fix errors mistakes typos in provided passage paragraph document content check spelling punctuation in this",
|
||||
"error correction like check this text for mistakes review sentence for grammar problems spelling issues with text passage included comma splice run-on fragment",
|
||||
"is this sentence correct grammatically proper accurate Their going to they're house there their they're usage grammar question does this make sense clear understandable",
|
||||
"proofread my email letter essay document with provided text content check clarity flow coherence readability grammar spelling punctuation improve my writing make better",
|
||||
"correct punctuation comma splice run-on sentence fragment capitalization errors apostrophe quotation marks period semicolon colon usage missing punctuation",
|
||||
"fix the grammar correct this sentence check grammar She don't like Me and him went to the store Their going too the park I has three book proofreading request incorrect text draft check typos errors quoted text passage proofread paragraph Teh quick brown fox misspelling verb tense agreement subject verb pronoun agreement",
|
||||
"check for typos check spelling proofread this paragraph spelling punctuation check with specific text to review and fix errors mistakes typos in provided passage paragraph document content Teh compnay is veyr successfull recieved mesage comma splice run-on fragment capitalization errors apostrophe quotation marks period semicolon colon",
|
||||
"correct the punctuation fix punctuation where are you going today I bought apples oranges and bananas error correction like check this text for mistakes review sentence for grammar problems spelling issues punctuation with text passage included",
|
||||
"is this sentence correct grammatically proper accurate Their going to they're house there their they're usage grammar question does this make sense clear understandable should I use pronoun which pronoun is correct",
|
||||
"proofread my email letter essay document with provided text content check clarity flow coherence readability improve my writing make better enhance structure organization logical flow persuasive argument academic writing professional communication",
|
||||
"word choice suggestion better alternative synonym replace improve vocabulary diction phrasing expression more precise accurate appropriate active voice passive voice parallel construction",
|
||||
]
|
||||
|
||||
@@ -416,36 +413,30 @@ class SkipDetector:
|
||||
"statement about family members by name mentioning spouse children parents siblings relatives grandparents with specific names or family roles relationships",
|
||||
"expression of lasting personal feelings emotions core preferences values beliefs principles or dislikes about life situations experiences worldview",
|
||||
"description of established personal hobbies regular activities consistent interests passions or meaningful pursuits the person does engages in regularly",
|
||||
"significant career information about current job position specific workplace company name professional role responsibilities or work situation employment",
|
||||
"major life plans important personal goals long-term aspirations meaningful future intentions life decisions dreams objectives achievements milestones",
|
||||
"significant career information about current job position specific workplace company name professional role responsibilities or work situation employment promotion received award won competition",
|
||||
"major life plans important personal goals long-term aspirations meaningful future intentions life decisions dreams objectives",
|
||||
"personal decision experience choice about important life matters relationships family career health or individual circumstances situations",
|
||||
"meaningful personal story memory reflection about significant past life experiences events milestones moments that shaped the person",
|
||||
"meaningful personal story memory reflection about significant past life experiences events moments that shaped the person",
|
||||
"personal background information about hometown childhood upbringing education cultural heritage ethnicity or formative life experiences identity graduated from university college",
|
||||
"health information about medical conditions treatments medications ongoing health situations physical attributes wellness fitness or personal healthcare diagnosed with condition",
|
||||
"personal question seeking advice about specific individual life situations relationships family decisions personal circumstances challenges problems",
|
||||
"request for recommendations based on stated personal context preferences needs situation location lifestyle or individual requirements specific constraints",
|
||||
"learning statement expressing personal interest in understanding something new as part of career transition personal development my course my class my school certification degree program studies",
|
||||
"learning statement expressing personal interest in understanding something new career transition personal development my course my class my school certification degree program studies like I am learning Spanish for move trip taking French lessons for job studying Mandarin because wife speaks it German for university with personal motivation context reason",
|
||||
"question about helping family member child spouse partner or relative with their interests education personal needs activities homework projects",
|
||||
"statement about personal challenges struggles confusion anxiety stress with work tasks technology language skills writing grammar at job workplace or in professional setting career imposter syndrome self-doubt",
|
||||
"personal language learning like I am learning Spanish for move trip taking French lessons for job studying Mandarin because my wife speaks it German for university with personal motivation context reason",
|
||||
"personal request for help with specific technology problem issue at job workplace or in personal project with named context like I am having trouble with React at my job working on website",
|
||||
"planning party celebration event for my child family member with specific personal context like my daughter birthday party my son graduation wedding anniversary family gathering",
|
||||
"relationship status change I got married engaged dating divorced separated with partner spouse boyfriend girlfriend fiancé specific person name relationship milestone",
|
||||
"statement about personal challenges struggles confusion anxiety stress with work tasks technology language skills writing grammar at job workplace professional setting career imposter syndrome self-doubt personal request for help with specific technology problem issue at job workplace personal project with named context like I am having trouble with React at my job working on website",
|
||||
"planning party celebration event for my child family member with specific personal context like my daughter birthday party my son graduation anniversary family gathering my anniversary is my birthday is coming my child graduated turned specific date age",
|
||||
"relationship status change I got married engaged dating divorced separated with partner spouse boyfriend girlfriend fiancé specific person name",
|
||||
"pet ownership statement I adopted got have dog cat bird fish hamster named specific name my pet family animal companion breed age characteristics prefer like love dislike pets",
|
||||
"moving relocation I moved am moving to new city country state apartment house from previous location with personal reason context job family school live in specific city neighborhood",
|
||||
"moving relocation I moved am moving to new city country state from previous location with personal reason context job family school live in specific city neighborhood bought rented living arrangements home environment",
|
||||
"dietary preference restriction I am vegetarian vegan pescatarian gluten-free lactose intolerant allergic to with lasting personal commitment health ethical religious reasons food preferences love hate dislike favorite",
|
||||
"religious cultural practice I celebrate observe follow Christian Jewish Muslim Hindu Buddhist tradition faith belief spirituality religious identity cultural background",
|
||||
"living situation I live with roommate alone parents family partner bought rented house apartment condo studio living arrangements home environment",
|
||||
"transportation vehicle I drive own have car specific make model year commute to work school bike bicycle public transit metro bus train",
|
||||
"financial situation I am saving for house down payment on budget tight money limited funds planning retirement investment portfolio goals financial planning",
|
||||
"anniversary birthday milestone my wedding anniversary is my birthday is coming my child graduated turned specific date age celebration special occasion event",
|
||||
"personal project working on book writing novel screenplay painting drawing art music composition hobby with emotional investment meaningful creative pursuit passion",
|
||||
"skill development I am learning play guitar piano violin instrument speak language coding programming for personal fulfillment enjoyment growth self-improvement",
|
||||
"personal project working on book writing novel art music composition hobby with emotional investment meaningful creative pursuit passion skill development I am learning play guitar piano violin instrument speak language coding programming for personal fulfillment enjoyment growth self-improvement",
|
||||
"exercise fitness routine I go to gym run jog yoga pilates swimming regularly established consistent habit activity health wellness physical fitness",
|
||||
"work schedule I work night shift day shift remote from home office hybrid freelance part-time full-time hours schedule arrangement flexibility night owl early bird morning person",
|
||||
"personal values I care about believe in strongly value support environment sustainability social justice equality causes activism principles ethics morals",
|
||||
"phobias fears I am afraid of scared terrified heights flying airplanes spiders insects enclosed spaces claustrophobia significant lasting fear anxiety",
|
||||
"personal achievements I got promoted received award won competition completed certification marathon project significant accomplishment milestone success recognition",
|
||||
"social preferences I am introvert extrovert ambivert prefer small groups large crowds parties socializing alone time solitude personality trait social behavior",
|
||||
]
|
||||
|
||||
|
||||
4514
tests/test_skip_detector_comprehensive.py
Normal file
4514
tests/test_skip_detector_comprehensive.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user