We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i followed https://github.com/langchain-ai/langgraphjs/blob/main/examples/plan-and-execute/plan-and-execute.ipynb
const createAgentRunnable = async ( llm: ChatOpenAI, tools: Awaited<ReturnType<typeof createAgentTools>>, ) => { // Get the prompt to use - you can modify this! const prompt = new ChatPromptTemplate({ inputVariables: ['input', 'chat_history', 'agent_scratchpad'], promptMessages: [ new SystemMessage(AGENT_PROMPT_SYSTEM_MESSAGE), new MessagesPlaceholder('chat_history'), HumanMessagePromptTemplate.fromTemplate('{input}'), HumanMessagePromptTemplate.fromTemplate(RESPONSE_INTRODUCT_MESSAGE_TEMPLATE), new MessagesPlaceholder('agent_scratchpad'), ], }) // Construct the OpenAI Functions agent return await createOpenAIFunctionsAgent({ llm, tools, prompt, }) } export const createOGDeveloperAgentExecutor = async ( data: AgentDataInput, services: AgentServiceInput, ) => { const tools = await createAgentTools(data, services) const agent = await createAgentRunnable(services.llm, tools) const agentExecutor = createAgentExecutor({ agentRunnable: agent, tools: [], }) return agentExecutor }
ExecuteStep
executeStep = async (state: PlanExecuteState): Promise<Partial<PlanExecuteState>> => { const task = state.input const agentResponse = await this.agentExecutor.invoke({ input: task, chat_history: state.chatHistory, }) console.log('agentResponse', agentResponse) return { pastSteps: [task, agentResponse.agentOutcome.returnValues.output] } }
err TypeError: Cannot read properties of undefined (reading 'returnValues')
The agentExcutor invoke response is not including "agentOutcome"
agentResponse { input: 'hi', chat_history: [ AIMessage { lc_serializable: true, lc_kwargs: [Object], lc_namespace: [Array], content: '(Backend Developer) Sorry can not help you now. Please try again later.', name: undefined, additional_kwargs: {}, response_metadata: {}, tool_calls: [], invalid_tool_calls: [] }, AIMessage { lc_serializable: true, lc_kwargs: [Object], lc_namespace: [Array], content: '(Backend Developer) AI thinking ...', name: undefined, additional_kwargs: {}, response_metadata: {}, tool_calls: [], invalid_tool_calls: [] } ], output: "I'm ready to assist you. How can I help you today?", intermediateSteps: [] }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Issues went implement "plan-and-execute"
i followed
https://github.com/langchain-ai/langgraphjs/blob/main/examples/plan-and-execute/plan-and-execute.ipynb
Input
ExecuteStep
Error
The agentExcutor invoke response is not including "agentOutcome"
The text was updated successfully, but these errors were encountered: