Compare commits

..

10 Commits

Author SHA1 Message Date
cc0b442f3d Fix typo
All checks were successful
Build and Push NLP Docker Image / build (push) Successful in 2m35s
2026-07-23 05:41:16 +00:00
6e1aadb2a7 Fix typo 2026-07-23 05:35:56 +00:00
1532326719 Update db 2026-07-23 05:21:37 +00:00
2aa81df961 Add argument matching 2026-07-23 02:54:38 +00:00
266bdd6a55 update db module 2026-07-18 03:10:20 +00:00
f338f7b4d7 Update db module 2026-07-18 03:03:45 +00:00
f58bfc1477 No need to include branch name 2026-07-18 01:56:34 +00:00
2335a43e46 Update to latest db module 2026-07-18 00:41:51 +00:00
81a83d201d Build with submodules initialized 2026-07-17 05:59:29 +00:00
45b7becfe5 Update db module 2026-07-17 04:38:32 +00:00
3 changed files with 42 additions and 13 deletions

View File

@ -1,4 +1,4 @@
name: Build and Push Docker Image
name: Build and Push NLP Docker Image
on:
push:
@ -9,7 +9,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.ACCESS_TOKEN }}
- name: Initialize submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
git submodule status
ls -la src/modules/db
ls -la src/modules/redis
- name: Login to Registry
uses: docker/login-action@v3
@ -25,7 +37,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push (multi-arch)
- name: Build and Push NLP (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
@ -34,8 +46,8 @@ jobs:
build-args: |
BUILD_IDENTIFIER=${{ steps.vars.outputs.short_sha }}
tags: |
gitea.spilum.net/spilum.net/mtf-nlp:${{ github.ref_name }}-${{ steps.vars.outputs.short_sha }}
gitea.spilum.net/spilum.net/mtf-nlp:${{ github.ref_name }}-latest
gitea.spilum.net/spilum.net/mtf-nlp:${{ steps.vars.outputs.short_sha }}
gitea.spilum.net/spilum.net/mtf-nlp:latest
- name: Log out from registry
if: always()

@ -1 +1 @@
Subproject commit 484c5bd8e5a5c77ef2c6a20817205de99cbc77ce
Subproject commit d84f25c7a672b687c7f9c9e78a4c97a5586036b0

View File

@ -72,28 +72,45 @@ async function classifyIntent(text) {
const INTENTS = await getIntents();
let best = {
let bestIntent = {
name: "unknown",
confidence: 0.5,
matched: null,
argument: null
};
for (const intent of INTENTS) {
for (const example of intent.examples) {
const exampleEmbedding = await embed(example);
const score = cosineSimilarity(inputEmbedding, exampleEmbedding);
const intentScore = cosineSimilarity(inputEmbedding, exampleEmbedding);
if (score > best.confidence) {
best = {
if (intentScore > bestIntent.confidence) {
bestIntent = {
name: intent.name,
confidence: score,
confidence: intentScore,
matched: example,
argument: intent.arguments
};
}
}
}
return best;
let bestArgumentScore = 0.5
if (bestIntent.argument) {
for (const argument of best.arguments) {
const argumentEmbedding = await embed(argument);
const argumentScore = cosineSimilarity(inputEmbedding, argumentEmbedding);
if (argumentScore > bestArgumentScore) {
bestArgumentScore = argumentScore;
bestIntent.argument = argument
}
}
}
return bestIntent;
}
async function handleIntent(streamKey, msg) {