MCPcopy Create free account
hub / github.com/dataease/SQLBot / get_ds

Method get_ds

backend/apps/system/crud/assistant.py:227–235  ·  view source on GitHub ↗
(self, ds_id: int, trans: Trans = None)

Source from the content-addressed store, hash-verified

225 return schema_str, []
226
227 def get_ds(self, ds_id: int, trans: Trans = None):
228 if self.ds_list:
229 for ds in self.ds_list:
230 if ds.id == ds_id:
231 return ds
232 else:
233 raise Exception("Datasource list is not found.")
234 raise Exception(f"Datasource id {ds_id} is not found." if trans is None else trans(
235 'i18n_data_training.datasource_id_not_found', key=ds_id))
236
237 def convert2schema(self, ds_dict: dict, config: dict[any]) -> AssistantOutDsSchema:
238 id_marker: str = ''

Callers 6

get_db_schemaMethod · 0.95
get_ds_embeddingFunction · 0.80
__init__Method · 0.80
select_datasourceMethod · 0.80
get_chat_with_recordsFunction · 0.80
create_chatFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected