diff --git a/swarms/models/anthropic.py b/swarms/models/anthropic.py index 1f47e1bf..1f0fe759 100644 --- a/swarms/models/anthropic.py +++ b/swarms/models/anthropic.py @@ -185,9 +185,11 @@ def build_extra_kwargs( if field_name in extra_kwargs: raise ValueError(f"Found {field_name} supplied twice.") if field_name not in all_required_field_names: - warnings.warn(f"""WARNING! {field_name} is not default parameter. + warnings.warn( + f"""WARNING! {field_name} is not default parameter. {field_name} was transferred to model_kwargs. - Please confirm that {field_name} is what you intended.""") + Please confirm that {field_name} is what you intended.""" + ) extra_kwargs[field_name] = values.pop(field_name) invalid_model_kwargs = all_required_field_names.intersection( diff --git a/swarms/models/dalle3.py b/swarms/models/dalle3.py index 3c130670..419cb060 100644 --- a/swarms/models/dalle3.py +++ b/swarms/models/dalle3.py @@ -168,10 +168,8 @@ class Dalle3: # Handling exceptions and printing the errors details print( colored( - ( - f"Error running Dalle3: {error} try optimizing your api" - " key and or try again" - ), + f"Error running Dalle3: {error} try optimizing your api" + " key and or try again", "red", ) ) @@ -233,10 +231,8 @@ class Dalle3: except (Exception, openai.OpenAIError) as error: print( colored( - ( - f"Error running Dalle3: {error} try optimizing your api" - " key and or try again" - ), + f"Error running Dalle3: {error} try optimizing your api" + " key and or try again", "red", ) ) @@ -310,10 +306,8 @@ class Dalle3: except Exception as error: print( colored( - ( - f"Error running Dalle3: {error} try optimizing" - " your api key and or try again" - ), + f"Error running Dalle3: {error} try optimizing" + " your api key and or try again", "red", ) ) diff --git a/swarms/models/huggingface.py b/swarms/models/huggingface.py index 1db435f5..f3f7d45f 100644 --- a/swarms/models/huggingface.py +++ b/swarms/models/huggingface.py @@ -291,10 +291,8 @@ class HuggingfaceLLM: except Exception as e: print( colored( - ( - "HuggingfaceLLM could not generate text because of" - f" error: {e}, try optimizing your arguments" - ), + "HuggingfaceLLM could not generate text because of" + f" error: {e}, try optimizing your arguments", "red", ) ) diff --git a/swarms/models/ssd_1b.py b/swarms/models/ssd_1b.py index 406678ef..aaa3f17e 100644 --- a/swarms/models/ssd_1b.py +++ b/swarms/models/ssd_1b.py @@ -140,10 +140,8 @@ class SSD1B: # Handling exceptions and printing the errors details print( colored( - ( - f"Error running SSD1B: {error} try optimizing your api" - " key and or try again" - ), + f"Error running SSD1B: {error} try optimizing your api" + " key and or try again", "red", ) ) @@ -228,10 +226,8 @@ class SSD1B: except Exception as error: print( colored( - ( - f"Error running SSD1B: {error} try optimizing" - " your api key and or try again" - ), + f"Error running SSD1B: {error} try optimizing" + " your api key and or try again", "red", ) ) diff --git a/swarms/structs/flow.py b/swarms/structs/flow.py index 18a141a3..99a3e587 100644 --- a/swarms/structs/flow.py +++ b/swarms/structs/flow.py @@ -137,7 +137,7 @@ class Flow: """ Flow is the structure that provides autonomy to any llm in a reliable and effective fashion. The flow structure is designed to be used with any llm and provides the following features: - + Features: * Interactive, AI generates, then user input * Message history and performance history fed -> into context -> truncate if too long @@ -489,10 +489,8 @@ class Flow: except Exception as error: print( colored( - ( - "Error activating autonomous agent. Try optimizing your" - " parameters..." - ), + "Error activating autonomous agent. Try optimizing your" + " parameters...", "red", ) ) @@ -652,7 +650,7 @@ class Flow: while attempt < self.retry_attempts: try: response = self.llm( - task**kwargs, + task ** kwargs, ) if self.interactive: print(f"AI: {response}") diff --git a/swarms/structs/sequential_workflow.py b/swarms/structs/sequential_workflow.py index 753ada15..85990854 100644 --- a/swarms/structs/sequential_workflow.py +++ b/swarms/structs/sequential_workflow.py @@ -385,11 +385,9 @@ class SequentialWorkflow: except Exception as e: print( colored( - ( - f"Error initializing the Sequential workflow: {e} try" - " optimizing your inputs like the flow class and task" - " description" - ), + f"Error initializing the Sequential workflow: {e} try" + " optimizing your inputs like the flow class and task" + " description", "red", attrs=["bold", "underline"], )