Closed fvisticot closed 3 months ago
Salut @fvisticot, ravi de te revoir par ici ! J'espère que tout va bien de ton côté.
Based on the information you've provided, it seems like the issue is related to the way the input is being passed to the invoke
method of the AgentExecutor
class. The invoke
method expects an object as input, but it seems like a string is being passed instead.
Here's the relevant part of your code:
const result = await agentExecutor.invoke({
input: question,
chat_history: this.chatMessageHistory
});
In this code, question
should be an object that matches the schema defined in your DynamicStructuredTool
. However, from the error message you're seeing, it seems like question
is a string.
To resolve this issue, you should ensure that question
is an object that matches the schema defined in your DynamicStructuredTool
. Here's an example of how you might do this:
const question = {
to: "test@test.com",
subject: "je vais bien",
body: ""
};
const result = await agentExecutor.invoke({
input: question,
chat_history: this.chatMessageHistory
});
In this example, question
is an object that matches the schema defined in your DynamicStructuredTool
, so it should be correctly processed by the invoke
method of the AgentExecutor
class.
I hope this helps! If you have any further questions, please don't hesitate to ask.
The automatic answer is not correct. I can not have a question with this format: Any other advice ?
const question = {
to: "test@test.com",
subject: "je vais bien",
body: ""
};
any update ? i got same error
Checked other resources
Example Code
arg passed to the tool is correct but in String format instead of object.
{ "to": "test@test.com", "subject": "je vais bien", "body": "" }
Error Message and Stack Trace (if applicable)
{ "issues": [ { "code": "invalid_type", "expected": "object", "received": "string", "path": [], "message": "Expected object, received string" } ], "name": "ZodError" }
Description
arg passed to the tool is correct but in String format instead of object.
System Info
0.1.22