Skip to content

Commit

Permalink
[cleanup]
Browse files Browse the repository at this point in the history
  • Loading branch information
kyegomez committed Jan 28, 2025
1 parent 834b9c5 commit 9cff6c7
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 549 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 4 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "swarms"
version = "6.9.9"
version = "7.0.0"
description = "Swarms - TGSC"
license = "MIT"
authors = ["Kye Gomez <[email protected]>"]
Expand Down Expand Up @@ -78,25 +78,11 @@ rich = "*"
# sentence-transformers = "*"


# [tool.poetry.extras]
# # Extra for NLP-related functionalities
# nlp = [
# "torch>=2.1.1,<3.0",
# "transformers>=4.39.0,<5.0.0",
# "sentence-transformers",
# "swarm-models",
# ]

# # Extra for database-related functionalities
# db = ["chromadb"]

# # All optional dependencies for convenience
# all = [
# "torch>=2.1.1,<3.0",
# "transformers>=4.39.0,<5.0.0",
# "sentence-transformers",
# "chromadb",
# "swarm-models"
# "torch",
# "transformers",
# "litellm"
# ]


Expand Down
2 changes: 0 additions & 2 deletions swarms/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
scrape_tool_func_docs,
tool_find_by_name,
)
from swarms.tools.func_calling_executor import openai_tool_executor
from swarms.tools.pydantic_to_json import (
_remove_a_key,
base_model_to_openai_function,
Expand Down Expand Up @@ -34,7 +33,6 @@
__all__ = [
"scrape_tool_func_docs",
"tool_find_by_name",
"openai_tool_executor",
"_remove_a_key",
"base_model_to_openai_function",
"multi_base_model_to_openai_function",
Expand Down
238 changes: 0 additions & 238 deletions swarms/tools/func_calling_executor.py

This file was deleted.

16 changes: 12 additions & 4 deletions swarms/tools/function_util.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import inspect
from typing import Callable, Type, Union


def process_tool_docs(item):
def process_tool_docs(item: Union[Callable, Type]) -> str:
"""
Process the documentation for a given item.
Process the documentation for a given item, which can be a function or a class.
Args:
item: The item to process the documentation for.
item: The item to process the documentation for. It can be a function or a class.
Returns:
metadata: The processed metadata containing the item's name, documentation, and source code.
str: The processed metadata containing the item's name, documentation, and source code.
Raises:
TypeError: If the item is not a function or a class.
"""
# Check if item is a function or a class
if not inspect.isfunction(item) and not inspect.isclass(item):
raise TypeError("Item must be a function or a class.")

# If item is an instance of a class, get its class
if not inspect.isclass(item) and hasattr(item, "__class__"):
item = item.__class__
Expand Down
Loading

0 comments on commit 9cff6c7

Please sign in to comment.