diff --git a/pkgs/community/swarmauri_llm_communityleptonai/pyproject.toml b/pkgs/community/swarmauri_llm_communityleptonai/pyproject.toml index c7fd920a..42f7dca0 100644 --- a/pkgs/community/swarmauri_llm_communityleptonai/pyproject.toml +++ b/pkgs/community/swarmauri_llm_communityleptonai/pyproject.toml @@ -53,5 +53,7 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.llms"] +LeptonAIModel = "swarmauri_llm_communityleptonai.LeptonAIImgGenModel:LeptonAIModel" + +[tool.poetry.plugins."swarmauri.image_gens"] LeptonAIImgGenModel = "swarmauri_llm_communityleptonai.LeptonAIImgGenModel:LeptonAIImgGenModel" -LeptonAIModel = "swarmauri_llm_communityleptonai.LeptonAIImgGenModel:LeptonAIModel" \ No newline at end of file diff --git a/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIImgGenModel.py b/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIImgGenModel.py index 636b8707..2664ebc0 100644 --- a/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIImgGenModel.py +++ b/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIImgGenModel.py @@ -4,11 +4,13 @@ from io import BytesIO from PIL import Image from typing import List, Literal +from swarmauri_base.image_gens.ImageGenBase import ImageGenBase from pydantic import Field, ConfigDict -from swarmauri_base.llms.LLMBase import LLMBase +from swarmauri_core.ComponentBase import ComponentBase -class LeptonAIImgGenModel(LLMBase): +@ComponentBase.register_type(ImageGenBase, "LeptonAIImgGenModel") +class LeptonAIImgGenModel(ImageGenBase): """ A model for generating images from text using Lepton AI's SDXL image generation model. It returns the image as bytes. diff --git a/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIModel.py b/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIModel.py index 539b3fa7..692aff67 100644 --- a/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIModel.py +++ b/pkgs/community/swarmauri_llm_communityleptonai/swarmauri_llm_communityleptonai/LeptonAIModel.py @@ -9,8 +9,9 @@ from swarmauri_standard.messages.AgentMessage import AgentMessage, UsageData from swarmauri.utils.duration_manager import DurationManager +from swarmauri_core.ComponentBase import ComponentBase - +@ComponentBase.register_type(LLMBase, "LeptonAIModel") class LeptonAIModel(LLMBase): """ Provider resources: https://www.lepton.ai/playground diff --git a/pkgs/community/swarmauri_llm_communitypytesseractImg2text/swarmauri_llm_communitypytesseractImg2text/PytesseractImg2TextModel.py b/pkgs/community/swarmauri_llm_communitypytesseractImg2text/swarmauri_llm_communitypytesseractImg2text/PytesseractImg2TextModel.py index eff076a3..8d923a71 100644 --- a/pkgs/community/swarmauri_llm_communitypytesseractImg2text/swarmauri_llm_communitypytesseractImg2text/PytesseractImg2TextModel.py +++ b/pkgs/community/swarmauri_llm_communitypytesseractImg2text/swarmauri_llm_communitypytesseractImg2text/PytesseractImg2TextModel.py @@ -1,6 +1,7 @@ import os import asyncio from typing import List, Literal, Union +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field, ConfigDict from PIL import Image import pytesseract @@ -8,6 +9,7 @@ from swarmauri_base.llms.LLMBase import LLMBase +@ComponentBase.register_type(LLMBase, "PytesseractImg2TextModel") class PytesseractImg2TextModel(LLMBase): """ A model for performing OCR (Optical Character Recognition) using Pytesseract. diff --git a/pkgs/community/swarmauri_measurement_communitymutualinformation/swarmauri_measurement_communitymutualinformation/MutualInformationMeasurement.py b/pkgs/community/swarmauri_measurement_communitymutualinformation/swarmauri_measurement_communitymutualinformation/MutualInformationMeasurement.py index db045cf9..388febb6 100644 --- a/pkgs/community/swarmauri_measurement_communitymutualinformation/swarmauri_measurement_communitymutualinformation/MutualInformationMeasurement.py +++ b/pkgs/community/swarmauri_measurement_communitymutualinformation/swarmauri_measurement_communitymutualinformation/MutualInformationMeasurement.py @@ -1,12 +1,14 @@ from typing import Literal import pandas as pd from sklearn.feature_selection import mutual_info_classif +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.measurements.MeasurementBase import MeasurementBase from swarmauri_base.measurements.MeasurementCalculateMixin import ( MeasurementCalculateMixin, ) +@ComponentBase.register_type(MeasurementBase, "MutualInformationMeasurement") class MutualInformationMeasurement(MeasurementBase, MeasurementCalculateMixin): """ A Measurement class to calculate mutual information between features and a target column in a given dataset. diff --git a/pkgs/community/swarmauri_measurement_communitytokencountestimator/swarmauri_measurement_communitytokencountestimator/TokenCountEstimatorMeasurement.py b/pkgs/community/swarmauri_measurement_communitytokencountestimator/swarmauri_measurement_communitytokencountestimator/TokenCountEstimatorMeasurement.py index e1a96a15..53644add 100644 --- a/pkgs/community/swarmauri_measurement_communitytokencountestimator/swarmauri_measurement_communitytokencountestimator/TokenCountEstimatorMeasurement.py +++ b/pkgs/community/swarmauri_measurement_communitytokencountestimator/swarmauri_measurement_communitytokencountestimator/TokenCountEstimatorMeasurement.py @@ -1,4 +1,5 @@ from typing import Literal +from swarmauri_core.ComponentBase import ComponentBase import tiktoken from swarmauri_base.measurements.MeasurementBase import MeasurementBase from swarmauri_base.measurements.MeasurementCalculateMixin import ( @@ -6,6 +7,7 @@ ) +@ComponentBase.register_type(MeasurementBase, "TokenCountEstimatorMeasurement") class TokenCountEstimatorMeasurement(MeasurementBase, MeasurementCalculateMixin): """ A measurement class to estimate the number of tokens in a given text. diff --git a/pkgs/community/swarmauri_parser_communitybertembedding/swarmauri_parser_communitybertembedding/BERTEmbeddingParser.py b/pkgs/community/swarmauri_parser_communitybertembedding/swarmauri_parser_communitybertembedding/BERTEmbeddingParser.py index 429ef60a..18468023 100644 --- a/pkgs/community/swarmauri_parser_communitybertembedding/swarmauri_parser_communitybertembedding/BERTEmbeddingParser.py +++ b/pkgs/community/swarmauri_parser_communitybertembedding/swarmauri_parser_communitybertembedding/BERTEmbeddingParser.py @@ -1,4 +1,5 @@ from typing import List, Union, Any, Literal +from swarmauri_core.ComponentBase import ComponentBase from transformers import BertTokenizer, BertModel import torch from pydantic import PrivateAttr @@ -6,7 +7,7 @@ from swarmauri_standard.documents.Document import Document from swarmauri_base.parsers.ParserBase import ParserBase - +@ComponentBase.register_type(ParserBase, "BERTEmbeddingParser") class BERTEmbeddingParser(ParserBase): """ A parser that transforms input text into document embeddings using BERT. diff --git a/pkgs/community/swarmauri_parser_communityentityrecognition/swarmauri_parser_communityentityrecognition/EntityRecognitionParser.py b/pkgs/community/swarmauri_parser_communityentityrecognition/swarmauri_parser_communityentityrecognition/EntityRecognitionParser.py index 12277cfb..8582e584 100644 --- a/pkgs/community/swarmauri_parser_communityentityrecognition/swarmauri_parser_communityentityrecognition/EntityRecognitionParser.py +++ b/pkgs/community/swarmauri_parser_communityentityrecognition/swarmauri_parser_communityentityrecognition/EntityRecognitionParser.py @@ -1,3 +1,4 @@ +from swarmauri_core.ComponentBase import ComponentBase import spacy from typing import List, Union, Any, Literal from pydantic import PrivateAttr @@ -6,6 +7,7 @@ from swarmauri_base.parsers.ParserBase import ParserBase +@ComponentBase.register_type(ParserBase, "EntityRecognitionParser") class EntityRecognitionParser(ParserBase): """ EntityRecognitionParser leverages NER capabilities to parse text and diff --git a/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/FitzPdfParser.py b/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/FitzPdfParser.py index 7fc5248c..8ec94d2f 100644 --- a/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/FitzPdfParser.py +++ b/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/FitzPdfParser.py @@ -1,3 +1,4 @@ +from swarmauri_core.ComponentBase import ComponentBase import pymupdf # PyMuPDF from typing import List, Union, Any, Literal from swarmauri.parsers.base.ParserBase import ParserBase @@ -5,6 +6,7 @@ from swarmauri.documents.concrete.Document import Document +@ComponentBase.register_type(ParserBase, "FitzPdfParser") class PDFtoTextParser(ParserBase): """ A parser to extract text from PDF files. diff --git a/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDF2Parser.py b/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDF2Parser.py index fce04061..2aa0b5c0 100644 --- a/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDF2Parser.py +++ b/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDF2Parser.py @@ -1,11 +1,13 @@ from typing import List, Literal, Union -import PyPDF2 +import PyPDF2 +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_standard.documents.Document import Document from swarmauri_base.parsers.ParserBase import ParserBase from swarmauri_core.documents.IDocument import IDocument +@ComponentBase.register_type(ParserBase, "PyPDF2Parser") class PyPDF2Parser(ParserBase): """ Parser for reading and extracting text from PDF files using PyPDF2. diff --git a/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDFTKParser.py b/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDFTKParser.py index 92df2e92..6ed4295a 100644 --- a/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDFTKParser.py +++ b/pkgs/community/swarmauri_parser_communitypdf/swarmauri_parser_communitypdf/PyPDFTKParser.py @@ -1,11 +1,13 @@ from typing import List, Literal -import pypdftk # PyPDFTK +from swarmauri_core.ComponentBase import ComponentBase +import pypdftk from swarmauri_standard.documents.Document import Document from swarmauri_base.parsers.ParserBase import ParserBase from swarmauri_core.documents.IDocument import IDocument +@ComponentBase.register_type(ParserBase, "PyPDFTKParser") class PyPDFTKParser(ParserBase): """ Parser for reading and extracting data fields from PDF files using PyPDFTK. diff --git a/pkgs/community/swarmauri_parser_communitytextblob/pyproject.toml b/pkgs/community/swarmauri_parser_communitytextblob/pyproject.toml index fa036905..672ea757 100644 --- a/pkgs/community/swarmauri_parser_communitytextblob/pyproject.toml +++ b/pkgs/community/swarmauri_parser_communitytextblob/pyproject.toml @@ -55,5 +55,5 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.parsers"] -TextBlobNounParser = "swarmauri_parser_communitytextblob:TextBlobNounParser" -TextBlobSentenceParser = "swarmauri_parser_communitytextblob:TextBlobSentenceParser" \ No newline at end of file +TextBlobNounParser = "swarmauri_parser_communitytextblob.TextBlobNounParser:TextBlobNounParser" +TextBlobSentenceParser = "swarmauri_parser_communitytextblob.TextBlobSentenceParser:TextBlobSentenceParser" \ No newline at end of file diff --git a/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobNounParser.py b/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobNounParser.py index 36ad7021..630a69a7 100644 --- a/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobNounParser.py +++ b/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobNounParser.py @@ -1,9 +1,11 @@ +from swarmauri_core.ComponentBase import ComponentBase from textblob import TextBlob from typing import List, Union, Any, Literal from swarmauri_standard.documents.Document import Document from swarmauri_base.parsers.ParserBase import ParserBase +@ComponentBase.register_type(ParserBase, "TextBlobNounParser") class TextBlobNounParser(ParserBase): """ A concrete implementation of IParser using TextBlob for Natural Language Processing tasks. diff --git a/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobSentenceParser.py b/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobSentenceParser.py index 0b94ba9c..4ae90076 100644 --- a/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobSentenceParser.py +++ b/pkgs/community/swarmauri_parser_communitytextblob/swarmauri_parser_communitytextblob/TextBlobSentenceParser.py @@ -1,9 +1,11 @@ +from swarmauri_core.ComponentBase import ComponentBase from textblob import TextBlob from typing import List, Union, Any, Literal from swarmauri_standard.documents.Document import Document from swarmauri_base.parsers.ParserBase import ParserBase +@ComponentBase.register_type(ParserBase, "TextBlobSentenceParser") class TextBlobSentenceParser(ParserBase): """ A parser that leverages TextBlob to break text into sentences. diff --git a/pkgs/community/swarmauri_state_communityclipboard/swarmauri_state_communityclipboard/ClipboardState.py b/pkgs/community/swarmauri_state_communityclipboard/swarmauri_state_communityclipboard/ClipboardState.py index 192a333b..c5125889 100644 --- a/pkgs/community/swarmauri_state_communityclipboard/swarmauri_state_communityclipboard/ClipboardState.py +++ b/pkgs/community/swarmauri_state_communityclipboard/swarmauri_state_communityclipboard/ClipboardState.py @@ -1,8 +1,10 @@ +from swarmauri_core.ComponentBase import ComponentBase import pyperclip from typing import Dict, Any from swarmauri_base.state.StateBase import StateBase +@ComponentBase.register_type(StateBase, "ClipboardState") class ClipboardState(StateBase): """ A concrete implementation of StateBase that uses the system clipboard to store and retrieve state data. @@ -56,7 +58,8 @@ def reset(self) -> None: def deep_copy(self) -> "ClipboardState": """ - Creates a deep copy of the current state. In this context, simply returns a new ClipboardState with the same clipboard data. + Creates a deep copy of the current state. In this context, simply returns a new + ClipboardState with the same clipboard data. """ try: current_state = self.read() diff --git a/pkgs/community/swarmauri_tool_communitycaptchagenerator/swarmauri_tool_communitycaptchagenerator/CaptchaGeneratorTool.py b/pkgs/community/swarmauri_tool_communitycaptchagenerator/swarmauri_tool_communitycaptchagenerator/CaptchaGeneratorTool.py index 40bbc8a1..c3785a27 100644 --- a/pkgs/community/swarmauri_tool_communitycaptchagenerator/swarmauri_tool_communitycaptchagenerator/CaptchaGeneratorTool.py +++ b/pkgs/community/swarmauri_tool_communitycaptchagenerator/swarmauri_tool_communitycaptchagenerator/CaptchaGeneratorTool.py @@ -2,11 +2,13 @@ import base64 from typing import List, Literal, Dict from captcha.image import ImageCaptcha +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "CaptchaGeneratorTool") class CaptchaGeneratorTool(ToolBase): type: Literal["CaptchaGeneratorTool"] = "CaptchaGeneratorTool" name: str = Field( diff --git a/pkgs/community/swarmauri_tool_communitydalechallreadability/swarmauri_tool_communitydalechallreadability/DaleChallReadabilityTool.py b/pkgs/community/swarmauri_tool_communitydalechallreadability/swarmauri_tool_communitydalechallreadability/DaleChallReadabilityTool.py index b93faa5a..7fa5b32a 100644 --- a/pkgs/community/swarmauri_tool_communitydalechallreadability/swarmauri_tool_communitydalechallreadability/DaleChallReadabilityTool.py +++ b/pkgs/community/swarmauri_tool_communitydalechallreadability/swarmauri_tool_communitydalechallreadability/DaleChallReadabilityTool.py @@ -1,9 +1,11 @@ +from swarmauri_core.ComponentBase import ComponentBase import textstat from typing import Any, Dict, List, Literal from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "DaleChallReadabilityTool") class DaleChallReadabilityTool(ToolBase): """ A tool for calculating the Dale-Chall Readability Score using the textstat library. diff --git a/pkgs/community/swarmauri_tool_communitydownloadpdf/swarmauri_tool_communitydownloadpdf/DownloadPdfTool.py b/pkgs/community/swarmauri_tool_communitydownloadpdf/swarmauri_tool_communitydownloadpdf/DownloadPdfTool.py index ae815979..f92e72d2 100644 --- a/pkgs/community/swarmauri_tool_communitydownloadpdf/swarmauri_tool_communitydownloadpdf/DownloadPdfTool.py +++ b/pkgs/community/swarmauri_tool_communitydownloadpdf/swarmauri_tool_communitydownloadpdf/DownloadPdfTool.py @@ -2,10 +2,12 @@ from io import BytesIO import requests from typing import Dict, Literal, List +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "DownloadPDFTool") class DownloadPDFTool(ToolBase): """ A tool to download a PDF from a specified URL and save it to a specified path. diff --git a/pkgs/community/swarmauri_tool_communityentityrecognition/swarmauri_tool_communityentityrecognition/EntityRecognitionTool.py b/pkgs/community/swarmauri_tool_communityentityrecognition/swarmauri_tool_communityentityrecognition/EntityRecognitionTool.py index edc2079a..85907813 100644 --- a/pkgs/community/swarmauri_tool_communityentityrecognition/swarmauri_tool_communityentityrecognition/EntityRecognitionTool.py +++ b/pkgs/community/swarmauri_tool_communityentityrecognition/swarmauri_tool_communityentityrecognition/EntityRecognitionTool.py @@ -1,5 +1,6 @@ import json from typing import List, Literal, Dict, Optional, Callable +from swarmauri_core.ComponentBase import ComponentBase from transformers import pipeline, logging as hf_logging from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter @@ -8,6 +9,7 @@ hf_logging.set_verbosity_error() +@ComponentBase.register_type(ToolBase, "EntityRecognitionTool") class EntityRecognitionTool(ToolBase): """ A tool that extracts named entities from text using a pre-trained NLP model. diff --git a/pkgs/community/swarmauri_tool_communityfolium/pyproject.toml b/pkgs/community/swarmauri_tool_communityfolium/pyproject.toml index 762113a8..125fe217 100644 --- a/pkgs/community/swarmauri_tool_communityfolium/pyproject.toml +++ b/pkgs/community/swarmauri_tool_communityfolium/pyproject.toml @@ -53,4 +53,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.tools"] -FoliumTool = "swarmauri_tool_communityfolium:FoliumTool" \ No newline at end of file +FoliumTool = "swarmauri_tool_communityfolium.FoliumTool:FoliumTool" \ No newline at end of file diff --git a/pkgs/community/swarmauri_tool_communityfolium/swarmauri_tool_communityfolium/FoliumTool.py b/pkgs/community/swarmauri_tool_communityfolium/swarmauri_tool_communityfolium/FoliumTool.py index acfb1de6..7ebedf0c 100644 --- a/pkgs/community/swarmauri_tool_communityfolium/swarmauri_tool_communityfolium/FoliumTool.py +++ b/pkgs/community/swarmauri_tool_communityfolium/swarmauri_tool_communityfolium/FoliumTool.py @@ -1,6 +1,7 @@ # standard/tools/concrete/FoliumTool.py import folium from typing import List, Tuple, Literal, Dict +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter @@ -8,6 +9,7 @@ import io +@ComponentBase.register_type(ToolBase, "FoliumTool") class FoliumTool(ToolBase): type: Literal["FoliumTool"] = "FoliumTool" name: str = Field("FoliumTool", description="Tool to generate maps using Folium.") diff --git a/pkgs/community/swarmauri_tool_communitygithub/pyproject.toml b/pkgs/community/swarmauri_tool_communitygithub/pyproject.toml index 2df5ae7e..3ce3069d 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/pyproject.toml +++ b/pkgs/community/swarmauri_tool_communitygithub/pyproject.toml @@ -55,13 +55,13 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.tools"] -GithubBranchTool = "swarmauri_tool_communitygithub.GithubBranchTool" -GithubCommitTool = "swarmauri_tool_communitygithub.GithubCommitTool" -GithubIssueTool = "swarmauri_tool_communitygithub.GithubIssueTool" -GithubPRTool = "swarmauri_tool_communitygithub.GithubPRTool" -GithubTool = "swarmauri_tool_communitygithub.GithubTool" -GithubRepoTool = "swarmauri_tool_communitygithub.GithubRepoTool" +GithubBranchTool = "swarmauri_tool_communitygithub.GithubBranchTool:GithubBranchTool" +GithubCommitTool = "swarmauri_tool_communitygithub.GithubCommitTool:GithubCommitTool" +GithubIssueTool = "swarmauri_tool_communitygithub.GithubIssueTool:GithubIssueTool" +GithubPRTool = "swarmauri_tool_communitygithub.GithubPRTool:GithubPRTool" +GithubTool = "swarmauri_tool_communitygithub.GithubTool:GithubTool" +GithubRepoTool = "swarmauri_tool_communitygithub.GithubRepoTool:GithubRepoTool" [tool.poetry.plugins."swarmauri.toolkits"] -GithubToolkit = "swarmauri_tool_communitygithub.GithubToolkit" +GithubToolkit = "swarmauri_tool_communitygithub.GithubToolkit:GithubToolkit" diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubBranchTool.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubBranchTool.py index 3ab36aff..1558d451 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubBranchTool.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubBranchTool.py @@ -2,11 +2,13 @@ from github import Github, GithubException from typing import List, Dict, Literal, Any +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field, ConfigDict from swarmauri_base.tools.ToolBase import ToolBase -from swarmauri_standard.tool.Parameter import Parameter +from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "GithubBranchTool") class GithubBranchTool(ToolBase): version: str = "1.1.0" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubCommitTool.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubCommitTool.py index fd69b3be..7ae67742 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubCommitTool.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubCommitTool.py @@ -1,12 +1,11 @@ -# swarmauri/standard/tools/concrete/GithubTool.py - from github import Github, GithubException from typing import List, Dict, Literal, Any +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field, ConfigDict from swarmauri_base.tools.ToolBase import ToolBase -from swarmauri_standard.tool.Parameter import Parameter - +from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "GithubCommitTool") class GithubCommitTool(ToolBase): version: str = "1.1.0" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubIssueTool.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubIssueTool.py index 47d330b9..888e7b58 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubIssueTool.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubIssueTool.py @@ -1,12 +1,12 @@ -# swarmauri/standard/tools/concrete/GithubTool.py - from github import Github, GithubException from typing import List, Dict, Literal, Any +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field, ConfigDict from swarmauri_base.tools.ToolBase import ToolBase -from swarmauri_standard.tool.Parameter import Parameter +from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "GithubCommitTool") class GithubIssueTool(ToolBase): version: str = "1.1.0" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubPRTool.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubPRTool.py index e67ff415..33f864b1 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubPRTool.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubPRTool.py @@ -1,10 +1,8 @@ -# swarmauri/community/tools/concrete/GithubPRTool.py - from github import Github, GithubException from typing import List, Dict, Literal, Any from pydantic import Field, ConfigDict from swarmauri_base.tools.base.ToolBase import ToolBase -from swarmauri_standard.tool.Parameter import Parameter +from swarmauri_standard.tools.Parameter import Parameter class GithubPRTool(ToolBase): diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubRepoTool.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubRepoTool.py index 520514fa..72ccf4a8 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubRepoTool.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubRepoTool.py @@ -1,12 +1,12 @@ -# swarmauri/standard/tools/concrete/GithubTool.py - from github import Github, GithubException from typing import List, Dict, Literal, Any +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field, ConfigDict from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "GithubCommitTool") class GithubRepoTool(ToolBase): version: str = "1.1.0" parameters: List[Parameter] = Field( @@ -66,7 +66,7 @@ def __call__(self, action: str, **kwargs) -> Dict[str, Any]: def create_repo(self, repo_name: str, private: bool = False) -> str: try: user = self._github.get_user() - repo = user.create_repo(repo_name, private=private) + user.create_repo(repo_name, private=private) return f"Repository '{repo_name}' created successfully." except GithubException as e: return f"Error creating repository: {e}" diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubTool.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubTool.py index 65d0ba78..9a339026 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubTool.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubTool.py @@ -2,11 +2,13 @@ from github import Github, GithubException from typing import List, Dict, Literal, Optional, Any +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field, ConfigDict from swarmauri_base.tools.ToolBase import ToolBase -from swarmauri_standard.tool.Parameter import Parameter +from swarmauri_standard.tools.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "GithubTool") class GithubTool(ToolBase): version: str = "1.1.0" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubToolkit.py b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubToolkit.py index 15de6349..39c13c72 100644 --- a/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubToolkit.py +++ b/pkgs/community/swarmauri_tool_communitygithub/swarmauri_tool_communitygithub/GithubToolkit.py @@ -1,7 +1,7 @@ # File: swarmauri/standard/toolkits/concrete/GithubToolkit.py from typing import Literal, Optional -from pydantic import BaseModel +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.toolkits.ToolkitBase import ToolkitBase from swarmauri_tool_communitygithub.GithubRepoTool import GithubRepoTool @@ -15,6 +15,7 @@ load_dotenv() +@ComponentBase.register_type(ToolkitBase, "GithubToolkit") class GithubToolkit(ToolkitBase): type: Literal["GithubToolkit"] = "GithubToolkit" resource: str = "GithubToolkit" diff --git a/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailReadTool.py b/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailReadTool.py index 3ecb5aea..57f843cd 100644 --- a/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailReadTool.py +++ b/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailReadTool.py @@ -1,11 +1,13 @@ from google.oauth2 import service_account from googleapiclient.discovery import build +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter from typing import List, Literal, Dict, Optional from pydantic import Field +@ComponentBase.register_type(ToolBase, "GmailReadTool") class GmailReadTool(ToolBase): SCOPES: List[str] = ["https://www.googleapis.com/auth/gmail.readonly"] version: str = "1.0.0" diff --git a/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailSendTool.py b/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailSendTool.py index 94a9a545..7ed65f95 100644 --- a/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailSendTool.py +++ b/pkgs/community/swarmauri_tool_communitygmail/swarmauri_tool_communitygmail/GmailSendTool.py @@ -3,12 +3,14 @@ from email.mime.text import MIMEText from google.oauth2 import service_account from googleapiclient.discovery import build, Resource +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter from typing import List, Dict, Literal from pydantic import Field +@ComponentBase.register_type(ToolBase, "GmailSendTool") class GmailSendTool(ToolBase): SCOPES: List[str] = ["https://www.googleapis.com/auth/gmail.send"] diff --git a/pkgs/community/swarmauri_tool_communitylexicaldensity/pyproject.toml b/pkgs/community/swarmauri_tool_communitylexicaldensity/pyproject.toml index c70e56f4..9661b036 100644 --- a/pkgs/community/swarmauri_tool_communitylexicaldensity/pyproject.toml +++ b/pkgs/community/swarmauri_tool_communitylexicaldensity/pyproject.toml @@ -55,4 +55,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.tools"] -LexicalDensityTool = "swarmauri_tool_communitylexicaldensity.LexicalDensityTool" \ No newline at end of file +LexicalDensityTool = "swarmauri_tool_communitylexicaldensity.LexicalDensityTool:LexicalDensityTool" \ No newline at end of file diff --git a/pkgs/community/swarmauri_tool_communitylexicaldensity/swarmauri_tool_communitylexicaldensity/LexicalDensityTool.py b/pkgs/community/swarmauri_tool_communitylexicaldensity/swarmauri_tool_communitylexicaldensity/LexicalDensityTool.py index 75889840..1ef0ef9d 100644 --- a/pkgs/community/swarmauri_tool_communitylexicaldensity/swarmauri_tool_communitylexicaldensity/LexicalDensityTool.py +++ b/pkgs/community/swarmauri_tool_communitylexicaldensity/swarmauri_tool_communitylexicaldensity/LexicalDensityTool.py @@ -1,4 +1,5 @@ import nltk +from swarmauri_core.ComponentBase import ComponentBase import textstat from typing import List, Literal, Dict from pydantic import Field @@ -10,6 +11,7 @@ nltk.download("averaged_perceptron_tagger_eng") +@ComponentBase.register_type(ToolBase, "LexicalDensityTool") class LexicalDensityTool(ToolBase): version: str = "0.1.dev2" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitypsutil/swarmauri_tool_communitypsutil/PsutilTool.py b/pkgs/community/swarmauri_tool_communitypsutil/swarmauri_tool_communitypsutil/PsutilTool.py index d458c86b..fc7b25f8 100644 --- a/pkgs/community/swarmauri_tool_communitypsutil/swarmauri_tool_communitypsutil/PsutilTool.py +++ b/pkgs/community/swarmauri_tool_communitypsutil/swarmauri_tool_communitypsutil/PsutilTool.py @@ -1,11 +1,13 @@ # standard/tools/concrete/PsutilTool.py import psutil from typing import Dict, Any, Literal, List, Callable +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field from swarmauri.tools.base.ToolBase import ToolBase from swarmauri.tools.concrete.Parameter import Parameter +@ComponentBase.register_type(ToolBase, "PsutilTool") class PsutilTool(ToolBase): type: Literal["PsutilTool"] = "PsutilTool" name: str = Field( diff --git a/pkgs/community/swarmauri_tool_communityqrcodegenerator/swarmauri_tool_communityqrcodegenerator/QrCodeGeneratorTool.py b/pkgs/community/swarmauri_tool_communityqrcodegenerator/swarmauri_tool_communityqrcodegenerator/QrCodeGeneratorTool.py index 49ff8639..61dcd30c 100644 --- a/pkgs/community/swarmauri_tool_communityqrcodegenerator/swarmauri_tool_communityqrcodegenerator/QrCodeGeneratorTool.py +++ b/pkgs/community/swarmauri_tool_communityqrcodegenerator/swarmauri_tool_communityqrcodegenerator/QrCodeGeneratorTool.py @@ -1,12 +1,14 @@ # standard/tools/concrete/QrCodeGeneratorTool.py import qrcode from typing import List, Literal +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter import base64 +@ComponentBase.register_type(ToolBase, "QrCodeGeneratorTool") class QrCodeGeneratorTool(ToolBase): type: Literal["QrCodeGeneratorTool"] = "QrCodeGeneratorTool" name: str = Field("QrCodeGeneratorTool", description="Tool to generate QR codes.") diff --git a/pkgs/community/swarmauri_tool_communitysentencecomplexity/pyproject.toml b/pkgs/community/swarmauri_tool_communitysentencecomplexity/pyproject.toml index 7672366d..eb8ce2e3 100644 --- a/pkgs/community/swarmauri_tool_communitysentencecomplexity/pyproject.toml +++ b/pkgs/community/swarmauri_tool_communitysentencecomplexity/pyproject.toml @@ -54,4 +54,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.tools"] -SentenceComplexityTool = "swarmauri_tool_communitysentencecomplexity.SentenceComplexityTool" \ No newline at end of file +SentenceComplexityTool = "swarmauri_tool_communitysentencecomplexity.SentenceComplexityTool:SentenceComplexityTool" \ No newline at end of file diff --git a/pkgs/community/swarmauri_tool_communitysentencecomplexity/swarmauri_tool_communitysentencecomplexity/SentenceComplexityTool.py b/pkgs/community/swarmauri_tool_communitysentencecomplexity/swarmauri_tool_communitysentencecomplexity/SentenceComplexityTool.py index bba06eb4..702363ea 100644 --- a/pkgs/community/swarmauri_tool_communitysentencecomplexity/swarmauri_tool_communitysentencecomplexity/SentenceComplexityTool.py +++ b/pkgs/community/swarmauri_tool_communitysentencecomplexity/swarmauri_tool_communitysentencecomplexity/SentenceComplexityTool.py @@ -1,6 +1,7 @@ from typing import List, Literal, Dict import nltk from nltk.tokenize import sent_tokenize, word_tokenize +from pkgs.core.swarmauri_core import ComponentBase from pydantic import Field from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter @@ -10,6 +11,7 @@ nltk.download("punkt_tab", quiet=True) +@ComponentBase.register_type(ToolBase, "SentenceComplexityTool") class SentenceComplexityTool(ToolBase): version: str = "0.1.dev2" parameters: List[Parameter] = Field( @@ -24,7 +26,9 @@ class SentenceComplexityTool(ToolBase): ) name: str = "SentenceComplexityTool" - description: str = "Evaluates sentence complexity based on average sentence length and the number of clauses." + description: str = ( + "Evaluates sentence complexity based on average sentence length and the number of clauses." + ) type: Literal["SentenceComplexityTool"] = "SentenceComplexityTool" def __call__(self, text: str) -> Dict[str, float]: diff --git a/pkgs/community/swarmauri_tool_communitysentimentanalysis/pyproject.toml b/pkgs/community/swarmauri_tool_communitysentimentanalysis/pyproject.toml index b510f26d..8b496b9b 100644 --- a/pkgs/community/swarmauri_tool_communitysentimentanalysis/pyproject.toml +++ b/pkgs/community/swarmauri_tool_communitysentimentanalysis/pyproject.toml @@ -51,4 +51,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.tools"] -SentimentAnalysisTool = "swm_example_community_package.SentimentAnalysisTool:SentimentAnalysisTool" \ No newline at end of file +SentimentAnalysisTool = "swarmauri_tool_communitysentimentanalysis.SentimentAnalysisTool:SentimentAnalysisTool" \ No newline at end of file diff --git a/pkgs/community/swarmauri_tool_communitysentimentanalysis/swarmauri_tool_communitysentimentanalysis/SentimentAnalysisTool.py b/pkgs/community/swarmauri_tool_communitysentimentanalysis/swarmauri_tool_communitysentimentanalysis/SentimentAnalysisTool.py index b8af5135..8e24d139 100644 --- a/pkgs/community/swarmauri_tool_communitysentimentanalysis/swarmauri_tool_communitysentimentanalysis/SentimentAnalysisTool.py +++ b/pkgs/community/swarmauri_tool_communitysentimentanalysis/swarmauri_tool_communitysentimentanalysis/SentimentAnalysisTool.py @@ -3,11 +3,12 @@ from typing import List, Literal, Dict from swarmauri.tools.base.ToolBase import ToolBase from swarmauri.tools.concrete.Parameter import Parameter +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field hf_logging.set_verbosity_error() - +@ComponentBase.register_type(ToolBase, "SentimentAnalysisTool") class SentimentAnalysisTool(ToolBase): """ A tool for analyzing the sentiment of the given text using Hugging Face's transformers. diff --git a/pkgs/community/swarmauri_tool_communitysmogindex/pyproject.toml b/pkgs/community/swarmauri_tool_communitysmogindex/pyproject.toml index 473a0177..882a40eb 100644 --- a/pkgs/community/swarmauri_tool_communitysmogindex/pyproject.toml +++ b/pkgs/community/swarmauri_tool_communitysmogindex/pyproject.toml @@ -53,4 +53,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.tools"] -SMOGIndexTool = "swarmauri_tool_communitysmogindex.SMOGIndexTool" \ No newline at end of file +SMOGIndexTool = "swarmauri_tool_communitysmogindex.SMOGIndexTool:SMOGIndexTool" \ No newline at end of file diff --git a/pkgs/community/swarmauri_tool_communitysmogindex/swarmauri_tool_communitysmogindex/SMOGIndexTool.py b/pkgs/community/swarmauri_tool_communitysmogindex/swarmauri_tool_communitysmogindex/SMOGIndexTool.py index 6a632307..520bd187 100644 --- a/pkgs/community/swarmauri_tool_communitysmogindex/swarmauri_tool_communitysmogindex/SMOGIndexTool.py +++ b/pkgs/community/swarmauri_tool_communitysmogindex/swarmauri_tool_communitysmogindex/SMOGIndexTool.py @@ -1,6 +1,7 @@ from typing import List, Literal, Dict +from swarmauri_core.ComponentBase import ComponentBase from pydantic import Field -from swarmauri_base.tools.base.ToolBase import ToolBase +from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter import re import math @@ -13,6 +14,7 @@ nltk.download("punkt_tab", quiet=True) +@ComponentBase.register_type(ToolBase, "SMOGIndexTool") class SMOGIndexTool(ToolBase): version: str = "0.1.dev2" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitytextlength/swarmauri_tool_communitytextlength/TextLengthTool.py b/pkgs/community/swarmauri_tool_communitytextlength/swarmauri_tool_communitytextlength/TextLengthTool.py index be9fd56f..071f2f43 100644 --- a/pkgs/community/swarmauri_tool_communitytextlength/swarmauri_tool_communitytextlength/TextLengthTool.py +++ b/pkgs/community/swarmauri_tool_communitytextlength/swarmauri_tool_communitytextlength/TextLengthTool.py @@ -1,3 +1,4 @@ +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_core.typing import SubclassUnion from typing import List, Literal, Dict from pydantic import Field @@ -9,7 +10,7 @@ # Download required NLTK data once during module load nltk.download("punkt", quiet=True) - +@ComponentBase.register_type(ToolBase, "TextLengthTool") class TextLengthTool(ToolBase): version: str = "0.1.dev1" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communitywebscraping/swarmauri_tool_communitywebscraping/WebScrapingTool.py b/pkgs/community/swarmauri_tool_communitywebscraping/swarmauri_tool_communitywebscraping/WebScrapingTool.py index 35c7028b..d36ba831 100644 --- a/pkgs/community/swarmauri_tool_communitywebscraping/swarmauri_tool_communitywebscraping/WebScrapingTool.py +++ b/pkgs/community/swarmauri_tool_communitywebscraping/swarmauri_tool_communitywebscraping/WebScrapingTool.py @@ -1,11 +1,13 @@ import requests from bs4 import BeautifulSoup +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter from typing import List, Literal, Dict from pydantic import Field +@ComponentBase.register_type(ToolBase, "WebScrapingTool") class WebScrapingTool(ToolBase): version: str = "1.0.0" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_tool_communityzapierhook/swarmauri_tool_communityzapierhook/ZapierHookTool.py b/pkgs/community/swarmauri_tool_communityzapierhook/swarmauri_tool_communityzapierhook/ZapierHookTool.py index 5535db32..a4deb3c5 100644 --- a/pkgs/community/swarmauri_tool_communityzapierhook/swarmauri_tool_communityzapierhook/ZapierHookTool.py +++ b/pkgs/community/swarmauri_tool_communityzapierhook/swarmauri_tool_communityzapierhook/ZapierHookTool.py @@ -1,6 +1,7 @@ import json import requests from typing import Dict, List, Literal +from swarmauri_core.ComponentBase import ComponentBase from swarmauri_base.tools.ToolBase import ToolBase from swarmauri_standard.tools.Parameter import Parameter from pydantic import Field @@ -21,7 +22,7 @@ """ - +@ComponentBase.register_type(ToolBase, "ZapierHookTool") class ZapierHookTool(ToolBase): version: str = "1.0.0" parameters: List[Parameter] = Field( diff --git a/pkgs/community/swarmauri_vectorstore_communityannoy/swarmauri_vectorstore_communityannoy/AnnoyVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityannoy/swarmauri_vectorstore_communityannoy/AnnoyVectorStore.py index 3331e296..ab73d728 100644 --- a/pkgs/community/swarmauri_vectorstore_communityannoy/swarmauri_vectorstore_communityannoy/AnnoyVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communityannoy/swarmauri_vectorstore_communityannoy/AnnoyVectorStore.py @@ -3,6 +3,7 @@ from annoy import AnnoyIndex import os +from pkgs.core.swarmauri_core import ComponentBase from swarmauri_standard.documents.Document import Document from swarmauri_vectorstore_doc2vec.Doc2VecEmbedding import Doc2VecEmbedding from swarmauri_standard.distances.CosineDistance import CosineDistance @@ -17,6 +18,7 @@ ) +@ComponentBase.register_type(VectorStoreBase, "AnnoyVectorStore") class AnnoyVectorStore( VectorStoreRetrieveMixin, VectorStoreCloudMixin, diff --git a/pkgs/community/swarmauri_vectorstore_communitycloudweaviate/swarmauri_vectorstore_communitycloudweaviate/CloudWeaviateVectorStore.py b/pkgs/community/swarmauri_vectorstore_communitycloudweaviate/swarmauri_vectorstore_communitycloudweaviate/CloudWeaviateVectorStore.py index 7f2170f2..8e734736 100644 --- a/pkgs/community/swarmauri_vectorstore_communitycloudweaviate/swarmauri_vectorstore_communitycloudweaviate/CloudWeaviateVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communitycloudweaviate/swarmauri_vectorstore_communitycloudweaviate/CloudWeaviateVectorStore.py @@ -1,4 +1,5 @@ from typing import List, Union, Literal, Optional +from swarmauri_core.ComponentBase import ComponentBase from pydantic import PrivateAttr import uuid as ud import weaviate @@ -20,6 +21,7 @@ from swarmauri_base.vector_stores.VectorStoreCloudMixin import VectorStoreCloudMixin +@ComponentBase.register_type(VectorStoreBase, "CloudWeaviateVectorStore") class CloudWeaviateVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, diff --git a/pkgs/community/swarmauri_vectorstore_communityduckDB/pyproject.toml b/pkgs/community/swarmauri_vectorstore_communityduckDB/pyproject.toml index d4dcf58a..b430f45e 100644 --- a/pkgs/community/swarmauri_vectorstore_communityduckDB/pyproject.toml +++ b/pkgs/community/swarmauri_vectorstore_communityduckDB/pyproject.toml @@ -55,4 +55,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.vector_stores"] -DuckDBVectorStore = "swarmauri_vectorstore_communityduckDB:DuckDBVectorStore" \ No newline at end of file +DuckDBVectorStore = "swarmauri_vectorstore_communityduckDB.DuckDBVectorStore:DuckDBVectorStore" \ No newline at end of file diff --git a/pkgs/community/swarmauri_vectorstore_communityduckDB/swarmauri_vectorstore_communityduckDB/DuckDBVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityduckDB/swarmauri_vectorstore_communityduckDB/DuckDBVectorStore.py index 0e6c6ee2..354bfe5d 100644 --- a/pkgs/community/swarmauri_vectorstore_communityduckDB/swarmauri_vectorstore_communityduckDB/DuckDBVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communityduckDB/swarmauri_vectorstore_communityduckDB/DuckDBVectorStore.py @@ -17,8 +17,10 @@ from swarmauri_base.vector_stores.VectorStoreSaveLoadMixin import ( VectorStoreSaveLoadMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "DuckDBVectorStore") class DuckDBVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, VectorStoreBase ): diff --git a/pkgs/community/swarmauri_vectorstore_communitymlm/pyproject.toml b/pkgs/community/swarmauri_vectorstore_communitymlm/pyproject.toml index f2724923..29db507d 100644 --- a/pkgs/community/swarmauri_vectorstore_communitymlm/pyproject.toml +++ b/pkgs/community/swarmauri_vectorstore_communitymlm/pyproject.toml @@ -54,5 +54,9 @@ log_cli_format = "%(asctime)s [%(levelname)s] %(message)s" log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" -[tool.poetry.plugins."swarmauri.vectorstores"] -ExampleCommunityAgent = "swarmauri_vectorstore_communitymlm.ExampleCommunityAgent:ExampleCommunityAgent" +[tool.poetry.plugins."swarmauri.vector_stores"] +MlmVectorStore = "swarmauri_vectorstore_communitymlm.MlmVectorStore:MlmVectorStore" + +[tool.poetry.plugins."swarmauri.embeddings"] +MlmEmbedding = "swarmauri_vectorstore_communitymlm.MlmEmbedding:MlmEmbedding" + diff --git a/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmEmbedding.py b/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmEmbedding.py index d0a5dde1..1a5336a1 100644 --- a/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmEmbedding.py +++ b/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmEmbedding.py @@ -8,8 +8,10 @@ from swarmauri_base.embeddings.EmbeddingBase import EmbeddingBase from swarmauri_standard.vectors.Vector import Vector +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(EmbeddingBase, "MlmEmbedding") class MlmEmbedding(EmbeddingBase): """ EmbeddingBase implementation that fine-tunes a Masked Language Model (MLM). diff --git a/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmVectorStore.py b/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmVectorStore.py index 161c33d4..534c486f 100644 --- a/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communitymlm/swarmauri_vectorstore_communitymlm/MlmVectorStore.py @@ -10,8 +10,10 @@ from swarmauri_base.vector_stores.VectorStoreSaveLoadMixin import ( VectorStoreSaveLoadMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "MlmVectorStore") class MlmVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, VectorStoreBase ): diff --git a/pkgs/community/swarmauri_vectorstore_communityneo4j/pyproject.toml b/pkgs/community/swarmauri_vectorstore_communityneo4j/pyproject.toml index 14f1c8fe..ca28f761 100644 --- a/pkgs/community/swarmauri_vectorstore_communityneo4j/pyproject.toml +++ b/pkgs/community/swarmauri_vectorstore_communityneo4j/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "swarmauri_vectorstore_communityneo4j" version = "0.6.0.dev1" -description = "Word2Vec Document Store for Swarmauri." +description = "Swarmauri Neo4j Vector Store" authors = ["Jacob Stewart "] license = "Apache-2.0" readme = "README.md" @@ -53,4 +53,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.vector_stores"] -Neo4jVectorStore = "swarmauri_vectorstore_communityneo4j:Neo4jVectorStore" \ No newline at end of file +Neo4jVectorStore = "swarmauri_vectorstore_communityneo4j.Neo4jVectorStore:Neo4jVectorStore" \ No newline at end of file diff --git a/pkgs/community/swarmauri_vectorstore_communityneo4j/swarmauri_vectorstore_communityneo4j/Neo4jVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityneo4j/swarmauri_vectorstore_communityneo4j/Neo4jVectorStore.py index 2aded65b..2f14a9a6 100644 --- a/pkgs/community/swarmauri_vectorstore_communityneo4j/swarmauri_vectorstore_communityneo4j/Neo4jVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communityneo4j/swarmauri_vectorstore_communityneo4j/Neo4jVectorStore.py @@ -11,8 +11,10 @@ from swarmauri_base.vector_stores.VectorStoreSaveLoadMixin import ( VectorStoreSaveLoadMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "Neo4jVectorStore") class Neo4jVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, VectorStoreBase, BaseModel ): diff --git a/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/pyproject.toml b/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/pyproject.toml index 0ac48c82..6ca64213 100644 --- a/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/pyproject.toml +++ b/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/pyproject.toml @@ -55,4 +55,4 @@ log_cli_date_format = "%Y-%m-%d %H:%M:%S" asyncio_default_fixture_loop_scope = "function" [tool.poetry.plugins."swarmauri.vector_stores"] -PersistentChromaDBVectorStore = "swarmauri_vectorstore_communitypersistentchromaDB.PersistentChromaDBVectorStore" \ No newline at end of file +PersistentChromaDBVectorStore = "swarmauri_vectorstore_communitypersistentchromaDB.PersistentChromaDBVectorStore:PersistentChromaDBVectorStore" \ No newline at end of file diff --git a/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/swarmauri_vectorstore_communitypersistentchromaDB/PersistentChromaDBVectorStore.py b/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/swarmauri_vectorstore_communitypersistentchromaDB/PersistentChromaDBVectorStore.py index 70b52b39..59ebff0b 100644 --- a/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/swarmauri_vectorstore_communitypersistentchromaDB/PersistentChromaDBVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communitypersistentchromaDB/swarmauri_vectorstore_communitypersistentchromaDB/PersistentChromaDBVectorStore.py @@ -17,8 +17,10 @@ from swarmauri.vector_stores.base.VectorStorePersistentMixin import ( VectorStorePersistentMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "PersistentChromaDBVectorStore") class PersistentChromaDBVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, diff --git a/pkgs/community/swarmauri_vectorstore_communitypinecone/swarmauri_vectorstore_communitypinecone/PineconeVectorStore.py b/pkgs/community/swarmauri_vectorstore_communitypinecone/swarmauri_vectorstore_communitypinecone/PineconeVectorStore.py index 31c7d6c9..b2cb8ea4 100644 --- a/pkgs/community/swarmauri_vectorstore_communitypinecone/swarmauri_vectorstore_communitypinecone/PineconeVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communitypinecone/swarmauri_vectorstore_communitypinecone/PineconeVectorStore.py @@ -18,8 +18,10 @@ from swarmauri.vector_stores.base.VectorStoreSaveLoadMixin import ( VectorStoreSaveLoadMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "PineconeVectorStore") class PineconeVectorStore( VectorStoreRetrieveMixin, VectorStoreCloudMixin, diff --git a/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/CloudQdrantVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/CloudQdrantVectorStore.py index 830dd540..77926cc3 100644 --- a/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/CloudQdrantVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/CloudQdrantVectorStore.py @@ -23,8 +23,10 @@ from swarmauri_base.vector_stores.VectorStoreCloudMixin import ( VectorStoreCloudMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "CloudQdrantVectorStore") class CloudQdrantVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, diff --git a/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/PersistentQdrantVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/PersistentQdrantVectorStore.py index a6a79066..7547badf 100644 --- a/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/PersistentQdrantVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communityqdrant/swarmauri_vectorstore_communityqdrant/PersistentQdrantVectorStore.py @@ -22,8 +22,10 @@ from swarmauri_base.vector_stores.VectorStorePersistentMixin import ( VectorStorePersistentMixin, ) +from swarmauri_core.ComponentBase import ComponentBase +@ComponentBase.register_type(VectorStoreBase, "PersistentQdrantVectorStore") class PersistentQdrantVectorStore( VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, diff --git a/pkgs/community/swarmauri_vectorstore_communityqdrant/tests/unit/CloudQdrantVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityqdrant/tests/unit/CloudQdrantVectorStore.py deleted file mode 100644 index 830dd540..00000000 --- a/pkgs/community/swarmauri_vectorstore_communityqdrant/tests/unit/CloudQdrantVectorStore.py +++ /dev/null @@ -1,260 +0,0 @@ -from typing import List, Union, Literal - -from pydantic import PrivateAttr, Field, ConfigDict - -from qdrant_client import QdrantClient -from qdrant_client.models import ( - PointStruct, - VectorParams, - Distance, -) - -from swarmauri_standard.documents.Document import Document -from swarmauri_vectorstore_doc2vec.Doc2VecEmbedding import Doc2VecEmbedding -from swarmauri_standard.distances.CosineDistance import CosineDistance - -from swarmauri_base.vector_stores.VectorStoreBase import VectorStoreBase -from swarmauri_base.vector_stores.VectorStoreRetrieveMixin import ( - VectorStoreRetrieveMixin, -) -from swarmauri_base.vector_stores.VectorStoreSaveLoadMixin import ( - VectorStoreSaveLoadMixin, -) -from swarmauri_base.vector_stores.VectorStoreCloudMixin import ( - VectorStoreCloudMixin, -) - - -class CloudQdrantVectorStore( - VectorStoreSaveLoadMixin, - VectorStoreRetrieveMixin, - VectorStoreCloudMixin, - VectorStoreBase, -): - """ - CloudQdrantVectorStore is a concrete implementation that integrates functionality - for saving, loading, storing, and retrieving vector documents, leveraging Qdrant as the backend. - """ - - type: Literal["CloudQdrantVectorStore"] = "CloudQdrantVectorStore" - - # allow arbitary types in the model config - model_config = ConfigDict(arbitrary_types_allowed=True) - - # Use PrivateAttr to make _embedder and _distance private - _embedder: Doc2VecEmbedding = PrivateAttr() - _distance: CosineDistance = PrivateAttr() - client: Union[QdrantClient, None] = Field(default=None, init=False) - - def __init__(self, **kwargs): - super().__init__(**kwargs) - - self._embedder = Doc2VecEmbedding(vector_size=self.vector_size) - self._distance = CosineDistance() - - def connect(self) -> None: - """ - Connects to the Qdrant cloud vector store using the provided credentials. - """ - if self.client is None: - self.client = QdrantClient( - api_key=self.api_key, - url=self.url, - ) - - # TODO may need optimization two loops may not be necessary - # Check if the collection exists - existing_collections = self.client.get_collections().collections - collection_names = [collection.name for collection in existing_collections] - - if self.collection_name not in collection_names: - # Ensure the collection exists with the desired configuration - self.client.recreate_collection( - collection_name=self.collection_name, - vectors_config=VectorParams( - size=self.vector_size, distance=Distance.COSINE - ), - ) - - def disconnect(self) -> None: - """ - Disconnects from the Qdrant cloud vector store. - """ - if self.client is not None: - self.client = None - - def add_document(self, document: Document) -> None: - """ - Add a single document to the document store. - - Parameters: - document (Document): The document to be added to the store. - """ - embedding = None - if not document.embedding: - self._embedder.fit([document.content]) # Fit only once - embedding = ( - self._embedder.transform([document.content])[0].to_numpy().tolist() - ) - else: - embedding = document.embedding - - payload = { - "content": document.content, - "metadata": document.metadata, - } - - doc = PointStruct(id=document.id, vector=embedding, payload=payload) - - self.client.upsert( - collection_name=self.collection_name, - points=[doc], - ) - - def add_documents(self, documents: List[Document]) -> None: - """ - Add multiple documents to the document store in a batch operation. - - Parameters: - documents (List[Document]): A list of documents to be added to the store. - """ - points = [ - PointStruct( - id=doc.id, - vector=doc.embedding - or self._embedder.fit_transform([doc.content])[0].to_numpy().tolist(), - payload={"content": doc.content, "metadata": doc.metadata}, - ) - for doc in documents - ] - self.client.upsert(self.collection_name, points=points) - - def get_document(self, id: str) -> Union[Document, None]: - """ - Retrieve a single document by its identifier. - - Parameters: - id (str): The unique identifier of the document to retrieve. - - Returns: - Union[Document, None]: The requested document if found; otherwise, None. - """ - response = self.client.retrieve( - collection_name=self.collection_name, - ids=[id], - ) - if response: - payload = response[0].payload - return Document( - id=id, content=payload["content"], metadata=payload["metadata"] - ) - return None - - def get_all_documents(self) -> List[Document]: - """ - Retrieve all documents stored in the document store. - - Returns: - List[Document]: A list of all documents in the store. - """ - response = self.client.scroll( - collection_name=self.collection_name, - ) - - return [ - Document( - id=doc.id, - content=doc.payload["content"], - metadata=doc.payload["metadata"], - ) - for doc in response[0] - ] - - def delete_document(self, id: str) -> None: - """ - Delete a document from the document store by its identifier. - - Parameters: - id (str): The unique identifier of the document to delete. - """ - self.client.delete(self.collection_name, points_selector=[id]) - - def update_document(self, id: str, updated_document: Document) -> None: - """ - Update a document in the document store. - - Parameters: - id (str): The unique identifier of the document to update. - updated_document (Document): The updated document instance. - """ - # Precompute the embedding outside the update process - if not updated_document.embedding: - # Transform without refitting to avoid vocabulary issues - document_vector = self._embedder.transform([updated_document.content])[0] - else: - document_vector = updated_document.embedding - - document_vector = document_vector.to_numpy().tolist() - - self.client.upsert( - self.collection_name, - points=[ - PointStruct( - id=id, - vector=document_vector, - payload={ - "content": updated_document.content, - "metadata": updated_document.metadata, - }, - ) - ], - ) - - def clear_documents(self) -> None: - """ - Deletes all documents from the vector store - """ - self.client.delete_collection(self.collection_name) - - def document_count(self) -> int: - """ - Returns the number of documents in the store. - """ - response = self.client.scroll( - collection_name=self.collection_name, - ) - return len(response) - - def retrieve(self, query: str, top_k: int = 5) -> List[Document]: - """ - Retrieve the top_k most relevant documents based on the given query. - For the purpose of this example, this method performs a basic search. - - Args: - query (str): The query string used for document retrieval. - top_k (int): The number of top relevant documents to retrieve. - - Returns: - List[Document]: A list of the top_k most relevant documents. - """ - query_vector = self._embedder.infer_vector(query).value - results = self.client.search( - collection_name=self.collection_name, query_vector=query_vector, limit=top_k - ) - - return [ - Document( - id=res.id, - content=res.payload["content"], - metadata=res.payload["metadata"], - ) - for res in results - ] - - # Override the model_dump_json method - def model_dump_json(self, *args, **kwargs) -> str: - # Call the disconnect method before serialization - self.disconnect() - - # Now proceed with the usual JSON serialization - return super().model_dump_json(*args, **kwargs) diff --git a/pkgs/community/swarmauri_vectorstore_communityqdrant/tests/unit/CloudQdrantVectorStore_test.py b/pkgs/community/swarmauri_vectorstore_communityqdrant/tests/unit/CloudQdrantVectorStore_test.py new file mode 100644 index 00000000..95daf89c --- /dev/null +++ b/pkgs/community/swarmauri_vectorstore_communityqdrant/tests/unit/CloudQdrantVectorStore_test.py @@ -0,0 +1,64 @@ +import os +import pytest +from swarmauri.documents.concrete.Document import Document +from swarmauri_vectorstore_communityqdrant.CloudQdrantVectorStore import ( + CloudQdrantVectorStore, +) + + +# Fixture to initialize CloudQdrantVectorStore and check for required environment variables +@pytest.fixture(scope="module") +def cloud_qdrant_vector_store(): + API_KEY = os.getenv("QDRANT_API_KEY") + COLLECTION_NAME = os.getenv("QDRANT_COLLECTION_NAME") + URL = os.getenv("QDRANT_URL_KEY") + + # Skip tests if required environment variables are not set + if not API_KEY or not COLLECTION_NAME or not URL: + pytest.skip("Skipping tests due to missing environment variables.") + + # Return the initialized vector store + vs = CloudQdrantVectorStore( + api_key=API_KEY, + collection_name=COLLECTION_NAME, + vector_size=100, + url=URL, + ) + return vs + + +@pytest.mark.unit +def test_ubc_resource(cloud_qdrant_vector_store): + vs = cloud_qdrant_vector_store + assert vs.resource == "VectorStore" + assert vs.embedder.resource == "Embedding" + + +@pytest.mark.unit +def test_ubc_type(cloud_qdrant_vector_store): + vs = cloud_qdrant_vector_store + assert vs.type == "CloudQdrantVectorStore" + + +@pytest.mark.unit +def test_serialization(cloud_qdrant_vector_store): + vs = cloud_qdrant_vector_store + assert vs.id == CloudQdrantVectorStore.model_validate_json(vs.model_dump_json()).id + + +@pytest.mark.unit +def test_top_k(cloud_qdrant_vector_store): + vs = cloud_qdrant_vector_store + + # Connect to the Qdrant cloud vector store + vs.connect() + + documents = [ + Document(content="test"), + Document(content="test1"), + Document(content="test2"), + Document(content="test3"), + ] + + vs.add_documents(documents) + assert len(vs.retrieve(query="test", top_k=2)) == 2 diff --git a/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisDocumentRetriever.py b/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisDocumentRetriever.py index c7684bad..065dc060 100644 --- a/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisDocumentRetriever.py +++ b/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisDocumentRetriever.py @@ -5,8 +5,9 @@ ConcreteDocument, ) from swarmauri_base.retrievers.DocumentRetrieverBase import DocumentRetrieverBase +from swarmauri_core.ComponentBase import ComponentBase - +@ComponentBase.register_type(DocumentRetrieverBase, "RedisDocumentRetriever") class RedisDocumentRetriever(DocumentRetrieverBase): """ A document retriever that fetches documents from a Redis store. diff --git a/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisVectorStore.py b/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisVectorStore.py index f132a9ee..7e0b2131 100644 --- a/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisVectorStore.py +++ b/pkgs/community/swarmauri_vectorstore_communityredis/swarmauri_vectorstore_communityredis/RedisVectorStore.py @@ -13,8 +13,9 @@ from swarmauri_base.vector_stores.VectorStoreBase import VectorStoreBase from swarmauri_base.vector_stores.VectorStoreRetrieveMixin import VectorStoreRetrieveMixin from swarmauri_base.vector_stores.VectorStoreSaveLoadMixin import VectorStoreSaveLoadMixin +from swarmauri_core.ComponentBase import ComponentBase - +@ComponentBase.register_type(VectorStoreBase, "RedisVectorStore") class RedisVectorStore(VectorStoreSaveLoadMixin, VectorStoreRetrieveMixin, VectorStoreBase): type: Literal["RedisVectorStore"] = "RedisVectorStore" index_name: str = "documents_index" diff --git a/pkgs/standards/swarmauri_parser_beautifulsoupelement/tests/unit/BeautifulSoupElementParser_unit_test.py b/pkgs/standards/swarmauri_parser_beautifulsoupelement/tests/unit/BeautifulSoupElementParser_unit_test.py index 65342439..8e7e7458 100644 --- a/pkgs/standards/swarmauri_parser_beautifulsoupelement/tests/unit/BeautifulSoupElementParser_unit_test.py +++ b/pkgs/standards/swarmauri_parser_beautifulsoupelement/tests/unit/BeautifulSoupElementParser_unit_test.py @@ -1,6 +1,6 @@ import pytest -from swarmauri.documents.concrete.Document import Document -from swarmauri.parsers.concrete.BeautifulSoupElementParser import ( +from swarmauri_standard.documents.Document import Document +from swarmauri_parser_beautifulsoupelement.BeautifulSoupElementParser import ( BeautifulSoupElementParser as Parser, )