ninegrid2 6.507.0 → 6.509.0

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.
@@ -2,6 +2,7 @@ import ninegrid from "../index.js";
2
2
  import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
3
3
  import { Ollama } from "@langchain/ollama";
4
4
  import { ChatOpenAI } from '@langchain/openai';
5
+ import { HumanMessage, SystemMessage } from '@langchain/core/messages';
5
6
 
6
7
  class aiContainer extends HTMLElement
7
8
  {
@@ -152,13 +153,13 @@ filterString = "a" + filterString;
152
153
  // Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
153
154
  // 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
154
155
  // LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
155
- //try {
156
+ try {
156
157
  return JSON.parse(filterString);
157
- //} catch (parseError) {
158
- // console.error("Failed to parse filter string as JSON:", parseError);
159
- // console.error("String that failed to parse:", filterString);
160
- // return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
161
- //}
158
+ } catch (parseError) {
159
+ console.error("Failed to parse filter string as JSON:", parseError);
160
+ console.error("String that failed to parse:", filterString);
161
+ return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
162
+ }
162
163
 
163
164
  //} catch (error) {
164
165
 
@@ -4,6 +4,7 @@ var ExcelJS$1 = require('exceljs');
4
4
  var googleGenai = require('@langchain/google-genai');
5
5
  var ollama = require('@langchain/ollama');
6
6
  var openai = require('@langchain/openai');
7
+ var messages = require('@langchain/core/messages');
7
8
 
8
9
  function getDefaultExportFromCjs (x) {
9
10
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -27987,8 +27988,8 @@ class aiContainer extends HTMLElement
27987
27988
 
27988
27989
  //try {
27989
27990
  const response = await this.#model.invoke([
27990
- new SystemMessage(systemMessage),
27991
- new HumanMessage(prompt),
27991
+ new messages.SystemMessage(systemMessage),
27992
+ new messages.HumanMessage(prompt),
27992
27993
  ]);
27993
27994
 
27994
27995
  let filterString = response.content.trim();
@@ -28006,13 +28007,13 @@ filterString = "a" + filterString;
28006
28007
  // Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
28007
28008
  // 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
28008
28009
  // LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
28009
- //try {
28010
+ try {
28010
28011
  return JSON.parse(filterString);
28011
- //} catch (parseError) {
28012
- // console.error("Failed to parse filter string as JSON:", parseError);
28013
- // console.error("String that failed to parse:", filterString);
28014
- // return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
28015
- //}
28012
+ } catch (parseError) {
28013
+ console.error("Failed to parse filter string as JSON:", parseError);
28014
+ console.error("String that failed to parse:", filterString);
28015
+ return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
28016
+ }
28016
28017
 
28017
28018
  //} catch (error) {
28018
28019
 
@@ -2,6 +2,7 @@ import ExcelJS$1 from 'exceljs';
2
2
  import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
3
3
  import { Ollama } from '@langchain/ollama';
4
4
  import { ChatOpenAI } from '@langchain/openai';
5
+ import { SystemMessage, HumanMessage } from '@langchain/core/messages';
5
6
 
6
7
  function getDefaultExportFromCjs (x) {
7
8
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -28004,13 +28005,13 @@ filterString = "a" + filterString;
28004
28005
  // Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
28005
28006
  // 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
28006
28007
  // LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
28007
- //try {
28008
+ try {
28008
28009
  return JSON.parse(filterString);
28009
- //} catch (parseError) {
28010
- // console.error("Failed to parse filter string as JSON:", parseError);
28011
- // console.error("String that failed to parse:", filterString);
28012
- // return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
28013
- //}
28010
+ } catch (parseError) {
28011
+ console.error("Failed to parse filter string as JSON:", parseError);
28012
+ console.error("String that failed to parse:", filterString);
28013
+ return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
28014
+ }
28014
28015
 
28015
28016
  //} catch (error) {
28016
28017
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.507.0",
4
+ "version": "6.509.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -2,6 +2,7 @@ import ninegrid from "../index.js";
2
2
  import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
3
3
  import { Ollama } from "@langchain/ollama";
4
4
  import { ChatOpenAI } from '@langchain/openai';
5
+ import { HumanMessage, SystemMessage } from '@langchain/core/messages';
5
6
 
6
7
  class aiContainer extends HTMLElement
7
8
  {
@@ -152,13 +153,13 @@ filterString = "a" + filterString;
152
153
  // Gemini가 JSON 모드나 Structured Output을 지원하지 않는 경우, 직접 파싱 시도
153
154
  // 안정적인 JSON 파싱을 위해 'JSON Mode' 또는 Function Calling 사용을 강력히 권장
154
155
  // LangChain의 SelfQueryRetriever를 사용하면 이 부분을 자동화할 수 있습니다.
155
- //try {
156
+ try {
156
157
  return JSON.parse(filterString);
157
- //} catch (parseError) {
158
- // console.error("Failed to parse filter string as JSON:", parseError);
159
- // console.error("String that failed to parse:", filterString);
160
- // return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
161
- //}
158
+ } catch (parseError) {
159
+ console.error("Failed to parse filter string as JSON:", parseError);
160
+ console.error("String that failed to parse:", filterString);
161
+ return null; // 파싱 실패 시 null 반환 또는 적절한 에러 처리
162
+ }
162
163
 
163
164
  //} catch (error) {
164
165