@o-lang/semantic-doc-search 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalizes vector search results for O-Lang workflows.
|
|
3
|
+
* Returns both structured matches AND a plain .text field for LLM prompts.
|
|
3
4
|
*/
|
|
4
5
|
function formatResults(results = [], query) {
|
|
6
|
+
// ✅ Generate plain text from all matches
|
|
7
|
+
const text = results.map(r => r.content).join('\n\n');
|
|
8
|
+
|
|
5
9
|
return {
|
|
6
10
|
query,
|
|
11
|
+
text, // ← THIS IS THE KEY ADDITION
|
|
7
12
|
matches: results.map(r => ({
|
|
8
13
|
id: r.id,
|
|
9
14
|
content: r.content,
|
|
@@ -17,4 +22,4 @@ function formatResults(results = [], query) {
|
|
|
17
22
|
|
|
18
23
|
module.exports = {
|
|
19
24
|
formatResults
|
|
20
|
-
};
|
|
25
|
+
};
|