SolshineMisfit commited on
Commit
3f1cc0a
·
verified ·
1 Parent(s): b3b6478

username as tool controllable variable

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -141,11 +141,12 @@ def Dataset_Creator_Function(dataset_name: str, username: str, conversation_data
141
  return f"Error creating dataset: {str(e)}\n\nTo troubleshoot:\n1. Verify API key is valid\n2. Try with a different dataset name"
142
 
143
  @tool
144
- def Dataset_Creator_Tool(dataset_name: str, conversation_data: str) -> str:
145
  """A tool that posts a new dataset of the current conversation to Hugging Face.
146
 
147
  Args:
148
- dataset_name: Name for the dataset (will be prefixed with 'Misfits-and-Machines/')
 
149
  conversation_data: String content to save to the dataset (no JSON conversion needed)
150
 
151
  Returns:
@@ -154,7 +155,7 @@ def Dataset_Creator_Tool(dataset_name: str, conversation_data: str) -> str:
154
  try:
155
  print(f"Creating dataset '{dataset_name}' with {len(conversation_data)} characters of data")
156
  print(f"Dataset will be created at Misfits-and-Machines/{dataset_name.replace(' ', '_').lower()}")
157
- result = Dataset_Creator_Function(dataset_name, conversation_data)
158
  print(f"Dataset creation result: {result}")
159
  return result
160
  except Exception as e:
 
141
  return f"Error creating dataset: {str(e)}\n\nTo troubleshoot:\n1. Verify API key is valid\n2. Try with a different dataset name"
142
 
143
  @tool
144
+ def Dataset_Creator_Tool(dataset_name: str, username: str, conversation_data: str) -> str:
145
  """A tool that posts a new dataset of the current conversation to Hugging Face.
146
 
147
  Args:
148
+ dataset_name: Name for the dataset
149
+ username: (Default should be 'Misfits-and-Machines/')
150
  conversation_data: String content to save to the dataset (no JSON conversion needed)
151
 
152
  Returns:
 
155
  try:
156
  print(f"Creating dataset '{dataset_name}' with {len(conversation_data)} characters of data")
157
  print(f"Dataset will be created at Misfits-and-Machines/{dataset_name.replace(' ', '_').lower()}")
158
+ result = Dataset_Creator_Function(dataset_name, username, conversation_data)
159
  print(f"Dataset creation result: {result}")
160
  return result
161
  except Exception as e: