Files
langchain/langchain
Zach Jones a58df205ce Fix type annotation for QueryCheckerTool.llm (#3237)
Currently `langchain.tools.sql_database.tool.QueryCheckerTool` has a
field `llm` with type `BaseLLM`. This breaks initialization for some
LLMs. For example, trying to use it with GPT4:

```python
from langchain.sql_database import SQLDatabase
from langchain.chat_models import ChatOpenAI
from langchain.tools.sql_database.tool import QueryCheckerTool


db = SQLDatabase.from_uri("some_db_uri")
llm = ChatOpenAI(model_name="gpt-4")
tool = QueryCheckerTool(db=db, llm=llm)

# pydantic.error_wrappers.ValidationError: 1 validation error for QueryCheckerTool
# llm
#   Can't instantiate abstract class BaseLLM with abstract methods _agenerate, _generate, _llm_type (type=type_error)
```

Seems like much of the rest of the codebase has switched from `BaseLLM`
to `BaseLanguageModel`. This PR makes the change for QueryCheckerTool as
well

Co-authored-by: Zachary Jones <zjones@zetaglobal.com>
2023-04-21 15:36:44 -07:00
..
2023-04-19 16:53:34 -07:00
2023-04-21 15:36:44 -07:00
2023-03-22 23:15:04 -07:00
2023-04-18 21:54:30 -07:00
2023-04-19 21:05:20 -07:00
2023-04-20 07:57:07 -07:00
2023-04-19 16:53:34 -07:00
2023-04-12 14:16:58 -07:00
2022-11-12 11:22:32 -08:00
2023-02-20 21:15:45 -08:00
2023-04-15 16:05:11 -07:00
2023-04-06 23:03:09 -07:00
2023-01-19 14:48:30 -08:00