mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
remove default usage of openai model in SQLDatabaseToolkit (#2884)
#2866 This toolkit used openai LLM as the default, which could incurr unwanted cost.
This commit is contained in:
parent
675d86aa11
commit
26035dfa59
@ -5,7 +5,6 @@ from pydantic import Field
|
||||
|
||||
from langchain.agents.agent_toolkits.base import BaseToolkit
|
||||
from langchain.llms.base import BaseLLM
|
||||
from langchain.llms.openai import OpenAI
|
||||
from langchain.sql_database import SQLDatabase
|
||||
from langchain.tools import BaseTool
|
||||
from langchain.tools.sql_database.tool import (
|
||||
@ -20,7 +19,7 @@ class SQLDatabaseToolkit(BaseToolkit):
|
||||
"""Toolkit for interacting with SQL databases."""
|
||||
|
||||
db: SQLDatabase = Field(exclude=True)
|
||||
llm: BaseLLM = Field(default_factory=lambda: OpenAI(temperature=0))
|
||||
llm: BaseLLM = Field(exclude=True)
|
||||
|
||||
@property
|
||||
def dialect(self) -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user