Skip to content

Commit

Permalink
Refactor crawl controller and crawl utility function for improved per…
Browse files Browse the repository at this point in the history
…formance and readability
  • Loading branch information
n4ze3m committed Jun 1, 2024
1 parent ddcdf8a commit c1f6c18
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@google-ai/generativelanguage": "^2.0.0",
"@grammyjs/files": "^1.0.4",
"@huggingface/inference": "1",
"@langchain/anthropic": "^0.1.4",
"@langchain/anthropic": "0.1.4",
"@langchain/cohere": "^0.0.6",
"@langchain/community": "^0.0.35",
"@langchain/google-genai": "^0.0.16",
Expand Down
2 changes: 1 addition & 1 deletion server/src/queue/controllers/crawl.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const crawlQueueController = async (source: QSource) => {
let maxLinks = source.maxLinks || 1;
const data = await crawl(source.content!, maxDepth, maxLinks);
const links = Array.from(data?.links || []);

for (const link of links) {
const newSource = await prisma.botSource.create({
data: {
Expand Down
2 changes: 1 addition & 1 deletion server/src/utils/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const chatModelProvider = (
modelName: modelName,
temperature: temperature,
...otherFields,
});
}) as any;
case "google-bison":
return new ChatGooglePaLM({
temperature: temperature,
Expand Down
8 changes: 4 additions & 4 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"

"@langchain/anthropic@^0.1.4":
"@langchain/[email protected]":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@langchain/anthropic/-/anthropic-0.1.4.tgz#49c2e4625860baea0b9b5035c4c7e93a81bed704"
integrity sha512-4i25R0dHx+8N7ofI0NGE02LKG9UkhRiAjFS5iNbRcByCSIoovAuTBvdEqpwbDnqn+NkORnP/Wyw3tqFeMtMgYA==
Expand Down Expand Up @@ -2997,9 +2997,9 @@ fast-uri@^2.0.0, fast-uri@^2.1.0:
integrity sha512-eel5UKGn369gGEWOqBShmFJWfq/xSJvsgDzgLYC845GneayWvXBf0lJCBn5qTABfewy1ZDPoaR5OZCP+kssfuw==

fast-xml-parser@^4.3.5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.3.5.tgz#e2f2a2ae8377e9c3dc321b151e58f420ca7e5ccc"
integrity sha512-sWvP1Pl8H03B8oFJpFR3HE31HUfwtX7Rlf9BNsvdpujD4n7WMhfmu8h9wOV2u+c1k0ZilTADhPqypzx2J690ZQ==
version "4.4.0"
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.4.0.tgz#341cc98de71e9ba9e651a67f41f1752d1441a501"
integrity sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg==
dependencies:
strnum "^1.0.5"

Expand Down

0 comments on commit c1f6c18

Please sign in to comment.