Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
prasmussen15 committed Nov 14, 2024
1 parent 0fc9d45 commit 86b012c
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions graphiti_core/graphiti.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ class AddEpisodeResults(BaseModel):

class Graphiti:
def __init__(
self,
uri: str,
user: str,
password: str,
llm_client: LLMClient | None = None,
embedder: EmbedderClient | None = None,
cross_encoder: CrossEncoderClient | None = None,
store_raw_episode_content: bool = True,
self,
uri: str,
user: str,
password: str,
llm_client: LLMClient | None = None,
embedder: EmbedderClient | None = None,
cross_encoder: CrossEncoderClient | None = None,
store_raw_episode_content: bool = True,
):
"""
Initialize a Graphiti instance.
Expand Down Expand Up @@ -220,10 +220,10 @@ async def build_indices_and_constraints(self, delete_existing: bool = False):
await build_indices_and_constraints(self.driver, delete_existing)

async def retrieve_episodes(
self,
reference_time: datetime,
last_n: int = EPISODE_WINDOW_LEN,
group_ids: list[str] | None = None,
self,
reference_time: datetime,
last_n: int = EPISODE_WINDOW_LEN,
group_ids: list[str] | None = None,
) -> list[EpisodicNode]:
"""
Retrieve the last n episodic nodes from the graph.
Expand Down Expand Up @@ -253,15 +253,15 @@ async def retrieve_episodes(
return await retrieve_episodes(self.driver, reference_time, last_n, group_ids)

async def add_episode(
self,
name: str,
episode_body: str,
source_description: str,
reference_time: datetime,
source: EpisodeType = EpisodeType.message,
group_id: str = '',
uuid: str | None = None,
update_communities: bool = False,
self,
name: str,
episode_body: str,
source_description: str,
reference_time: datetime,
source: EpisodeType = EpisodeType.message,
group_id: str = '',
uuid: str | None = None,
update_communities: bool = False,
) -> AddEpisodeResults:
"""
Process an episode and update the graph.
Expand Down Expand Up @@ -617,11 +617,11 @@ async def build_communities(self, group_ids: list[str] | None = None) -> list[Co
return community_nodes

async def search(
self,
query: str,
center_node_uuid: str | None = None,
group_ids: list[str] | None = None,
num_results=DEFAULT_SEARCH_LIMIT,
self,
query: str,
center_node_uuid: str | None = None,
group_ids: list[str] | None = None,
num_results=DEFAULT_SEARCH_LIMIT,
) -> list[EntityEdge]:
"""
Perform a hybrid search on the knowledge graph.
Expand Down Expand Up @@ -674,12 +674,12 @@ async def search(
return edges

async def _search(
self,
query: str,
config: SearchConfig,
group_ids: list[str] | None = None,
center_node_uuid: str | None = None,
bfs_origin_node_uuids: list[str] | None = None,
self,
query: str,
config: SearchConfig,
group_ids: list[str] | None = None,
center_node_uuid: str | None = None,
bfs_origin_node_uuids: list[str] | None = None,
) -> SearchResults:
return await search(
self.driver,
Expand Down

0 comments on commit 86b012c

Please sign in to comment.