Skip to content

Commit 27cef08

Browse files
authored
bump version to 0.0.67 (#689)
1 parent 77e3d58 commit 27cef08

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

CITATION.cff

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ authors:
44
- family-names: "Chase"
55
given-names: "Harrison"
66
title: "LangChain"
7-
version: 0.0.66
7+
version: 0.0.67
88
date-released: 2022-10-17
99
url: "https://github.com/hwchase17/langchain"

langchain/agents/load_tools.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _get_google_search(**kwargs: Any) -> Tool:
143143
"news-api": (_get_news_api, ["news_api_key"]),
144144
"tmdb-api": (_get_tmdb_api, ["tmdb_bearer_token"]),
145145
}
146-
_EXTRA_TOOLS = {
146+
_EXTRA_OPTIONAL_TOOLS = {
147147
"wolfram-alpha": (_get_wolfram_alpha, ["wolfram_alpha_appid"]),
148148
"google-search": (_get_google_search, ["google_api_key", "google_cse_id"]),
149149
}
@@ -172,7 +172,7 @@ def load_tools(
172172
elif name in _EXTRA_LLM_TOOLS:
173173
if llm is None:
174174
raise ValueError(f"Tool {name} requires an LLM to be provided")
175-
_get_tool_func, extra_keys = _EXTRA_TOOLS[name]
175+
_get_tool_func, extra_keys = _EXTRA_OPTIONAL_TOOLS[name]
176176
missing_keys = set(extra_keys).difference(kwargs)
177177
if missing_keys:
178178
raise ValueError(
@@ -181,15 +181,9 @@ def load_tools(
181181
)
182182
sub_kwargs = {k: kwargs[k] for k in extra_keys}
183183
tools.append(_get_tool_func(llm=llm, **sub_kwargs))
184-
elif name in _EXTRA_TOOLS:
185-
_get_tool_func, extra_keys = _EXTRA_TOOLS[name]
186-
missing_keys = set(extra_keys).difference(kwargs)
187-
if missing_keys:
188-
raise ValueError(
189-
f"Tool {name} requires some parameters that were not "
190-
f"provided: {missing_keys}"
191-
)
192-
sub_kwargs = {k: kwargs[k] for k in extra_keys}
184+
elif name in _EXTRA_OPTIONAL_TOOLS:
185+
_get_tool_func, extra_keys = _EXTRA_OPTIONAL_TOOLS[name]
186+
sub_kwargs = {k: kwargs[k] for k in extra_keys if k in kwargs}
193187
tools.append(_get_tool_func(**sub_kwargs))
194188

195189
else:
@@ -199,4 +193,4 @@ def load_tools(
199193

200194
def get_all_tool_names() -> List[str]:
201195
"""Get a list of all possible tool names."""
202-
return list(_BASE_TOOLS) + list(_EXTRA_TOOLS) + list(_LLM_TOOLS)
196+
return list(_BASE_TOOLS) + list(_EXTRA_OPTIONAL_TOOLS) + list(_LLM_TOOLS)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "langchain"
3-
version = "0.0.66"
3+
version = "0.0.67"
44
description = "Building applications with LLMs through composability"
55
authors = []
66
license = "MIT"

0 commit comments

Comments
 (0)