I am trying to use a provided LangChain tool GmailGetThread
and the key part of the code is
class GetThreadSchema(BaseModel):
"""Input for GetMessageTool."""
thread_id: str = Field(
...,
description="The thread ID.",
)
class GmailGetThread(GmailBaseTool):
"""Tool that gets a thread by ID from Gmail."""
name: str = "get_gmail_thread"
description: str = (
"Use this tool to search for email messages."
" The input must be a valid Gmail query."
" The output is a JSON list of messages."
)
args_schema: Type[GetThreadSchema] = GetThreadSchema
however it seems to ignore the schema and keeps trying to invoke the tool with the wrong field query
or id
instead of thread_id
, for example
{
"query": "thread:19026dfdc7e27431"
}
Why is the pydantic schema being ignored? thanks