LangChain.js now supports calling JigsawStack Prompt Engine and more through the JigsawStack Tool.The JigsawStack Tool provides your agent with several capabilities:
JigsawStack Prompt Engine: Use JigsawStack’s advanced prompt engine to interact with large language models.
JigsawStackAIScrape: Scrape web content with AI-powered precision.
JigsawStackAISearch: Perform AI-powered web searches for high-quality results.
JigsawStackSpeechToText: Transcribe audio or video using the powerful large V3 Whisper model.
JigsawStackVOCR: Recognize and extract data from images via AI prompts.
JigsawStackTextToSQL: Generate SQL queries from natural language text.
import { JigsawStackPromptEngine } from "@langchain/jigsawstack";export const run = async () => { const model = new JigsawStackPromptEngine(); const res = await model.invoke( "Tell me about the leaning tower of pisa?\nAnswer:", ); console.log({ res });};
import { JigsawStackAIScrape, JigsawStackAISearch, JigsawStackSpeechToText, JigsawStackVOCR, JigsawStackTextToSQL,} from "@langchain/jigsawstack";// Example of AI Scrape Toolconst aiScrapeTool = new JigsawStackAIScrape({ params: { element_prompts: ["Pro plan"], },});const scrapeResult = await aiScrapeTool.invoke( "https://jigsawstack.com/pricing",);console.log({ scrapeResult });// Example of AI Search Toolconst aiSearchTool = new JigsawStackAISearch();const searchResult = await aiSearchTool.invoke("The leaning tower of Pisa");console.log({ searchResult });// Example of VOCR Toolconst vocrTool = new JigsawStackVOCR({ params: { prompt: "Describe the image in detail", },});const vocrResult = await vocrTool.invoke("https://link-to-image.jpg");console.log({ vocrResult });// Example of Speech-to-Text Toolconst sttTool = new JigsawStackSpeechToText();await sttTool.invoke("https://link-to-video.mp4");// Example of Text-to-SQL Toolconst sqlTool = new JigsawStackTextToSQL({ params: { sql_schema: "CREATE TABLE Transactions (transaction_id INT PRIMARY KEY, user_id INT NOT NULL, ... )", },});const sqlResult = await sqlTool.invoke( "Generate a query to get transactions exceeding $10,000.",);console.log({ sqlResult });