diff --git a/src/lib/outputParsers/lineOutputParser.ts b/src/lib/outputParsers/lineOutputParser.ts index b50a20e..08711aa 100644 --- a/src/lib/outputParsers/lineOutputParser.ts +++ b/src/lib/outputParsers/lineOutputParser.ts @@ -19,6 +19,8 @@ class LineOutputParser extends BaseOutputParser { lc_namespace = ['langchain', 'output_parsers', 'line_output_parser']; async parse(text: string): Promise { + text = text.trim() || ''; + const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/; const startKeyIndex = text.indexOf(`<${this.key}>`); const endKeyIndex = text.indexOf(``); diff --git a/src/lib/outputParsers/listLineOutputParser.ts b/src/lib/outputParsers/listLineOutputParser.ts index fcd2f07..f465ef1 100644 --- a/src/lib/outputParsers/listLineOutputParser.ts +++ b/src/lib/outputParsers/listLineOutputParser.ts @@ -19,11 +19,13 @@ class LineListOutputParser extends BaseOutputParser { lc_namespace = ['langchain', 'output_parsers', 'line_list_output_parser']; async parse(text: string): Promise { + text = text.trim() || ''; + const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/; const startKeyIndex = text.indexOf(`<${this.key}>`); const endKeyIndex = text.indexOf(``); - if (startKeyIndex === -1 && endKeyIndex === -1) { + if (startKeyIndex === -1 || endKeyIndex === -1) { return []; } diff --git a/src/lib/providers/gemini.ts b/src/lib/providers/gemini.ts index 95764cf..d20c9b8 100644 --- a/src/lib/providers/gemini.ts +++ b/src/lib/providers/gemini.ts @@ -36,6 +36,22 @@ export const loadGeminiChatModels = async () => { apiKey: geminiApiKey, }), }, + 'gemini-2.0-flash-exp': { + displayName: 'Gemini 2.0 Flash Exp', + model: new ChatGoogleGenerativeAI({ + modelName: 'gemini-2.0-flash-exp', + temperature: 0.7, + apiKey: geminiApiKey, + }), + }, + 'gemini-2.0-flash-thinking-exp-01-21': { + displayName: 'Gemini 2.0 Flash Thinking Exp 01-21', + model: new ChatGoogleGenerativeAI({ + modelName: 'gemini-2.0-flash-thinking-exp-01-21', + temperature: 0.7, + apiKey: geminiApiKey, + }), + }, }; return chatModels; diff --git a/ui/package.json b/ui/package.json index bdda684..a8826dc 100644 --- a/ui/package.json +++ b/ui/package.json @@ -18,7 +18,7 @@ "clsx": "^2.1.0", "langchain": "^0.1.30", "lucide-react": "^0.363.0", - "markdown-to-jsx": "^7.6.2", + "markdown-to-jsx": "^7.7.2", "next": "14.1.4", "next-themes": "^0.3.0", "react": "^18", diff --git a/ui/yarn.lock b/ui/yarn.lock index 0798ca9..7eb109f 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -2210,10 +2210,10 @@ lucide-react@^0.363.0: resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.363.0.tgz#2bb1f9d09b830dda86f5118fcd097f87247fe0e3" integrity sha512-AlsfPCsXQyQx7wwsIgzcKOL9LwC498LIMAo+c0Es5PkHJa33xwmYAkkSoKoJWWWSYQEStqu58/jT4tL2gi32uQ== -markdown-to-jsx@^7.6.2: - version "7.6.2" - resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.6.2.tgz#254cbf7d412a37073486c0a2dd52266d2191a793" - integrity sha512-gEcyiJXzBxmId2Y/kydLbD6KRNccDiUy/Src1cFGn3s2X0LZZ/hUiEc2VisFyA5kUE3SXclTCczjQiAuqKZiFQ== +markdown-to-jsx@^7.7.2: + version "7.7.2" + resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.7.2.tgz#59c1dd64f48b53719311ab140be3cd51cdabccd3" + integrity sha512-N3AKfYRvxNscvcIH6HDnDKILp4S8UWbebp+s92Y8SwIq0CuSbLW4Jgmrbjku3CWKjTQO0OyIMS6AhzqrwjEa3g== md5@^2.3.0: version "2.3.0"