forked from microsoft/semantic-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding draft filtering changes * Adding new qdrant filter class and general MemoryFilter * Changing approach to QdrantFilter as a generic argument for IMemoryStore * Adding generic memory storage available in the context. * Adding json attributes to qdrant filter object * Adding filterable memory getter to kernel plus missing comments. * Styling changes; Tests fixed * Missing IValidatable in RangeCondition * Making System.Text.Json serialize properties of Condition-derived classes in QdrantFilter * Creating filterable SemanticTextMemory * Creating ISemanticTextMemory moved to a separate method * Using JsonDerivedTypeAttribute for QdrantFilter conditions * Test added + styling changes * Allowing empty Conditions in QdrantFilter * Update IMemoryStore.cs
- Loading branch information
1 parent
5cae285
commit 6397f26
Showing
137 changed files
with
5,032 additions
and
6,856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Label issues | ||
on: | ||
issues: | ||
types: | ||
- reopened | ||
- opened | ||
|
||
jobs: | ||
label_issues: | ||
name: "Issue: add labels" | ||
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
// Get the issue body and title | ||
const body = context.payload.issue.body | ||
let title = context.payload.issue.title | ||
// Define the labels array | ||
let labels = ["triage"] | ||
// Check if the body or the title contains the word 'python' (case-insensitive) | ||
if (body.match(/python/i) || title.match(/python/i)) { | ||
// Add the 'python' label to the array | ||
labels.push("python") | ||
} | ||
// Check if the body or the title contains the word 'java' (case-insensitive) | ||
if (body.match(/java/i) || title.match(/java/i)) { | ||
// Add the 'java' label to the array | ||
labels.push("java") | ||
} | ||
// Add the labels to the issue | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: labels | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Label title prefix | ||
on: | ||
issues: | ||
types: [ labeled ] | ||
pull_request: | ||
types: [ labeled ] | ||
|
||
jobs: | ||
add_title_prefix: | ||
name: "Issue/PR: add title prefix" | ||
# Define a matrix of label and prefix pairs | ||
strategy: | ||
matrix: | ||
include: | ||
- {label: 'python', prefix: 'Python'} | ||
- {label: 'java', prefix: 'Java'} | ||
- {label: '.NET', prefix: '.Net'} | ||
- {label: 'copilot chat', prefix: 'Copilot Chat'} | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/github-script@v6 | ||
name: "Issue/PR: update title" | ||
with: | ||
script: | | ||
// Get the label and prefix from the matrix | ||
const label = '${{ matrix.label }}' | ||
const prefix = '${{ matrix.prefix }}' | ||
labelAdded = context.payload.label.name | ||
// Write the contents of context to console | ||
core.info(JSON.stringify(context, null, 2)) | ||
// Get the event name, title and labels | ||
let title | ||
switch(context.eventName) { | ||
case 'issues': | ||
title = context.payload.issue.title | ||
break | ||
case 'pull_request': | ||
title = context.payload.pull_request.title | ||
break | ||
default: | ||
core.setFailed('Unrecognited eventName: ' + context.eventName) | ||
} | ||
let originalTitle = title | ||
// Update the title based on the label and prefix | ||
// Check if the issue or PR has the label | ||
if (labelAdded == label) { | ||
// Check if the title starts with the prefix (case-sensitive) | ||
if (!title.startsWith(prefix + ": ")) { | ||
// If not, check if the first word is the label (case-insensitive) | ||
if (title.match(new RegExp(`^${prefix}`, 'i'))) { | ||
// If yes, replace it with the prefix (case-sensitive) | ||
title = title.replace(new RegExp(`^${prefix}`, 'i'), prefix) | ||
} else { | ||
// If not, prepend the prefix to the title | ||
title = prefix + ": " + title | ||
} | ||
} | ||
} | ||
// Update the issue or PR title, if changed | ||
if (title != originalTitle ) { | ||
switch(context.eventName) { | ||
case 'issues': | ||
github.rest.issues.update({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: title | ||
}); | ||
break | ||
case 'pull_request': | ||
try { | ||
github.rest.pulls.update({ | ||
pull_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: title | ||
}); | ||
} | ||
catch (err) { | ||
core.info("Update PR title failed: " + err.message) | ||
} | ||
break | ||
default: | ||
core.setFailed('Unrecognited eventName: ' + context.eventName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.