Skip to content

Commit

Permalink
fix: remove - in dataset retriever tool name (langgenius#3381)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly authored Apr 12, 2024
1 parent 4007868 commit ac51e1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DatasetMultiRetrieverToolInput(BaseModel):

class DatasetMultiRetrieverTool(BaseTool):
"""Tool for querying multi dataset."""
name: str = "dataset-"
name: str = "dataset_"
args_schema: type[BaseModel] = DatasetMultiRetrieverToolInput
description: str = "dataset multi retriever and rerank. "
tenant_id: str
Expand All @@ -47,7 +47,7 @@ class DatasetMultiRetrieverTool(BaseTool):
@classmethod
def from_dataset(cls, dataset_ids: list[str], tenant_id: str, **kwargs):
return cls(
name=f'dataset-{tenant_id}',
name=f"dataset_{tenant_id.replace('-', '_')}",
tenant_id=tenant_id,
dataset_ids=dataset_ids,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def from_dataset(cls, dataset: Dataset, **kwargs):

description = description.replace('\n', '').replace('\r', '')
return cls(
name=f'dataset-{dataset.id}',
name=f"dataset_{dataset.id.replace('-', '_')}",
tenant_id=dataset.tenant_id,
dataset_id=dataset.id,
description=description,
Expand Down

0 comments on commit ac51e1c

Please sign in to comment.