Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.
TypeScript ai-agentai-resume-analyzerapplication-trackerapplication-tracking-systematscareerjob-applicationjob-automationjob-huntingjob-searchjob-seeker-toolsjob-trackerjob-trackingjobsearchjobseekersmcpollamaresumeresume-reviewself-hosted
Upgrade langchain & refactor
Khuram Niazd2f2059dd951
diff --git a/__tests__/ai.actions.spec.ts b/__tests__/ai.actions.spec.tsnew file mode 100644index 0000000..cf98d03--- /dev/null+++ b/__tests__/ai.actions.spec.ts@@ -0,0 +1,448 @@+// @ts-nocheck - Mocking LangChain classes properly is complex, tests work correctly+// Mock LangChain modules BEFORE any imports+jest.mock("@langchain/openai");+jest.mock("@langchain/ollama");++// Mock AI utility functions+jest.mock("@/utils/ai.utils", () => ({+ convertResumeToText: jest.fn(),+ convertJobToText: jest.fn(),+}));++// Mock AI prompts+jest.mock("@/lib/ai.prompts", () => ({+ resumeReviewPrompt: {+ format: jest.fn(),+ },+ jobMatchPrompt: {+ format: jest.fn(),+ },+}));++import {+ getResumeReviewByOllama,+ getResumeReviewByOpenAi,+ getJobMatchByOllama,+ getJobMatchByOpenAi,+} from "@/actions/ai.actions";+import { Resume, SectionType } from "@/models/profile.model";+import { JobResponse } from "@/models/job.model";+import { ChatOpenAI } from "@langchain/openai";+import { ChatOllama } from "@langchain/ollama";+import { convertResumeToText, convertJobToText } from "@/utils/ai.utils";+import { resumeReviewPrompt, jobMatchPrompt } from "@/lib/ai.prompts";++// Type helpers for mocked classes+const MockedChatOllama = ChatOllama as unknown as jest.MockedClass<+ typeof ChatOllama+>;+const MockedChatOpenAI = ChatOpenAI as unknown as jest.MockedClass<+ typeof ChatOpenAI+>;+const MockedResumeReviewPrompt = resumeReviewPrompt as jest.Mocked<+ typeof resumeReviewPrompt+>;+const MockedJobMatchPrompt = jobMatchPrompt as jest.Mocked<+ typeof jobMatchPrompt+>;++describe("AI Actions", () => {+ // Mock data+ const mockResume: Resume = {+ id: "resume-1",+ profileId: "profile-1",+ title: "Software Engineer Resume",+ ContactInfo: {+ id: "contact-1",+ createdAt: new Date(),+ updatedAt: new Date(),+ resumeId: "resume-1",+ firstName: "John",+ lastName: "Doe",+ headline: "Senior Software Engineer",+ email: "[email protected]",+ phone: "+1234567890",+ address: "123 Main St, City, State",+ },+ ResumeSections: [+ {+ id: "section-1",+ resumeId: "resume-1",+ sectionTitle: "Summary",+ sectionType: SectionType.SUMMARY,+ summary: {+ id: "summary-1",+ content: "Experienced software engineer with 5+ years",+ },+ },+ ],+ };++ const mockJob: JobResponse = {+ id: "job-1",+ userId: "user-1",+ JobTitle: {+ id: "jt-1",+ label: "Senior Developer",+ value: "senior-developer",+ createdBy: "user-1",+ },+ Company: {+ id: "c-1",+ label: "Tech Corp",+ value: "tech-corp",+ createdBy: "user-1",+ },+ Status: { id: "s-1", label: "Applied", value: "applied" },+ Location: {+ id: "l-1",+ label: "San Francisco, CA",+ value: "sf-ca",+ createdBy: "user-1",+ },+ JobSource: { id: "js-1", label: "LinkedIn", value: "linkedin" },+ jobType: "Full-time",+ createdAt: new Date(),+ appliedDate: new Date(),+ dueDate: new Date(),+ salaryRange: "$100k-$150k",+ description: "<p>Looking for an experienced developer</p>",+ jobUrl: "https://example.com/job",+ applied: true,+ };++ const mockResumeText =+ "John Doe - Senior Software Engineer\nExperience: 5+ years";+ const mockJobText = "Senior Developer at Tech Corp\nSan Francisco, CA";++ beforeEach(() => {+ jest.clearAllMocks();++ // Setup mock implementations+ (convertResumeToText as jest.Mock).mockResolvedValue(mockResumeText);+ (convertJobToText as jest.Mock).mockResolvedValue(mockJobText);++ // Setup prompt mocks+ MockedResumeReviewPrompt.format.mockResolvedValue(+ "formatted resume prompt"+ );+ MockedJobMatchPrompt.format.mockResolvedValue("formatted job match prompt");++ // Mock environment variables+ process.env.OPENAI_API_KEY = "test-openai-key";+ process.env.OLLAMA_BASE_URL = "http://localhost:11434";+ });++ afterEach(() => {+ delete process.env.OPENAI_API_KEY;+ delete process.env.OLLAMA_BASE_URL;+ });++ describe("getResumeReviewByOllama", () => {+ it("should create ChatOllama model with correct configuration", async () => {+ const mockStream = createMockAsyncIterator([+ '{"summary": "Good resume"',+ ', "score": 85}',+ ]);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getResumeReviewByOllama(mockResume, "llama3.1");++ expect(ChatOllama).toHaveBeenCalledWith({+ baseUrl: "http://localhost:11434",+ model: "llama3.1",+ temperature: 0,+ format: "json",+ });+ });++ it("should use default baseUrl when OLLAMA_BASE_URL is not set", async () => {+ delete process.env.OLLAMA_BASE_URL;++ const mockStream = createMockAsyncIterator(['{"summary": "test"}']);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getResumeReviewByOllama(mockResume, "llama3.1");++ expect(ChatOllama).toHaveBeenCalledWith(+ expect.objectContaining({+ baseUrl: "http://127.0.0.1:11434",+ })+ );+ });++ it("should return a ReadableStream with encoded chunks", async () => {+ const mockChunkStrings = [+ '{"summary":',+ ' "Good resume",',+ ' "score": 85}',+ ];+ const mockChunks = mockChunkStrings.map((content) => ({ content }));+ const mockStream = createMockAsyncIterator(mockChunks);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ const result = await getResumeReviewByOllama(mockResume, "llama3.1");++ expect(result).toBeInstanceOf(ReadableStream);++ // Verify streaming functionality+ const reader = result!.getReader();+ const decoder = new TextDecoder();+ let fullText = "";++ while (true) {+ const { done, value } = await reader.read();+ if (done) break;+ fullText += decoder.decode(value);+ }++ expect(fullText).toBe(mockChunkStrings.join(""));+ });++ it("should convert resume to text before processing", async () => {+ const mockStream = createMockAsyncIterator(['{"summary": "test"}']);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getResumeReviewByOllama(mockResume, "llama3.1");++ expect(convertResumeToText).toHaveBeenCalledWith(mockResume);+ });+ });++ describe("getResumeReviewByOpenAi", () => {+ it("should create ChatOpenAI model with correct configuration", async () => {+ const mockStream = createMockAsyncIterator(['{"summary": "test"}']);++ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getResumeReviewByOpenAi(mockResume, "gpt-4");++ expect(ChatOpenAI).toHaveBeenCalledWith({+ model: "gpt-4",+ openAIApiKey: "test-openai-key",+ temperature: 0,+ maxConcurrency: 1,+ maxTokens: 3000,+ });+ });++ it("should return a ReadableStream with encoded chunks", async () => {+ const mockChunkStrings = ['{"summary":', ' "Excellent resume"}'];+ const mockChunks = mockChunkStrings.map((content) => ({ content }));+ const mockStream = createMockAsyncIterator(mockChunks);++ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ const result = await getResumeReviewByOpenAi(mockResume, "gpt-4");++ expect(result).toBeInstanceOf(ReadableStream);++ const reader = result!.getReader();+ const decoder = new TextDecoder();+ let fullText = "";++ while (true) {+ const { done, value } = await reader.read();+ if (done) break;+ fullText += decoder.decode(value);+ }++ expect(fullText).toBe(mockChunkStrings.join(""));+ });+ });++ describe("getJobMatchByOllama", () => {+ it("should create ChatOllama model with correct configuration", async () => {+ const mockStream = createMockAsyncIterator(['{"matching_score": 75}']);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getJobMatchByOllama(mockResume, mockJob, "llama3.1");++ expect(ChatOllama).toHaveBeenCalledWith({+ baseUrl: "http://localhost:11434",+ model: "llama3.1",+ temperature: 0,+ format: "json",+ maxConcurrency: 1,+ numCtx: 3000,+ });+ });++ it("should convert both resume and job to text", async () => {+ const mockStream = createMockAsyncIterator(['{"matching_score": 80}']);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getJobMatchByOllama(mockResume, mockJob, "llama3.1");++ expect(convertResumeToText).toHaveBeenCalledWith(mockResume);+ expect(convertJobToText).toHaveBeenCalledWith(mockJob);+ });++ it("should return a ReadableStream with job match results", async () => {+ const mockChunkStrings = [+ '{"matching_score":',+ " 85,",+ ' "suggestions": []}',+ ];+ const mockChunks = mockChunkStrings.map((content) => ({ content }));+ const mockStream = createMockAsyncIterator(mockChunks);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ const result = await getJobMatchByOllama(mockResume, mockJob, "llama3.1");++ expect(result).toBeInstanceOf(ReadableStream);++ const reader = result!.getReader();+ const decoder = new TextDecoder();+ let fullText = "";++ while (true) {+ const { done, value } = await reader.read();+ if (done) break;+ fullText += decoder.decode(value);+ }++ expect(fullText).toBe(mockChunkStrings.join(""));+ });+ });++ describe("getJobMatchByOpenAi", () => {+ it("should create ChatOpenAI model with correct configuration", async () => {+ const mockStream = createMockAsyncIterator(['{"matching_score": 90}']);++ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getJobMatchByOpenAi(mockResume, mockJob, "gpt-4");++ expect(ChatOpenAI).toHaveBeenCalledWith({+ model: "gpt-4",+ openAIApiKey: "test-openai-key",+ temperature: 0,+ maxConcurrency: 1,+ maxTokens: 3000,+ });+ });++ it("should convert both resume and job to text", async () => {+ const mockStream = createMockAsyncIterator(['{"matching_score": 88}']);++ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getJobMatchByOpenAi(mockResume, mockJob, "gpt-4");++ expect(convertResumeToText).toHaveBeenCalledWith(mockResume);+ expect(convertJobToText).toHaveBeenCalledWith(mockJob);+ });++ it("should format prompt with resume and job description", async () => {+ const mockStream = createMockAsyncIterator(['{"matching_score": 92}']);++ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ await getJobMatchByOpenAi(mockResume, mockJob, "gpt-4");++ expect(MockedJobMatchPrompt.format).toHaveBeenCalledWith({+ resume: mockResumeText,+ job_description: mockJobText,+ });+ });++ it("should return a ReadableStream with job match results", async () => {+ const mockChunkStrings = [+ '{"matching_score": 95,',+ ' "detailed_analysis": [],',+ ' "suggestions": []}',+ ];+ const mockChunks = mockChunkStrings.map((content) => ({ content }));+ const mockStream = createMockAsyncIterator(mockChunks);++ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ const result = await getJobMatchByOpenAi(mockResume, mockJob, "gpt-4");++ expect(result).toBeInstanceOf(ReadableStream);++ const reader = result!.getReader();+ const decoder = new TextDecoder();+ let fullText = "";++ while (true) {+ const { done, value } = await reader.read();+ if (done) break;+ fullText += decoder.decode(value);+ }++ expect(fullText).toBe(mockChunkStrings.join(""));+ });+ });++ describe("Prompt Template Usage", () => {+ it("should format prompts for all functions", async () => {+ const mockStream = createMockAsyncIterator(['{"test": "data"}']);++ MockedChatOllama.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));+ MockedChatOpenAI.mockImplementation(() => ({+ stream: jest.fn().mockResolvedValue(mockStream),+ }));++ // Test all four functions+ await getResumeReviewByOllama(mockResume, "llama3.1");+ await getResumeReviewByOpenAi(mockResume, "gpt-4");+ await getJobMatchByOllama(mockResume, mockJob, "llama3.1");+ await getJobMatchByOpenAi(mockResume, mockJob, "gpt-4");++ // Resume review should be called 2 times (Ollama and OpenAI)+ expect(MockedResumeReviewPrompt.format).toHaveBeenCalledTimes(2);+ // Job match should be called 2 times (Ollama and OpenAI)+ expect(MockedJobMatchPrompt.format).toHaveBeenCalledTimes(2);+ });+ });+});++/**+ * Helper function to create async iterator for mocking LangChain streams+ */+function createMockAsyncIterator<T>(items: T[]): AsyncIterable<T> {+ return {+ [Symbol.asyncIterator]: async function* () {+ for (const item of items) {+ yield item;+ }+ },+ };+}diff --git a/jest.config.ts b/jest.config.tsindex e678b8a..73ce9db 100644--- a/jest.config.ts+++ b/jest.config.ts@@ -15,6 +15,7 @@ const config: Config = {moduleNameMapper: {"^@/(.*)$": "<rootDir>/src/$1","^@prisma/client$": "<rootDir>/node_modules/@prisma/client",+ "^uuid$": require.resolve("uuid"),},setupFiles: ["<rootDir>/jest.polyfills.ts"],setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],@@ -191,7 +192,9 @@ const config: Config = {// transform: undefined,// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation- transformIgnorePatterns: ["/node_modules/(?!@prisma)"],+ transformIgnorePatterns: [+ "/node_modules/(?!(@prisma|@langchain|langchain|uuid)/)",+ ],// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them// unmockedModulePathPatterns: undefined,diff --git a/package-lock.json b/package-lock.jsonindex fa5a08d..b3107eb 100644--- a/package-lock.json+++ b/package-lock.json@@ -9,7 +9,8 @@"version": "0.1.0","dependencies": {"@hookform/resolvers": "^3.9.1",- "@langchain/community": "^0.2.18",+ "@langchain/core": "^1.1.7",+ "@langchain/ollama": "^1.1.0","@langchain/openai": "^0.2.1","@nivo/bar": "^0.99.0","@nivo/calendar": "^0.99.0",@@ -41,7 +42,6 @@"clsx": "^2.1.1","cmdk": "^1.0.0","date-fns": "^3.6.0",- "langchain": "^0.2.9","lucide-react": "^0.469.0","next": "^15.5.7","next-auth": "^5.0.0-beta.25",@@ -653,6 +653,12 @@"dev": true,"license": "MIT"},+ "node_modules/@cfworker/json-schema": {+ "version": "4.1.1",+ "resolved": "https://registry.npmjs.org/@cfworker/json-schema/-/json-schema-4.1.1.tgz",+ "integrity": "sha512-gAmrUZSGtKc3AiBL71iNWxDsyUC5uMaKKGdvzYsBoTW/xi42JQHl7eKV2OYzCUqvc+D2RCcf7EXY2iCyFIk6og==",+ "license": "MIT"+ },"node_modules/@cspotcode/source-map-support": {"version": "0.8.1","resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",@@ -1839,536 +1845,75 @@"@jridgewell/sourcemap-codec": "^1.4.14"}},- "node_modules/@langchain/community": {- "version": "0.2.33",- "resolved": "https://registry.npmjs.org/@langchain/community/-/community-0.2.33.tgz",- "integrity": "sha512-YsytROnBYoPqtUcV2In+afyLACzxwFrYRn7EBKYL7XWl3XNwrT85U1+nLM5b+MOjXvg9YfJSjrs1Tlbfy4st8g==",+ "node_modules/@langchain/core": {+ "version": "1.1.7",+ "resolved": "https://registry.npmjs.org/@langchain/core/-/core-1.1.7.tgz",+ "integrity": "sha512-NSZSi33+V/8RVv1szsUiX7u+jXVCDImr2VO74SiKgJrhyxXKdJcxa3HMPKwdU+tkgQ6T+R7wxVYQ1Cnd4Z48tA==","license": "MIT","dependencies": {- "@langchain/core": ">=0.2.21 <0.3.0",- "@langchain/openai": ">=0.2.0 <0.3.0",- "binary-extensions": "^2.2.0",- "expr-eval": "^2.0.2",- "flat": "^5.0.2",- "js-yaml": "^4.1.0",- "langchain": "~0.2.3",- "langsmith": "~0.1.30",+ "@cfworker/json-schema": "^4.0.2",+ "ansi-styles": "^5.0.0",+ "camelcase": "6",+ "decamelize": "1.2.0",+ "js-tiktoken": "^1.0.12",+ "langsmith": ">=0.4.0 <1.0.0",+ "mustache": "^4.2.0",+ "p-queue": "^6.6.2","uuid": "^10.0.0",- "zod": "^3.22.3",- "zod-to-json-schema": "^3.22.5"+ "zod": "^3.25.76 || ^4"},"engines": {- "node": ">=18"+ "node": ">=20"+ }+ },+ "node_modules/@langchain/core/node_modules/langsmith": {+ "version": "0.4.0",+ "resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.4.0.tgz",+ "integrity": "sha512-/X99fHBuBFFup778dNmgAVJMdFULz0S8yZUT1cD1RRSviMjxq1GZo8PulRR1ALDxpgYsJs8ueF9godUzF13LSw==",+ "license": "MIT",+ "dependencies": {+ "@types/uuid": "^10.0.0",+ "chalk": "^4.1.2",+ "console-table-printer": "^2.12.1",+ "p-queue": "^6.6.2",+ "semver": "^7.6.3",+ "uuid": "^10.0.0"},"peerDependencies": {- "@arcjet/redact": "^v1.0.0-alpha.23",- "@aws-crypto/sha256-js": "^5.0.0",- "@aws-sdk/client-bedrock-agent-runtime": "^3.583.0",- "@aws-sdk/client-bedrock-runtime": "^3.422.0",- "@aws-sdk/client-dynamodb": "^3.310.0",- "@aws-sdk/client-kendra": "^3.352.0",- "@aws-sdk/client-lambda": "^3.310.0",- "@aws-sdk/client-s3": "^3.310.0",- "@aws-sdk/client-sagemaker-runtime": "^3.310.0",- "@aws-sdk/client-sfn": "^3.310.0",- "@aws-sdk/credential-provider-node": "^3.388.0",- "@azure/search-documents": "^12.0.0",- "@azure/storage-blob": "^12.15.0",- "@browserbasehq/sdk": "*",- "@clickhouse/client": "^0.2.5",- "@cloudflare/ai": "*",- "@datastax/astra-db-ts": "^1.0.0",- "@elastic/elasticsearch": "^8.4.0",- "@getmetal/metal-sdk": "*",- "@getzep/zep-cloud": "^1.0.6",- "@getzep/zep-js": "^0.9.0",- "@gomomento/sdk": "^1.51.1",- "@gomomento/sdk-core": "^1.51.1",- "@google-ai/generativelanguage": "*",- "@google-cloud/storage": "^6.10.1 || ^7.7.0",- "@gradientai/nodejs-sdk": "^1.2.0",- "@huggingface/inference": "^2.6.4",- "@langchain/langgraph": "*",- "@layerup/layerup-security": "^1.5.12",- "@mendable/firecrawl-js": "^0.0.13",- "@mlc-ai/web-llm": "*",- "@mozilla/readability": "*",- "@neondatabase/serverless": "*",- "@notionhq/client": "^2.2.10",- "@opensearch-project/opensearch": "*",- "@pinecone-database/pinecone": "*",- "@planetscale/database": "^1.8.0",- "@premai/prem-sdk": "^0.3.25",- "@qdrant/js-client-rest": "^1.8.2",- "@raycast/api": "^1.55.2",- "@rockset/client": "^0.9.1",- "@smithy/eventstream-codec": "^2.0.5",- "@smithy/protocol-http": "^3.0.6",- "@smithy/signature-v4": "^2.0.10",- "@smithy/util-utf8": "^2.0.0",- "@spider-cloud/spider-client": "^0.0.21",- "@supabase/supabase-js": "^2.45.0",- "@tensorflow-models/universal-sentence-encoder": "*",- "@tensorflow/tfjs-converter": "*",- "@tensorflow/tfjs-core": "*",- "@upstash/ratelimit": "^1.1.3",- "@upstash/redis": "^1.20.6",- "@upstash/vector": "^1.1.1",- "@vercel/kv": "^0.2.3",- "@vercel/postgres": "^0.5.0",- "@writerai/writer-sdk": "^0.40.2",- "@xata.io/client": "^0.28.0",- "@xenova/transformers": "^2.17.2",- "@zilliz/milvus2-sdk-node": ">=2.3.5",- "apify-client": "^2.7.1",- "assemblyai": "^4.6.0",- "better-sqlite3": ">=9.4.0 <12.0.0",- "cassandra-driver": "^4.7.2",- "cborg": "^4.1.1",- "cheerio": "^1.0.0-rc.12",- "chromadb": "*",- "closevector-common": "0.1.3",- "closevector-node": "0.1.6",- "closevector-web": "0.1.6",- "cohere-ai": "*",- "convex": "^1.3.1",- "couchbase": "^4.3.0",- "crypto-js": "^4.2.0",- "d3-dsv": "^2.0.0",- "discord.js": "^14.14.1",- "dria": "^0.0.3",- "duck-duck-scrape": "^2.2.5",- "epub2": "^3.0.1",- "faiss-node": "^0.5.1",- "firebase-admin": "^11.9.0 || ^12.0.0",- "google-auth-library": "*",- "googleapis": "*",- "hnswlib-node": "^3.0.0",- "html-to-text": "^9.0.5",- "ignore": "^5.2.0",- "interface-datastore": "^8.2.11",- "ioredis": "^5.3.2",- "it-all": "^3.0.4",- "jsdom": "*",- "jsonwebtoken": "^9.0.2",- "llmonitor": "^0.5.9",- "lodash": "^4.17.21",- "lunary": "^0.7.10",- "mammoth": "^1.6.0",- "mongodb": ">=5.2.0",- "mysql2": "^3.9.8",- "neo4j-driver": "*",- "node-llama-cpp": "*",- "notion-to-md": "^3.1.0",- "officeparser": "^4.0.4",- "pdf-parse": "1.1.1",- "pg": "^8.11.0",- "pg-copy-streams": "^6.0.5",- "pickleparser": "^0.2.1",- "playwright": "^1.32.1",- "portkey-ai": "^0.1.11",- "puppeteer": "*",- "redis": "*",- "replicate": "^0.29.4",- "sonix-speech-recognition": "^2.1.1",- "srt-parser-2": "^1.2.3",- "typeorm": "^0.3.20",- "typesense": "^1.5.3",- "usearch": "^1.1.1",- "vectordb": "^0.1.4",- "voy-search": "0.6.2",- "weaviate-ts-client": "*",- "web-auth-library": "^1.0.3",- "ws": "^8.14.2",- "youtube-transcript": "^1.0.6",- "youtubei.js": "^9.1.0"+ "@opentelemetry/api": "*",+ "@opentelemetry/exporter-trace-otlp-proto": "*",+ "@opentelemetry/sdk-trace-base": "*",+ "openai": "*"},"peerDependenciesMeta": {- "@arcjet/redact": {- "optional": true- },- "@aws-crypto/sha256-js": {- "optional": true- },- "@aws-sdk/client-bedrock-agent-runtime": {- "optional": true- },- "@aws-sdk/client-bedrock-runtime": {- "optional": true- },- "@aws-sdk/client-dynamodb": {- "optional": true- },- "@aws-sdk/client-kendra": {- "optional": true- },- "@aws-sdk/client-lambda": {- "optional": true- },- "@aws-sdk/client-s3": {- "optional": true- },- "@aws-sdk/client-sagemaker-runtime": {- "optional": true- },- "@aws-sdk/client-sfn": {- "optional": true- },- "@aws-sdk/credential-provider-node": {- "optional": true- },- "@azure/search-documents": {- "optional": true- },- "@azure/storage-blob": {- "optional": true- },- "@browserbasehq/sdk": {- "optional": true- },- "@clickhouse/client": {- "optional": true- },- "@cloudflare/ai": {- "optional": true- },- "@datastax/astra-db-ts": {- "optional": true- },- "@elastic/elasticsearch": {- "optional": true- },- "@getmetal/metal-sdk": {- "optional": true- },- "@getzep/zep-cloud": {- "optional": true- },- "@getzep/zep-js": {- "optional": true- },- "@gomomento/sdk": {- "optional": true- },- "@gomomento/sdk-core": {- "optional": true- },- "@google-ai/generativelanguage": {- "optional": true- },- "@google-cloud/storage": {- "optional": true- },- "@gradientai/nodejs-sdk": {- "optional": true- },- "@huggingface/inference": {- "optional": true- },- "@langchain/langgraph": {- "optional": true- },- "@layerup/layerup-security": {- "optional": true- },- "@mendable/firecrawl-js": {- "optional": true- },- "@mlc-ai/web-llm": {- "optional": true- },- "@mozilla/readability": {- "optional": true- },- "@neondatabase/serverless": {- "optional": true- },- "@notionhq/client": {- "optional": true- },- "@opensearch-project/opensearch": {- "optional": true- },- "@pinecone-database/pinecone": {- "optional": true- },- "@planetscale/database": {- "optional": true- },- "@premai/prem-sdk": {- "optional": true- },- "@qdrant/js-client-rest": {- "optional": true- },- "@raycast/api": {- "optional": true- },- "@rockset/client": {- "optional": true- },- "@smithy/eventstream-codec": {- "optional": true- },- "@smithy/protocol-http": {- "optional": true- },- "@smithy/signature-v4": {- "optional": true- },- "@smithy/util-utf8": {- "optional": true- },- "@spider-cloud/spider-client": {- "optional": true- },- "@supabase/supabase-js": {- "optional": true- },- "@tensorflow-models/universal-sentence-encoder": {- "optional": true- },- "@tensorflow/tfjs-converter": {- "optional": true- },- "@tensorflow/tfjs-core": {- "optional": true- },- "@upstash/ratelimit": {- "optional": true- },- "@upstash/redis": {- "optional": true- },- "@upstash/vector": {- "optional": true- },- "@vercel/kv": {- "optional": true- },- "@vercel/postgres": {- "optional": true- },- "@writerai/writer-sdk": {- "optional": true- },- "@xata.io/client": {- "optional": true- },- "@xenova/transformers": {- "optional": true- },- "@zilliz/milvus2-sdk-node": {- "optional": true- },- "apify-client": {- "optional": true- },- "assemblyai": {- "optional": true- },- "better-sqlite3": {- "optional": true- },- "cassandra-driver": {- "optional": true- },- "cborg": {- "optional": true- },- "cheerio": {- "optional": true- },- "chromadb": {- "optional": true- },- "closevector-common": {- "optional": true- },- "closevector-node": {- "optional": true- },- "closevector-web": {- "optional": true- },- "cohere-ai": {- "optional": true- },- "convex": {- "optional": true- },- "couchbase": {- "optional": true- },- "crypto-js": {- "optional": true- },- "d3-dsv": {- "optional": true- },- "discord.js": {- "optional": true- },- "dria": {- "optional": true- },- "duck-duck-scrape": {- "optional": true- },- "epub2": {- "optional": true- },- "faiss-node": {- "optional": true- },- "firebase-admin": {- "optional": true- },- "google-auth-library": {- "optional": true- },- "googleapis": {- "optional": true- },- "hnswlib-node": {- "optional": true- },- "html-to-text": {- "optional": true- },- "ignore": {- "optional": true- },- "interface-datastore": {- "optional": true- },- "ioredis": {- "optional": true- },- "it-all": {- "optional": true- },- "jsdom": {- "optional": true- },- "jsonwebtoken": {- "optional": true- },- "llmonitor": {- "optional": true- },- "lodash": {- "optional": true- },- "lunary": {- "optional": true- },- "mammoth": {- "optional": true- },- "mongodb": {- "optional": true- },- "mysql2": {- "optional": true- },- "neo4j-driver": {- "optional": true- },- "node-llama-cpp": {- "optional": true- },- "notion-to-md": {- "optional": true- },- "officeparser": {- "optional": true- },- "pdf-parse": {- "optional": true- },- "pg": {- "optional": true- },- "pg-copy-streams": {- "optional": true- },- "pickleparser": {- "optional": true- },- "playwright": {- "optional": true- },- "portkey-ai": {- "optional": true- },- "puppeteer": {- "optional": true- },- "redis": {- "optional": true- },- "replicate": {- "optional": true- },- "sonix-speech-recognition": {- "optional": true- },- "srt-parser-2": {- "optional": true- },- "typeorm": {- "optional": true- },- "typesense": {- "optional": true- },- "usearch": {- "optional": true- },- "vectordb": {- "optional": true- },- "voy-search": {- "optional": true- },- "weaviate-ts-client": {- "optional": true- },- "web-auth-library": {+ "@opentelemetry/api": {"optional": true},- "ws": {+ "@opentelemetry/exporter-trace-otlp-proto": {"optional": true},- "youtube-transcript": {+ "@opentelemetry/sdk-trace-base": {"optional": true},- "youtubei.js": {+ "openai": {"optional": true}}},- "node_modules/@langchain/core": {- "version": "0.2.36",- "resolved": "https://registry.npmjs.org/@langchain/core/-/core-0.2.36.tgz",- "integrity": "sha512-qHLvScqERDeH7y2cLuJaSAlMwg3f/3Oc9nayRSXRU2UuaK/SOhI42cxiPLj1FnuHJSmN0rBQFkrLx02gI4mcVg==",+ "node_modules/@langchain/ollama": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@langchain/ollama/-/ollama-1.1.0.tgz",+ "integrity": "sha512-kEP0zvj+xtJ84QcK1ALKkz71ynpWMgzXbASzabMhkRAMSN/wTVm28HUNPRDHxbS9+BZnq1zcZeuzOf29XCal5g==","license": "MIT","dependencies": {- "ansi-styles": "^5.0.0",- "camelcase": "6",- "decamelize": "1.2.0",- "js-tiktoken": "^1.0.12",- "langsmith": "^0.1.56-rc.1",- "mustache": "^4.2.0",- "p-queue": "^6.6.2",- "p-retry": "4",- "uuid": "^10.0.0",- "zod": "^3.22.4",- "zod-to-json-schema": "^3.22.3"+ "ollama": "^0.6.3",+ "uuid": "^10.0.0"},"engines": {- "node": ">=18"+ "node": ">=20"+ },+ "peerDependencies": {+ "@langchain/core": "^1.0.0"}},"node_modules/@langchain/openai": {@@ -2387,14 +1932,23 @@"node": ">=18"}},- "node_modules/@langchain/textsplitters": {- "version": "0.0.3",- "resolved": "https://registry.npmjs.org/@langchain/textsplitters/-/textsplitters-0.0.3.tgz",- "integrity": "sha512-cXWgKE3sdWLSqAa8ykbCcUsUF1Kyr5J3HOWYGuobhPEycXW4WI++d5DhzdpL238mzoEXTi90VqfSCra37l5YqA==",+ "node_modules/@langchain/openai/node_modules/@langchain/core": {+ "version": "0.2.36",+ "resolved": "https://registry.npmjs.org/@langchain/core/-/core-0.2.36.tgz",+ "integrity": "sha512-qHLvScqERDeH7y2cLuJaSAlMwg3f/3Oc9nayRSXRU2UuaK/SOhI42cxiPLj1FnuHJSmN0rBQFkrLx02gI4mcVg==","license": "MIT","dependencies": {- "@langchain/core": ">0.2.0 <0.3.0",- "js-tiktoken": "^1.0.12"+ "ansi-styles": "^5.0.0",+ "camelcase": "6",+ "decamelize": "1.2.0",+ "js-tiktoken": "^1.0.12",+ "langsmith": "^0.1.56-rc.1",+ "mustache": "^4.2.0",+ "p-queue": "^6.6.2",+ "p-retry": "4",+ "uuid": "^10.0.0",+ "zod": "^3.22.4",+ "zod-to-json-schema": "^3.22.3"},"engines": {"node": ">=18"@@ -4865,7 +4419,7 @@"version": "2.0.0","resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz","integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==",- "devOptional": true,+ "dev": true,"license": "MIT","engines": {"node": ">= 10"@@ -5978,7 +5532,7 @@"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz","integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==","deprecated": "Use your platform's native atob() and btoa() methods instead",- "devOptional": true,+ "dev": true,"license": "BSD-3-Clause"},"node_modules/abort-controller": {@@ -5997,7 +5551,7 @@"version": "8.15.0","resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz","integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",- "devOptional": true,+ "dev": true,"license": "MIT","bin": {"acorn": "bin/acorn"@@ -6010,7 +5564,7 @@"version": "7.0.1","resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz","integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"acorn": "^8.1.0",@@ -6031,7 +5585,7 @@"version": "8.3.4","resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz","integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"acorn": "^8.11.0"@@ -6044,7 +5598,7 @@"version": "6.0.2","resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz","integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"debug": "4"@@ -6824,7 +6378,6 @@"version": "4.1.2","resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz","integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",- "dev": true,"license": "MIT","dependencies": {"ansi-styles": "^4.1.0",@@ -6841,7 +6394,6 @@"version": "4.3.0","resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",- "dev": true,"license": "MIT","dependencies": {"color-convert": "^2.0.1"@@ -6992,7 +6544,6 @@"version": "2.0.1","resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",- "dev": true,"license": "MIT","dependencies": {"color-name": "~1.1.4"@@ -7005,7 +6556,6 @@"version": "1.1.4","resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",- "dev": true,"license": "MIT"},"node_modules/combined-stream": {@@ -7053,6 +6603,15 @@"node": "^14.18.0 || >=16.10.0"}},+ "node_modules/console-table-printer": {+ "version": "2.15.0",+ "resolved": "https://registry.npmjs.org/console-table-printer/-/console-table-printer-2.15.0.tgz",+ "integrity": "sha512-SrhBq4hYVjLCkBVOWaTzceJalvn5K1Zq5aQA6wXC/cYjI3frKWNPEMK3sZsJfNNQApvCQmgBcc13ZKmFj8qExw==",+ "license": "MIT",+ "dependencies": {+ "simple-wcswidth": "^1.1.2"+ }+ },"node_modules/convert-source-map": {"version": "2.0.0","resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",@@ -7133,14 +6692,14 @@"version": "0.5.0","resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz","integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/cssstyle": {"version": "2.3.0","resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz","integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"cssom": "~0.3.6"@@ -7153,7 +6712,7 @@"version": "0.3.8","resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz","integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/csstype": {@@ -7307,7 +6866,7 @@"version": "3.0.2","resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz","integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"abab": "^2.0.6",@@ -7392,7 +6951,7 @@"version": "4.4.3","resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz","integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"ms": "^2.1.3"@@ -7419,7 +6978,7 @@"version": "10.6.0","resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz","integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/decimal.js-light": {@@ -7632,7 +7191,7 @@"resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz","integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==","deprecated": "Use your platform's native DOMException instead",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"webidl-conversions": "^7.0.0"@@ -7720,7 +7279,7 @@"version": "6.0.1","resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz","integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",- "devOptional": true,+ "dev": true,"license": "BSD-2-Clause","engines": {"node": ">=0.12"@@ -7938,7 +7497,7 @@"version": "2.1.0","resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz","integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",- "devOptional": true,+ "dev": true,"license": "BSD-2-Clause","dependencies": {"esprima": "^4.0.1",@@ -8362,7 +7921,7 @@"version": "4.0.1","resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz","integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",- "devOptional": true,+ "dev": true,"license": "BSD-2-Clause","bin": {"esparse": "bin/esparse.js",@@ -8402,7 +7961,7 @@"version": "5.3.0","resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz","integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",- "devOptional": true,+ "dev": true,"license": "BSD-2-Clause","engines": {"node": ">=4.0"@@ -8412,7 +7971,7 @@"version": "2.0.3","resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz","integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",- "devOptional": true,+ "dev": true,"license": "BSD-2-Clause","engines": {"node": ">=0.10.0"@@ -8483,12 +8042,6 @@"node": "^14.15.0 || ^16.10.0 || >=18.0.0"}},- "node_modules/expr-eval": {- "version": "2.0.2",- "resolved": "https://registry.npmjs.org/expr-eval/-/expr-eval-2.0.2.tgz",- "integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg==",- "license": "MIT"- },"node_modules/exsolve": {"version": "1.0.8","resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz",@@ -8656,15 +8209,6 @@"url": "https://github.com/sponsors/sindresorhus"}},- "node_modules/flat": {- "version": "5.0.2",- "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",- "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",- "license": "BSD-3-Clause",- "bin": {- "flat": "cli.js"- }- },"node_modules/flat-cache": {"version": "3.2.0","resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",@@ -9044,7 +8588,7 @@"version": "4.7.8","resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz","integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"minimist": "^1.2.5",@@ -9079,7 +8623,6 @@"version": "4.0.0","resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz","integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",- "dev": true,"license": "MIT","engines": {"node": ">=8"@@ -9157,7 +8700,7 @@"version": "3.0.0","resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz","integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"whatwg-encoding": "^2.0.0"@@ -9177,7 +8720,7 @@"version": "5.0.0","resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz","integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"@tootallnate/once": "2",@@ -9192,7 +8735,7 @@"version": "5.0.1","resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz","integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"agent-base": "6",@@ -9225,7 +8768,7 @@"version": "0.6.3","resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz","integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"safer-buffer": ">= 2.1.2 < 3.0.0"@@ -9238,7 +8781,7 @@"version": "5.3.2","resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz","integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",- "devOptional": true,+ "dev": true,"license": "MIT","engines": {"node": ">= 4"@@ -9650,7 +9193,7 @@"version": "1.0.1","resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz","integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/is-regex": {@@ -10563,6 +10106,7 @@"version": "4.1.1","resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz","integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",+ "dev": true,"license": "MIT","dependencies": {"argparse": "^2.0.1"@@ -10575,7 +10119,7 @@"version": "20.0.3","resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz","integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"abab": "^2.0.6",@@ -10671,15 +10215,6 @@"node": ">=6"}},- "node_modules/jsonpointer": {- "version": "5.0.1",- "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz",- "integrity": "sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==",- "license": "MIT",- "engines": {- "node": ">=0.10.0"- }- },"node_modules/jsx-ast-utils": {"version": "3.3.5","resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz",@@ -10716,266 +10251,6 @@"node": ">=6"}},- "node_modules/langchain": {- "version": "0.2.20",- "resolved": "https://registry.npmjs.org/langchain/-/langchain-0.2.20.tgz",- "integrity": "sha512-tbels6Rr524iMM3VOQ4aTGnEOOjAA1BQuBR8u/8gJ2yT48lMtIQRAN32Y4KVjKK+hEWxHHlmLBrtgLpTphFjNA==",- "license": "MIT",- "dependencies": {- "@langchain/core": ">=0.2.21 <0.3.0",- "@langchain/openai": ">=0.1.0 <0.3.0",- "@langchain/textsplitters": "~0.0.0",- "binary-extensions": "^2.2.0",- "js-tiktoken": "^1.0.12",- "js-yaml": "^4.1.0",- "jsonpointer": "^5.0.1",- "langsmith": "^0.1.56-rc.1",- "openapi-types": "^12.1.3",- "p-retry": "4",- "uuid": "^10.0.0",- "yaml": "^2.2.1",- "zod": "^3.22.4",- "zod-to-json-schema": "^3.22.3"- },- "engines": {- "node": ">=18"- },- "peerDependencies": {- "@aws-sdk/client-s3": "*",- "@aws-sdk/client-sagemaker-runtime": "*",- "@aws-sdk/client-sfn": "*",- "@aws-sdk/credential-provider-node": "*",- "@azure/storage-blob": "*",- "@browserbasehq/sdk": "*",- "@gomomento/sdk": "*",- "@gomomento/sdk-core": "*",- "@gomomento/sdk-web": "^1.51.1",- "@langchain/anthropic": "*",- "@langchain/aws": "*",- "@langchain/cohere": "*",- "@langchain/google-genai": "*",- "@langchain/google-vertexai": "*",- "@langchain/groq": "*",- "@langchain/mistralai": "*",- "@langchain/ollama": "*",- "@mendable/firecrawl-js": "*",- "@notionhq/client": "*",- "@pinecone-database/pinecone": "*",- "@supabase/supabase-js": "*",- "@vercel/kv": "*",- "@xata.io/client": "*",- "apify-client": "*",- "assemblyai": "*",- "axios": "*",- "cheerio": "*",- "chromadb": "*",- "convex": "*",- "couchbase": "*",- "d3-dsv": "*",- "epub2": "*",- "fast-xml-parser": "*",- "handlebars": "^4.7.8",- "html-to-text": "*",- "ignore": "*",- "ioredis": "*",- "jsdom": "*",- "mammoth": "*",- "mongodb": "*",- "node-llama-cpp": "*",- "notion-to-md": "*",- "officeparser": "*",- "pdf-parse": "*",- "peggy": "^3.0.2",- "playwright": "*",- "puppeteer": "*",- "pyodide": ">=0.24.1 <0.27.0",- "redis": "*",- "sonix-speech-recognition": "*",- "srt-parser-2": "*",- "typeorm": "*",- "weaviate-ts-client": "*",- "web-auth-library": "*",- "ws": "*",- "youtube-transcript": "*",- "youtubei.js": "*"- },- "peerDependenciesMeta": {- "@aws-sdk/client-s3": {- "optional": true- },- "@aws-sdk/client-sagemaker-runtime": {- "optional": true- },- "@aws-sdk/client-sfn": {- "optional": true- },- "@aws-sdk/credential-provider-node": {- "optional": true- },- "@azure/storage-blob": {- "optional": true- },- "@browserbasehq/sdk": {- "optional": true- },- "@gomomento/sdk": {- "optional": true- },- "@gomomento/sdk-core": {- "optional": true- },- "@gomomento/sdk-web": {- "optional": true- },- "@langchain/anthropic": {- "optional": true- },- "@langchain/aws": {- "optional": true- },- "@langchain/cohere": {- "optional": true- },- "@langchain/google-genai": {- "optional": true- },- "@langchain/google-vertexai": {- "optional": true- },- "@langchain/groq": {- "optional": true- },- "@langchain/mistralai": {- "optional": true- },- "@langchain/ollama": {- "optional": true- },- "@mendable/firecrawl-js": {- "optional": true- },- "@notionhq/client": {- "optional": true- },- "@pinecone-database/pinecone": {- "optional": true- },- "@supabase/supabase-js": {- "optional": true- },- "@vercel/kv": {- "optional": true- },- "@xata.io/client": {- "optional": true- },- "apify-client": {- "optional": true- },- "assemblyai": {- "optional": true- },- "axios": {- "optional": true- },- "cheerio": {- "optional": true- },- "chromadb": {- "optional": true- },- "convex": {- "optional": true- },- "couchbase": {- "optional": true- },- "d3-dsv": {- "optional": true- },- "epub2": {- "optional": true- },- "faiss-node": {- "optional": true- },- "fast-xml-parser": {- "optional": true- },- "handlebars": {- "optional": true- },- "html-to-text": {- "optional": true- },- "ignore": {- "optional": true- },- "ioredis": {- "optional": true- },- "jsdom": {- "optional": true- },- "mammoth": {- "optional": true- },- "mongodb": {- "optional": true- },- "node-llama-cpp": {- "optional": true- },- "notion-to-md": {- "optional": true- },- "officeparser": {- "optional": true- },- "pdf-parse": {- "optional": true- },- "peggy": {- "optional": true- },- "playwright": {- "optional": true- },- "puppeteer": {- "optional": true- },- "pyodide": {- "optional": true- },- "redis": {- "optional": true- },- "sonix-speech-recognition": {- "optional": true- },- "srt-parser-2": {- "optional": true- },- "typeorm": {- "optional": true- },- "weaviate-ts-client": {- "optional": true- },- "web-auth-library": {- "optional": true- },- "ws": {- "optional": true- },- "youtube-transcript": {- "optional": true- },- "youtubei.js": {- "optional": true- }- }- },"node_modules/langsmith": {"version": "0.1.68","resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.1.68.tgz",@@ -11322,7 +10597,7 @@"version": "1.2.8","resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz","integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",- "devOptional": true,+ "dev": true,"license": "MIT","funding": {"url": "https://github.com/sponsors/ljharb"@@ -11399,7 +10674,7 @@"version": "2.6.2","resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz","integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/next": {@@ -11628,7 +10903,7 @@"version": "2.2.23","resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz","integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/nypm": {@@ -11798,6 +11073,15 @@"devOptional": true,"license": "MIT"},+ "node_modules/ollama": {+ "version": "0.6.3",+ "resolved": "https://registry.npmjs.org/ollama/-/ollama-0.6.3.tgz",+ "integrity": "sha512-KEWEhIqE5wtfzEIZbDCLH51VFZ6Z3ZSa6sIOg/E/tBV8S51flyqBOXi+bRxlOYKDf8i327zG9eSTb8IJxvm3Zg==",+ "license": "MIT",+ "dependencies": {+ "whatwg-fetch": "^3.6.20"+ }+ },"node_modules/once": {"version": "1.4.0","resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",@@ -11869,12 +11153,6 @@"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==","license": "MIT"},- "node_modules/openapi-types": {- "version": "12.1.3",- "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz",- "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==",- "license": "MIT"- },"node_modules/optionator": {"version": "0.9.4","resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",@@ -12051,7 +11329,7 @@"version": "7.3.0","resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz","integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"entities": "^6.0.0"@@ -12740,7 +12018,7 @@"version": "1.15.0","resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz","integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"punycode": "^2.3.1"@@ -12753,7 +12031,7 @@"version": "2.3.1","resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz","integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",- "devOptional": true,+ "dev": true,"license": "MIT","engines": {"node": ">=6"@@ -12789,7 +12067,7 @@"version": "2.2.0","resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz","integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/queue-microtask": {@@ -13134,7 +12412,7 @@"version": "1.0.0","resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz","integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/resolve": {@@ -13334,14 +12612,14 @@"version": "2.1.2","resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz","integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/saxes": {"version": "6.0.0","resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz","integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",- "devOptional": true,+ "dev": true,"license": "ISC","dependencies": {"xmlchars": "^2.2.0"@@ -13568,6 +12846,12 @@"dev": true,"license": "ISC"},+ "node_modules/simple-wcswidth": {+ "version": "1.1.2",+ "resolved": "https://registry.npmjs.org/simple-wcswidth/-/simple-wcswidth-1.1.2.tgz",+ "integrity": "sha512-j7piyCjAeTDSjzTSQ7DokZtMNwNlEAyxqSZeCS+CXH7fJ4jx3FuJ/mTW3mE+6JLs4VJBbcll0Kjn+KXI5t21Iw==",+ "license": "MIT"+ },"node_modules/sisteransi": {"version": "1.0.5","resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",@@ -13589,7 +12873,7 @@"version": "0.6.1","resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",- "devOptional": true,+ "dev": true,"license": "BSD-3-Clause","engines": {"node": ">=0.10.0"@@ -13932,7 +13216,6 @@"version": "7.2.0","resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz","integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",- "dev": true,"license": "MIT","dependencies": {"has-flag": "^4.0.0"@@ -13957,7 +13240,7 @@"version": "3.2.4","resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz","integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/tailwind-merge": {@@ -14220,7 +13503,7 @@"version": "4.1.4","resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz","integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==",- "devOptional": true,+ "dev": true,"license": "BSD-3-Clause","dependencies": {"psl": "^1.1.33",@@ -14236,7 +13519,7 @@"version": "3.0.0","resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz","integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"punycode": "^2.1.1"@@ -14600,7 +13883,7 @@"version": "0.2.0","resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz","integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",- "devOptional": true,+ "dev": true,"license": "MIT","engines": {"node": ">= 4.0.0"@@ -14686,7 +13969,7 @@"version": "1.5.10","resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz","integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"querystringify": "^2.1.1",@@ -14848,7 +14131,7 @@"version": "4.0.0","resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz","integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"xml-name-validator": "^4.0.0"@@ -14880,7 +14163,7 @@"version": "7.0.0","resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz","integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",- "devOptional": true,+ "dev": true,"license": "BSD-2-Clause","engines": {"node": ">=12"@@ -14890,7 +14173,7 @@"version": "2.0.0","resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz","integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"iconv-lite": "0.6.3"@@ -14899,11 +14182,17 @@"node": ">=12"}},+ "node_modules/whatwg-fetch": {+ "version": "3.6.20",+ "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz",+ "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==",+ "license": "MIT"+ },"node_modules/whatwg-mimetype": {"version": "3.0.0","resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz","integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==",- "devOptional": true,+ "dev": true,"license": "MIT","engines": {"node": ">=12"@@ -14913,7 +14202,7 @@"version": "11.0.0","resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz","integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==",- "devOptional": true,+ "dev": true,"license": "MIT","dependencies": {"tr46": "^3.0.0",@@ -15042,7 +14331,7 @@"version": "1.0.0","resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz","integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/wrap-ansi": {@@ -15126,7 +14415,7 @@"version": "4.0.0","resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz","integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==",- "devOptional": true,+ "dev": true,"license": "Apache-2.0","engines": {"node": ">=12"@@ -15136,7 +14425,7 @@"version": "2.2.0","resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz","integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",- "devOptional": true,+ "dev": true,"license": "MIT"},"node_modules/y18n": {@@ -15161,6 +14450,8 @@"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz","integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==","license": "ISC",+ "optional": true,+ "peer": true,"bin": {"yaml": "bin.mjs"},diff --git a/package.json b/package.jsonindex 096e0a5..dc24e79 100644--- a/package.json+++ b/package.json@@ -14,7 +14,8 @@},"dependencies": {"@hookform/resolvers": "^3.9.1",- "@langchain/community": "^0.2.18",+ "@langchain/core": "^1.1.7",+ "@langchain/ollama": "^1.1.0","@langchain/openai": "^0.2.1","@nivo/bar": "^0.99.0","@nivo/calendar": "^0.99.0",@@ -46,7 +47,6 @@"clsx": "^2.1.1","cmdk": "^1.0.0","date-fns": "^3.6.0",- "langchain": "^0.2.9","lucide-react": "^0.469.0","next": "^15.5.7","next-auth": "^5.0.0-beta.25",diff --git a/src/actions/ai.actions.ts b/src/actions/ai.actions.tsindex 1723120..45aad32 100644--- a/src/actions/ai.actions.ts+++ b/src/actions/ai.actions.ts@@ -1,12 +1,8 @@"use server";import { ChatOpenAI } from "@langchain/openai";-import { ChatOllama } from "@langchain/community/chat_models/ollama";-import {- StringOutputParser,- StructuredOutputParser,-} from "@langchain/core/output_parsers";-import { ChatPromptTemplate } from "@langchain/core/prompts";+import { ChatOllama } from "@langchain/ollama";+import { resumeReviewPrompt, jobMatchPrompt } from "@/lib/ai.prompts";import { Resume } from "@/models/profile.model";import { JobResponse } from "@/models/job.model";import { convertJobToText, convertResumeToText } from "@/utils/ai.utils";@@ -15,32 +11,10 @@ export const getResumeReviewByOllama = async (resume: Resume,aImodel?: string): Promise<ReadableStream | undefined> => {- const prompt = ChatPromptTemplate.fromMessages([- [- "system",- `- You are an expert resume writer and career coach. You must always return JSON object with following structure.-- summary: Provide a brief summary of the resume review.- strengths: List the strengths in the resume.- weaknesses: List the weaknesses in the resume.- suggestions: Provide suggestions for improvement in a list of string.- score: Provide a score for the resume (0-100).- `,- ],- [- "human",- `- Review the resume provided below and and provide feedback in the specified JSON format.-- {resume}- `,- ],- ]);-const resumeText = await convertResumeToText(resume);-- const inputMessage = await prompt.format({ resume: resumeText });+ const inputMessage = await resumeReviewPrompt.format({+ resume: resumeText,+ });const model = new ChatOllama({baseUrl: process.env.OLLAMA_BASE_URL || "http://127.0.0.1:11434",@@ -49,15 +23,17 @@ export const getResumeReviewByOllama = async (format: "json",});- const stream = await model- .pipe(new StringOutputParser())- .stream(inputMessage);+ const stream = await model.stream(inputMessage);const encoder = new TextEncoder();return new ReadableStream({async start(controller) {for await (const chunk of stream) {- controller.enqueue(encoder.encode(chunk));+ const content =+ typeof chunk.content === "string"+ ? chunk.content+ : JSON.stringify(chunk.content);+ controller.enqueue(encoder.encode(content));}controller.close();},@@ -68,51 +44,31 @@ export const getResumeReviewByOpenAi = async (resume: Resume,aImodel?: string): Promise<ReadableStream | undefined> => {- const prompt = ChatPromptTemplate.fromMessages([- [- "system",- `- You are an expert resume writer and career coach. You must only return JSON object with following property structure.-- summary: Provide a brief summary of the resume review.- strengths: List the strengths in the resume.- weaknesses: List the weaknesses in the resume.- suggestions: Provide suggestions for improvement in a list of string.- score: Provide a score for the resume (0-100), scoring should be strict and criteria should include skills, ATS friendliness, and formatting.- `,- ],- [- "human",- `- Review the resume provided below and and provide feedback in the specified JSON format.-- {resume}- `,- ],- ]);-const resumeText = await convertResumeToText(resume);-- const inputMessage = await prompt.format({ resume: resumeText });+ const inputMessage = await resumeReviewPrompt.format({+ resume: resumeText,+ });const model = new ChatOpenAI({- modelName: aImodel,+ model: aImodel,openAIApiKey: process.env.OPENAI_API_KEY,temperature: 0,maxConcurrency: 1,maxTokens: 3000,});- const stream = await model- .pipe(new StringOutputParser())- .stream(inputMessage);+ const stream = await model.stream(inputMessage);const encoder = new TextEncoder();return new ReadableStream({async start(controller) {for await (const chunk of stream) {- controller.enqueue(encoder.encode(chunk));+ const content =+ typeof chunk.content === "string"+ ? chunk.content+ : JSON.stringify(chunk.content);+ controller.enqueue(encoder.encode(content));}controller.close();},@@ -125,65 +81,8 @@ export const getJobMatchByOllama = async (aiModel?: string): Promise<ReadableStream | undefined> => {const resumeText = await convertResumeToText(resume);-const jobText = await convertJobToText(job);-- const prompt = ChatPromptTemplate.fromMessages([- [- "system",- `- You are an expert assistant tasked with matching job seekers' resumes with job descriptions and providing suggestions to improve their resumes. You will analyze the given resume and job description, provide a matching score between 0 and 100, score will be based on application tracking system (ATS) friendliness and skill and keywords match, and suggest improvements to increase the matching score and make the resume more aligned with the job description. Be verbose and highlight details in your response.-- Your response must always return JSON object with following structure:-- "detailed_analysis": an array list of following object structures:- <<object structure>>- "category": "suggestion category title with score",- "value": "an array list of suggestion as strings",- <<example 1>>- "category": "ATS Friendliness(60/100):",- "value": ["<ATS friendliness analysis 1>", "<ATS friendliness analysis 2>",...],- <<example 2>>- "category": "Skill and Keyword match(65/100):",- "value": ["<description of analysis in terms of skill match>", "<description of analysis in terms of keyword match>",...],- "suggestions": an array list with following object structures:- <<object structure>>- "category": "suggestion category title",- "value": "an array list of suggestion as strings",- <<example 1>>- "category": "Emphasize Keywords and Skills:",- "value": ["<missing keywords not found in resume>", "<missing skill not found in resume>",...],- <<example 2>>- "category": "Format for clarity and ATS optimization:",- "value": ["<change 1>", "<change 2>",...],- <<example 3>>- "category": "Enhancement for relevant experience:",- "value": ["<change 1>", "<change 2>",...],- "additional_comments": summary of recommendations as array of strings.- <<example>>- ["<comments>"],- "matching_score": <matching_score with single numeric value, be strict with this score with always room for improvement>,- `,- ],- [- "human",- `- Please analyze the following resume and job description.-- Resume:- """- {resume}- """-- Job Description:- """- {job_description}- """- `,- ],- ]);-- const inputMessage = await prompt.format({+ const inputMessage = await jobMatchPrompt.format({resume: resumeText || "No resume provided",job_description: jobText,});@@ -196,15 +95,17 @@ export const getJobMatchByOllama = async (numCtx: 3000,});- const stream = await model- .pipe(new StringOutputParser())- .stream(inputMessage);+ const stream = await model.stream(inputMessage);const encoder = new TextEncoder();return new ReadableStream({async start(controller) {for await (const chunk of stream) {- controller.enqueue(encoder.encode(chunk));+ const content =+ typeof chunk.content === "string"+ ? chunk.content+ : JSON.stringify(chunk.content);+ controller.enqueue(encoder.encode(content));}controller.close();},@@ -217,65 +118,8 @@ export const getJobMatchByOpenAi = async (aiModel?: string): Promise<ReadableStream | undefined> => {const resumeText = await convertResumeToText(resume);-const jobText = await convertJobToText(job);-- const prompt = ChatPromptTemplate.fromMessages([- [- "system",- `- You are an expert assistant tasked with matching job seekers' resumes with job descriptions and providing suggestions to improve their resumes. You will analyze the given resume and job description, provide a matching score between 0 and 100, score will be based on application tracking system (ATS) friendliness and skill and keywords match, and suggest improvements to increase the matching score and make the resume more aligned with the job description. Be verbose and highlight details in your response.-- Your response must always return JSON object with following structure:-- "detailed_analysis": an array list of following object structures:- <<object structure>>- "category": "suggestion category title with score",- "value": "an array list of suggestion as strings",- <<example 1>>- "category": "ATS Friendliness(60/100):",- "value": ["<ATS friendliness analysis 1>", "<ATS friendliness analysis 2>",...],- <<example 2>>- "category": "Skill and Keyword match(65/100):",- "value": ["<description of analysis in terms of skill match>", "<description of analysis in terms of keyword match>",...],- "suggestions": an array list with following object structures:- <<object structure>>- "category": "suggestion category title",- "value": "an array list of suggestion as strings",- <<example 1>>- "category": "Emphasize Keywords and Skills:",- "value": ["<missing keywords not found in resume>", "<missing skill not found in resume>",...],- <<example 2>>- "category": "Format for clarity and ATS optimization:",- "value": ["<change 1>", "<change 2>",...],- <<example 3>>- "category": "Enhancement for relevant experience:",- "value": ["<change 1>", "<change 2>",...],- "additional_comments": summary of recommendations as array of strings.- <<example>>- ["<comments>"],- "matching_score": <matching_score with single numeric value, be strict with this score with always room for improvement>,- `,- ],- [- "human",- `- Please analyze the following resume and job description.-- Resume:- """- {resume}- """-- Job Description:- """- {job_description}- """- `,- ],- ]);-- const inputMessage = await prompt.format({+ const inputMessage = await jobMatchPrompt.format({resume: resumeText || "No resume provided",job_description: jobText,});@@ -287,15 +131,17 @@ export const getJobMatchByOpenAi = async (maxTokens: 3000,});- const stream = await model- .pipe(new StringOutputParser())- .stream(inputMessage);+ const stream = await model.stream(inputMessage);const encoder = new TextEncoder();return new ReadableStream({async start(controller) {for await (const chunk of stream) {- controller.enqueue(encoder.encode(chunk));+ const content =+ typeof chunk.content === "string"+ ? chunk.content+ : JSON.stringify(chunk.content);+ controller.enqueue(encoder.encode(content));}controller.close();},diff --git a/src/lib/ai.prompts.ts b/src/lib/ai.prompts.tsnew file mode 100644index 0000000..a36ed1a--- /dev/null+++ b/src/lib/ai.prompts.ts@@ -0,0 +1,81 @@+// src/lib/ai.prompts.ts++import { ChatPromptTemplate } from "@langchain/core/prompts";++export const resumeReviewPrompt = ChatPromptTemplate.fromMessages([+ [+ "system",+ `+ You are an expert resume writer and career coach. You must only return JSON object with following property structure.++ summary: Provide a brief summary of the resume review.+ strengths: List the strengths in the resume.+ weaknesses: List the weaknesses in the resume.+ suggestions: Provide suggestions for improvement in a list of string.+ score: Provide a score for the resume (0-100). Scoring should be strict and criteria should include skills, ATS friendliness, and formatting.+ `,+ ],+ [+ "human",+ `+ Review the resume provided below and and provide feedback in the specified JSON format.++ {resume}+ `,+ ],+]);++export const jobMatchPrompt = ChatPromptTemplate.fromMessages([+ [+ "system",+ `+ You are an expert assistant tasked with matching job seekers' resumes with job descriptions and providing suggestions to improve their resumes. You will analyze the given resume and job description, provide a matching score between 0 and 100, score will be based on application tracking system (ATS) friendliness and skill and keywords match, and suggest improvements to increase the matching score and make the resume more aligned with the job description. Be verbose and highlight details in your response.++ Your response must always return JSON object with following structure:++ "detailed_analysis": an array list of following object structures:+ <<object structure>>+ "category": "suggestion category title with score",+ "value": "an array list of suggestion as strings",+ <<example 1>>+ "category": "ATS Friendliness(60/100):",+ "value": ["<ATS friendliness analysis 1>", "<ATS friendliness analysis 2>",...],+ <<example 2>>+ "category": "Skill and Keyword match(65/100):",+ "value": ["<description of analysis in terms of skill match>", "<description of analysis in terms of keyword match>",...],+ "suggestions": an array list with following object structures:+ <<object structure>>+ "category": "suggestion category title",+ "value": "an array list of suggestion as strings",+ <<example 1>>+ "category": "Emphasize Keywords and Skills:",+ "value": ["<missing keywords not found in resume>", "<missing skill not found in resume>",...],+ <<example 2>>+ "category": "Format for clarity and ATS optimization:",+ "value": ["<change 1>", "<change 2>",...],+ <<example 3>>+ "category": "Enhancement for relevant experience:",+ "value": ["<change 1>", "<change 2>",...],+ "additional_comments": summary of recommendations as array of strings.+ <<example>>+ ["<comments>"],+ "matching_score": <matching_score with single numeric value, be strict with this score with always room for improvement>,+ `,+ ],+ [+ "human",+ `+ Please analyze the following resume and job description.++ Resume:+ """+ {resume}+ """++ Job Description:+ """+ {job_description}+ """+ `,+ ],+]);