-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 📦 NEW: Crawl function in SDK * 📦 NEW: Crawl example * 👌 IMPROVE: Crawl response type
- Loading branch information
1 parent
30a26c1
commit 93c7713
Showing
6 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ LANGBASE_SDK_GENERATE_PIPE="" | |
LANGBASE_SDK_CHAT_PIPE="" | ||
LANGBASE_API_KEY="" | ||
WEB_SEARCH_KEY="" | ||
CRAWL_KEY="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dotenv/config'; | ||
import {Langbase} from 'langbase'; | ||
|
||
const langbase = new Langbase({ | ||
apiKey: process.env.LANGBASE_API_KEY!, | ||
}); | ||
|
||
async function main() { | ||
const results = await langbase.tool.crawl({ | ||
url: ['https://langbase.com', 'https://langbase.com/about'], | ||
max_pages: 1, | ||
api_key: process.env.CRAWL_KEY, | ||
}); | ||
|
||
console.log(results); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,8 @@ | |
"stream-text": "npx tsx ./examples/pipes/stream-text.ts", | ||
"stream-text-generate-pipe": "npx tsx ./examples/pipes/stream-text-generate-pipe.ts", | ||
"stream-text-chat-pipe": "npx tsx ./examples/pipes/stream-text-chat-pipe.ts", | ||
"tools.web-search": "npx tsx ./examples/tools/web-search.ts" | ||
"tools.web-search": "npx tsx ./examples/tools/web-search.ts", | ||
"tools.crawl": "npx tsx ./examples/tools/crawl.ts" | ||
}, | ||
"keywords": [], | ||
"author": "Ahmad Awais <[email protected]> (https://twitter.com/MrAhmadAwais)", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,5 @@ npm run memory.docs.retry-embed | |
|
||
# tools | ||
npm run tools.web-search | ||
npm run tools.crawl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters