From 863fcb319f0ad1ad4de4651ab451aed1c0c9d46d Mon Sep 17 00:00:00 2001 From: Antonis Makropoulos Date: Fri, 18 Jul 2025 00:44:40 +0300 Subject: [PATCH 1/3] fix usearch for iOS --- Runtime/RAG/usearch/NativeMethods.cs | 4 ++++ Runtime/RAG/usearch/USearchIndex.cs | 13 +++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Runtime/RAG/usearch/NativeMethods.cs b/Runtime/RAG/usearch/NativeMethods.cs index 34ba5898..9f38f04f 100644 --- a/Runtime/RAG/usearch/NativeMethods.cs +++ b/Runtime/RAG/usearch/NativeMethods.cs @@ -11,7 +11,11 @@ namespace Cloud.Unum.USearch { public static class NativeMethods { +#if UNITY_IOS + private const string LibraryName = "__Internal"; +#else private const string LibraryName = "libusearch_c"; +#endif [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl)] public static extern usearch_index_t usearch_init(ref IndexOptions options, out usearch_error_t error); diff --git a/Runtime/RAG/usearch/USearchIndex.cs b/Runtime/RAG/usearch/USearchIndex.cs index 9c9b39c4..9603e8ac 100644 --- a/Runtime/RAG/usearch/USearchIndex.cs +++ b/Runtime/RAG/usearch/USearchIndex.cs @@ -318,17 +318,10 @@ private int Search(T[] queryVector, int count, out ulong[] keys, out float[] } else { - if (Application.platform == RuntimePlatform.Android) + lock (filterLock) { - lock (filterLock) - { - FilterFunction = filter; - matches = checked((int)usearch_filtered_search(this._index, queryVectorPtr, scalarKind, (UIntPtr)count, StaticFilter, IntPtr.Zero, keys, distances, out error)); - } - } - else - { - matches = checked((int)usearch_filtered_search(this._index, queryVectorPtr, scalarKind, (UIntPtr)count, (int key, IntPtr state) => filter(key), IntPtr.Zero, keys, distances, out error)); + FilterFunction = filter; + matches = checked((int)usearch_filtered_search(this._index, queryVectorPtr, scalarKind, (UIntPtr)count, StaticFilter, IntPtr.Zero, keys, distances, out error)); } } HandleError(error); From bf0da80ed0391f68bd6ebff9186b61c56d75262b Mon Sep 17 00:00:00 2001 From: amakropoulos Date: Thu, 17 Jul 2025 21:46:40 +0000 Subject: [PATCH 2/3] update changelogs --- CHANGELOG.md | 6 ++++++ CHANGELOG.release.md | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fefb893..7e7d5a3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v2.5.3 +#### 🐛 Fixes + +- fix RAG for iOS (PR: #354) + + ## v2.5.2 #### 🚀 Features diff --git a/CHANGELOG.release.md b/CHANGELOG.release.md index 86892386..63729c46 100644 --- a/CHANGELOG.release.md +++ b/CHANGELOG.release.md @@ -1,5 +1,4 @@ -### 🚀 Features +### 🐛 Fixes -- Support Android x86-64 architecture (Magic Leap 2) (PR: #344) -- Combine ARM and Intel architectures of macOS (PR: #345) +- fix RAG for iOS (PR: #354) From a54a184e7e13cdf73d41ebbcb7150bd6b05f998e Mon Sep 17 00:00:00 2001 From: amakropoulos Date: Thu, 17 Jul 2025 21:46:59 +0000 Subject: [PATCH 3/3] update VERSION --- .github/doxygen/Doxyfile | 2 +- Runtime/LLMUnitySetup.cs | 2 +- VERSION | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/doxygen/Doxyfile b/.github/doxygen/Doxyfile index 067bc80c..c686eff2 100644 --- a/.github/doxygen/Doxyfile +++ b/.github/doxygen/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = "LLM for Unity" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v2.5.2 +PROJECT_NUMBER = v2.5.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/Runtime/LLMUnitySetup.cs b/Runtime/LLMUnitySetup.cs index afcb5010..b68092cf 100644 --- a/Runtime/LLMUnitySetup.cs +++ b/Runtime/LLMUnitySetup.cs @@ -101,7 +101,7 @@ public class LLMUnitySetup { // DON'T CHANGE! the version is autocompleted with a GitHub action /// LLM for Unity version - public static string Version = "v2.5.2"; + public static string Version = "v2.5.3"; /// LlamaLib version public static string LlamaLibVersion = "v1.2.6"; /// LlamaLib release url diff --git a/VERSION b/VERSION index f6dcb643..82f42e9d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.5.2 +v2.5.3 diff --git a/package.json b/package.json index 7095e04a..7bae12fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ai.undream.llm", - "version": "2.5.2", + "version": "2.5.3", "displayName": "LLM for Unity", "description": "LLM for Unity allows to run and distribute Large Language Models (LLMs) in the Unity engine.", "unity": "2022.3",