Skip to content

Commit

Permalink
Get hex or UUIDs for naming
Browse files Browse the repository at this point in the history
  • Loading branch information
tmichaeldb committed Aug 26, 2024
1 parent b905f17 commit 9942aef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mindsdb_sdk/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ def add_files(self, name: str, file_paths: List[str], description: str, knowledg
if knowledge_base is not None:
kb = self.knowledge_bases.get(knowledge_base)
else:
kb_name = f'{name}_{filename_no_extension}_{uuid4()}_kb'
kb_name = f'{name}_{filename_no_extension}_{uuid4().hex}_kb'
kb = self._create_default_knowledge_base(agent, kb_name)

# Insert the entire file.
kb.insert_files(all_filenames)

# Make sure skill name is unique.
skill_name = f'{filename_no_extension}_retrieval_skill_{uuid4()}'
skill_name = f'{filename_no_extension}_retrieval_skill_{uuid4().hex}'
retrieval_params = {
'source': kb.name,
'description': description,
Expand Down Expand Up @@ -361,14 +361,14 @@ def add_webpages(
if knowledge_base is not None:
kb = self.knowledge_bases.get(knowledge_base)
else:
kb_name = f'{name}_web_{uuid4()}_kb'
kb_name = f'{name}_web_{uuid4().hex}_kb'
kb = self._create_default_knowledge_base(agent, kb_name)

# Insert crawled webpage.
kb.insert_webpages(urls, crawl_depth=crawl_depth, filters=filters)

# Make sure skill name is unique.
skill_name = f'web_retrieval_skill_{uuid4()}'
skill_name = f'web_retrieval_skill_{uuid4().hex}'
retrieval_params = {
'source': kb.name,
'description': description,
Expand Down Expand Up @@ -415,7 +415,7 @@ def add_database(self, name: str, database: str, tables: List[str], description:
raise ValueError(f'Table {t} does not exist in database {database}.')

# Make sure skill name is unique.
skill_name = f'{database}_sql_skill_{uuid4()}'
skill_name = f'{database}_sql_skill_{uuid4().hex}'
sql_params = {
'database': database,
'tables': tables,
Expand Down

0 comments on commit 9942aef

Please sign in to comment.