Skip to content

Commit dcfb044

Browse files
fixed the creation logic for data sources
1 parent 90e3d16 commit dcfb044

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

langchain_minds/tools.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from langchain_core.tools import BaseTool
1111
from langchain_core.utils import convert_to_secret_str, get_from_dict_or_env
1212
from minds.client import Client
13+
from minds.datasources import DatabaseConfig
1314
from minds.exceptions import ObjectNotFound
1415
from pydantic import BaseModel, Field, SecretStr
1516

@@ -98,11 +99,13 @@ def __init__(self, **data: Any) -> None:
9899

99100
# Create the data source.
100101
minds_client.datasources.create(
101-
name=self.name,
102-
engine=self.engine,
103-
description=self.description,
104-
connection_data=connection_data,
105-
tables=self.tables,
102+
DatabaseConfig(
103+
name=self.name,
104+
engine=self.engine,
105+
description=self.description,
106+
connection_data=connection_data,
107+
tables=self.tables,
108+
)
106109
)
107110

108111

0 commit comments

Comments
 (0)