Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added vector indexes and moved vector properties to sub classes… #171

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions unoplat-code-confluence-commons/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
class BaseNode(StructuredNode):
"""Base node with common properties"""
qualified_name = StringProperty(unique_index=True, required=True)
objective_embedding = ArrayProperty(default=[])
implementation_embedding = ArrayProperty(default=[])


class ContainsRelationship(StructuredRel):
"""Relationship for representing containment between nodes"""
pass
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from .base_models import BaseNode, ContainsRelationship
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One,ArrayProperty,VectorIndex

class Class(BaseNode):
"""Represents a class in a package"""
node_name = StringProperty(required=True)
node_summary = StringProperty(default="")
node_objective = StringProperty(default="")
class_name = StringProperty(required=True)
class_implementation_summary = StringProperty(default="")
class_objective = StringProperty(default="")
class_objective_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
class_implementation_summary_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
# Class relationships
package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=One)
methods = RelationshipTo('Method', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@
RelationshipTo,
RelationshipFrom,
ZeroOrMore,
One
One,
ArrayProperty,
VectorIndex
)
from .base_models import BaseNode, ContainsRelationship

class Codebase(BaseNode):
"""Represents a codebase in the system"""
codebase_summary = StringProperty(default="")
codebase_objective = StringProperty(default="")
codebase_objective_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
codebase_implementation_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
# One codebase can contain multiple packages
packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
from .base_models import BaseNode, ContainsRelationship
from neomodel import RelationshipFrom, StringProperty,One
from neomodel import RelationshipFrom, StringProperty,One,ArrayProperty,VectorIndex

class Method(BaseNode):
"""Represents a method in a class"""
function_name = StringProperty(required=True)
function_summary = StringProperty(default="")
function_implementation_summary = StringProperty(default="")
function_objective = StringProperty(default="")
function_objective_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
function_summary_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
# Method relationships
class_ = RelationshipFrom('Class', 'CONTAINS', model=ContainsRelationship, cardinality=One)
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from .base_models import BaseNode, ContainsRelationship
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One
from neomodel import RelationshipFrom, RelationshipTo, StringProperty,ZeroOrMore,One,ArrayProperty,VectorIndex

class Package(BaseNode):
"""Represents a package in the codebase"""
package_objective = StringProperty(required=True)
package_summary = StringProperty(required=True)
package_implementation_summary = StringProperty(required=True,default="")
package_objective_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
package_implementation_summary_embedding = ArrayProperty(
default=[],
vector_index=VectorIndex(dimensions=4096, similarity_function='cosine')
)
# Package relationships
codebase = RelationshipFrom('Codebase', 'CONTAINS', model=ContainsRelationship, cardinality=One)
sub_packages = RelationshipTo('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
parent_package = RelationshipFrom('Package', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
classes = RelationshipTo('Class', 'CONTAINS', model=ContainsRelationship, cardinality=ZeroOrMore)
Loading