From 30ab064f76163f8dca305fd45b9bc1aeaee1b8e7 Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:02:16 -0700 Subject: [PATCH] wip --- README.md | 12 ++++++------ graphiti_core/llm_client/openai_client.py | 4 ++-- .../utils/maintenance/community_operations.py | 4 +--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 94d00471..3e11c6a5 100644 --- a/README.md +++ b/README.md @@ -151,12 +151,6 @@ For a complete working example, see the [Quickstart Example](./examples/quicksta The example is fully documented with clear explanations of each functionality and includes a comprehensive README with setup instructions and next steps. -## Graph Service - -The `server` directory contains an API service for interacting with the Graphiti API. It is built using FastAPI. - -Please see the [server README](./server/README.md) for more information. - ## MCP Server The `mcp_server` directory contains a Model Context Protocol (MCP) server implementation for Graphiti. This server allows AI assistants to interact with Graphiti's knowledge graph capabilities through the MCP protocol. @@ -173,6 +167,12 @@ The MCP server can be deployed using Docker with Neo4j, making it easy to integr For detailed setup instructions and usage examples, see the [MCP server README](./mcp_server/README.md). +## Graph Service + +The `server` directory contains an API service for interacting with the Graphiti API. It is built using FastAPI. + +Please see the [server README](./server/README.md) for more information. + ## Optional Environment Variables In addition to the Neo4j and OpenAi-compatible credentials, Graphiti also has a few optional environment variables. diff --git a/graphiti_core/llm_client/openai_client.py b/graphiti_core/llm_client/openai_client.py index 6726e3d2..8c173672 100644 --- a/graphiti_core/llm_client/openai_client.py +++ b/graphiti_core/llm_client/openai_client.py @@ -19,7 +19,7 @@ import typing from typing import ClassVar import openai -from openai import AsyncOpenAI +from openai import AsyncAzureOpenAI, AsyncOpenAI from openai.types.chat import ChatCompletionMessageParam from pydantic import BaseModel @@ -61,7 +61,7 @@ class OpenAIClient(LLMClient): self, config: LLMConfig | None = None, cache: bool = False, - client: typing.Any = None, + client: AsyncOpenAI | AsyncAzureOpenAI | None = None, max_tokens: int = DEFAULT_MAX_TOKENS, ): """ diff --git a/graphiti_core/utils/maintenance/community_operations.py b/graphiti_core/utils/maintenance/community_operations.py index 4d30544e..15bab425 100644 --- a/graphiti_core/utils/maintenance/community_operations.py +++ b/graphiti_core/utils/maintenance/community_operations.py @@ -101,9 +101,7 @@ def label_propagation(projection: dict[str, list[Neighbor]]) -> list[list[str]]: ] community_lst.sort(reverse=True) - candidate_rank, community_candidate = ( - community_lst[0] if community_lst else (0, -1) - ) + candidate_rank, community_candidate = community_lst[0] if community_lst else (0, -1) if community_candidate != -1 and candidate_rank > 1: new_community = community_candidate else: