Skip to content

Commit

Permalink
[FIXED IMPORT PATHS]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye Gomez authored and Kye Gomez committed Aug 28, 2024
1 parent 253fd02 commit b6097d6
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "swarms-memory"
version = "0.0.9"
version = "0.1.1"
description = "Swarms Memory - Pytorch"
license = "MIT"
authors = ["Kye Gomez <[email protected]>"]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions swarms_memory/dbs/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import Session
from swarms_memory import BaseVectorDatabase
from swarms_memory.dbs.base_db import AbstractDatabase


class PostgresDB(BaseVectorDatabase):
class PostgresDB(AbstractDatabase):
"""
A class representing a Postgres database.
Expand Down
17 changes: 14 additions & 3 deletions swarms_memory/dbs/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@
import pinecone
from attr import define, field

from swarms_memory import BaseVectorDatabase
from swarms.utils import str_to_hash
from swarms_memory.dbs.base_db import AbstractDatabase


def str_to_hash(s: str) -> str:
"""Converts a string to a hash.
Args:
s (str): The string to convert.
Returns:
str: The hash of the string.
"""
return str(hash(s))


@define
class PineconeDB(BaseVectorDatabase):
class PineconeDB(AbstractDatabase):
"""
PineconeDB is a vector storage driver that uses Pinecone as the underlying storage engine.
Expand Down
4 changes: 2 additions & 2 deletions swarms_memory/dbs/sqlite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, List, Optional, Tuple

from swarms_memory import BaseVectorDatabase
from swarms_memory.dbs.base_db import AbstractDatabase

try:
import sqlite3
Expand All @@ -10,7 +10,7 @@
)


class SQLiteDB(BaseVectorDatabase):
class SQLiteDB(AbstractDatabase):
"""
A reusable class for SQLite database operations with methods for adding,
deleting, updating, and querying data.
Expand Down
2 changes: 1 addition & 1 deletion swarms_memory/utils/short_term_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ShortTermMemory:
Example:
>>> from swarms.memory.short_term_memory import ShortTermMemory
>>> from swarms_memory.short_term_memory import ShortTermMemory
>>> stm = ShortTermMemory()
>>> stm.add(role="agent", message="Hello world!")
>>> stm.add(role="agent", message="How are you?")
Expand Down
2 changes: 1 addition & 1 deletion swarms_memory/vector_dbs/chroma_db_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import chromadb
from dotenv import load_dotenv
from loguru import logger
from swarms.memory.base_vectordb import BaseVectorDatabase
from swarms_memory.vector_dbs.base_vectordb import BaseVectorDatabase
from swarms.utils.data_to_text import data_to_text

# Load environment variables
Expand Down
2 changes: 1 addition & 1 deletion swarms_memory/vector_dbs/faiss_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from loguru import logger
from sentence_transformers import SentenceTransformer
from swarms.memory.base_vectordb import BaseVectorDatabase
from swarms_memory.vector_dbs.base_vectordb import BaseVectorDatabase


class FAISSDB(BaseVectorDatabase):
Expand Down
3 changes: 1 addition & 2 deletions swarms_memory/vector_dbs/pinecone_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import pinecone
from loguru import logger
from sentence_transformers import SentenceTransformer
from swarms.memory.base_vectordb import BaseVectorDatabase

from swarms_memory.vector_dbs.base_vectordb import BaseVectorDatabase

class PineconeMemory(BaseVectorDatabase):
"""
Expand Down

0 comments on commit b6097d6

Please sign in to comment.