Chore/Google GenAI (#4742)

* update @langchain/core, custom google genai implementation

* update @langchain/core, custom google genai implementation
This commit is contained in:
Henry Heng
2025-06-27 00:44:11 +01:00
committed by GitHub
parent e326bc8f49
commit 4c3b729b79
18 changed files with 2087 additions and 876 deletions
@@ -308,7 +308,7 @@ const _generateSelectedTools = async (config: Record<string, any>, question: str
const model = (await newToolNodeInstance.init(config.selectedChatModel, '', options)) as BaseChatModel
// Create a parser to validate the output
const parser = StructuredOutputParser.fromZodSchema(ToolType)
const parser = StructuredOutputParser.fromZodSchema(ToolType as any)
// Generate JSON schema from our Zod schema
const formatInstructions = parser.getFormatInstructions()
@@ -364,7 +364,7 @@ const generateNodesEdges = async (config: Record<string, any>, question: string,
const model = (await newToolNodeInstance.init(config.selectedChatModel, '', options)) as BaseChatModel
// Create a parser to validate the output
const parser = StructuredOutputParser.fromZodSchema(NodesEdgesType)
const parser = StructuredOutputParser.fromZodSchema(NodesEdgesType as any)
// Generate JSON schema from our Zod schema
const formatInstructions = parser.getFormatInstructions()
+1 -1
View File
@@ -56,7 +56,7 @@ export const generateFollowUpPrompts = async (
temperature: parseFloat(`${providerConfig.temperature}`)
})
// use structured output parser because withStructuredOutput is not working
const parser = StructuredOutputParser.fromZodSchema(FollowUpPromptType)
const parser = StructuredOutputParser.fromZodSchema(FollowUpPromptType as any)
const formatInstructions = parser.getFormatInstructions()
const prompt = PromptTemplate.fromTemplate(`
${providerConfig.prompt}