Skip to content

Commit

Permalink
fix: langchain upgraded error (#546)
Browse files Browse the repository at this point in the history
* fix: langchain too description ut

* fix: limit langchain version -> <=0.1.20

* fix: langchain too description ut

* fix: format
  • Loading branch information
danielhjz authored May 23, 2024
1 parent 351075a commit 37ac63a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ python-dotenv = [
]
tenacity = "^8.2.3"
multiprocess = "*"
langchain = { version = ">=0.1.10", python = ">=3.8.1", optional = true }
langchain = { version = ">=0.1.10,<=0.1.20", python = ">=3.8.1", optional = true }
numpy = [
{ version = "<1.22.0", python = ">=3.7 <3.8", optional = true },
{ version = ">=1.22.0", python = ">=3.8", optional = true }
Expand Down
5 changes: 4 additions & 1 deletion python/qianfan/tests/tool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def hello_tool(
tool = BaseTool.from_langchain_tool(hello_tool)

assert tool.name == "hello_tool"
assert tool.description == "hello_tool(a: str, b: str) -> str - Say hello"
assert tool.description in [
"hello_tool(a: str, b: str) -> str - Say hello",
"Say hello",
]
assert len(tool.parameters) == 2
assert tool.parameters[0] == ToolParameter(name="a", type="string", required=True)
assert tool.parameters[1] == ToolParameter(name="b", type="string", required=True)
Expand Down

0 comments on commit 37ac63a

Please sign in to comment.