nosible 0.2.6 → 0.2.10
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/README.md +0 -1
- package/package.json +4 -4
- package/src/client.test.ts +11 -28
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nosible",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "TypeScript client for the Nosible AI Search API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"typescript": "^5"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@duckdb/node-api": "^1.4.1-r.4",
|
|
44
43
|
"@types/lunr": "^2.3.7",
|
|
45
44
|
"@types/papaparse": "^5.3.16",
|
|
46
45
|
"apache-arrow": "^21.1.0",
|
|
47
46
|
"bottleneck": "^2.19.5",
|
|
48
|
-
"duckdb": "^1.4.1",
|
|
49
47
|
"lunr": "^2.3.9",
|
|
50
|
-
"nodejs-polars": "^0.22.1",
|
|
51
48
|
"openai": "^6.6.0",
|
|
52
49
|
"papaparse": "^5.4.1",
|
|
53
50
|
"simple-statistics": "^7.8.8",
|
|
54
51
|
"zod": "^4.1.12"
|
|
55
52
|
},
|
|
53
|
+
"optionalDependencies": {
|
|
54
|
+
"nodejs-polars": "^0.22.1"
|
|
55
|
+
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"nosible",
|
|
58
58
|
"ai",
|
package/src/client.test.ts
CHANGED
|
@@ -525,36 +525,19 @@ describe("NosibleClient", () => {
|
|
|
525
525
|
|
|
526
526
|
describe("scrapeUrl", () => {
|
|
527
527
|
it("should scrape content from a URL", async () => {
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
question: "technology news",
|
|
531
|
-
nResults: 10,
|
|
532
|
-
});
|
|
533
|
-
|
|
534
|
-
if (searchResultSet.results.length > 0) {
|
|
535
|
-
const firstResult = searchResultSet.results[0];
|
|
536
|
-
if (!firstResult) {
|
|
537
|
-
throw new Error("Expected first result to be defined");
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
const urlToScrape = firstResult.url;
|
|
528
|
+
const urlToScrape = "https://nosible.ghost.io";
|
|
529
|
+
const webPage = await client.scrapeUrl(urlToScrape);
|
|
541
530
|
|
|
542
|
-
|
|
531
|
+
expect(webPage).toBeDefined();
|
|
532
|
+
expect(webPage.data.request.url).toBe(urlToScrape);
|
|
533
|
+
expect(webPage.data.page.title).toBeDefined();
|
|
534
|
+
expect(webPage.data.full_text).toBeDefined();
|
|
535
|
+
expect(webPage.data.snippets).toBeDefined();
|
|
543
536
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
expect(webPage.data.full_text).toBeDefined();
|
|
549
|
-
expect(webPage.data.snippets).toBeDefined();
|
|
550
|
-
|
|
551
|
-
console.log(`Successfully scraped: ${webPage.data.page.title}`);
|
|
552
|
-
console.log(
|
|
553
|
-
`Content length: ${webPage.data.full_text.length} characters`
|
|
554
|
-
);
|
|
555
|
-
} else {
|
|
556
|
-
console.log("No URLs found to scrape");
|
|
557
|
-
}
|
|
537
|
+
console.log(`Successfully scraped: ${webPage.data.page.title}`);
|
|
538
|
+
console.log(
|
|
539
|
+
`Content length: ${webPage.data.full_text.length} characters`
|
|
540
|
+
);
|
|
558
541
|
}, 10000);
|
|
559
542
|
|
|
560
543
|
it("should handle invalid URLs gracefully", async () => {
|