-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
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
tools require a filled description #336
Comments
Hello, I tried to recreate this problem with a tool below. I noticed that langchain auto-populates docstrings in tool description field if description is not provided. I have commented the docstrings in the below example:
I have the following code that is executed next:
I get the following stack trace:
Can I request you to provide an example of tool use where the description is an empty string? This can be helpful to debug further. Thanks! |
@patilvishal0597 from pydantic import BaseModel, Field
from langchain_aws import ChatBedrockConverse
def search(query: str) -> str:
return "LangChain"
def main():
llm = ChatBedrockConverse(
model="anthropic.claude-3-5-haiku-20241022-v1:0"
)
llm_with_tools = llm.bind_tools([search])
llm_with_tools.invoke("Hello!")
if __name__ == "__main__":
main() Here is the exception raised by the Bedrock API. raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid length for parameter toolConfig.tools[0].toolSpec.description, value: 0, valid min length: 1 |
Generally langchain tools default to having an empty string as a description. Some (maybe all) bedrock models require a filled description, which affects the ease of use of
with_structured_output(method="function_calling")
andbind_tools
withChatBedrock
In particular, this impacts model interoperability, where people are trying their tools with different models, and the bedrock versions simply fail.
Some ideas:
I'm probably more in favor of auto populating for models this impacts
cc @hinthornw
The text was updated successfully, but these errors were encountered: