Skip to content

Commit f6d923e

Browse files
Gaudy BlancoGaudy Blanco
authored andcommitted
Merge remote-tracking branch 'origin/main' into custom_vector_store_schema
2 parents d698cc2 + 075cadd commit f6d923e

File tree

7 files changed

+33
-59
lines changed

7 files changed

+33
-59
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "Remove hard-coded community rate limiter."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "Fix multi-index search."
4+
}

docs/get_started.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ deployment_name: <azure_model_deployment_name>
6565
```
6666
6767
#### Using Managed Auth on Azure
68-
To use managed auth, add an additional value to your model config and comment out or remove the api_key line:
68+
To use managed auth, edit the auth_type in your model config and *remove* the api_key line:
6969
7070
```yaml
7171
auth_type: azure_managed_identity # Default auth_type is is api_key
72-
# api_key: ${GRAPHRAG_API_KEY}
7372
```
7473
7574
You will also need to login with [az login](https://learn.microsoft.com/en-us/cli/azure/authenticate-azure-cli) and select the subscription with your endpoint.
@@ -116,4 +115,4 @@ Please refer to [Query Engine](query/overview.md) docs for detailed information
116115
- For more details about configuring GraphRAG, see the [configuration documentation](config/overview.md).
117116
- To learn more about Initialization, refer to the [Initialization documentation](config/init.md).
118117
- For more details about using the CLI, refer to the [CLI documentation](cli.md).
119-
- Check out our [visualization guide](visualization_guide.md) for a more interactive experience in debugging and exploring the knowledge graph.
118+
- Check out our [visualization guide](visualization_guide.md) for a more interactive experience in debugging and exploring the knowledge graph.

graphrag/cache/factory.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,19 @@ def create_cosmosdb_cache(**kwargs) -> PipelineCache:
9797
return JsonPipelineCache(storage)
9898

9999

100+
def create_noop_cache(**_kwargs) -> PipelineCache:
101+
"""Create a no-op cache implementation."""
102+
return NoopPipelineCache()
103+
104+
105+
def create_memory_cache(**kwargs) -> PipelineCache:
106+
"""Create a memory cache implementation."""
107+
return InMemoryCache(**kwargs)
108+
109+
100110
# --- register built-in cache implementations ---
101-
CacheFactory.register(CacheType.none.value, NoopPipelineCache)
102-
CacheFactory.register(CacheType.memory.value, InMemoryCache)
111+
CacheFactory.register(CacheType.none.value, create_noop_cache)
112+
CacheFactory.register(CacheType.memory.value, create_memory_cache)
103113
CacheFactory.register(CacheType.file.value, create_file_cache)
104114
CacheFactory.register(CacheType.blob.value, create_blob_cache)
105115
CacheFactory.register(CacheType.cosmosdb.value, create_cosmosdb_cache)

graphrag/index/operations/summarize_communities/strategies.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Finding,
1717
StrategyConfig,
1818
)
19-
from graphrag.index.utils.rate_limiter import RateLimiter
2019
from graphrag.language_model.manager import ModelManager
2120
from graphrag.language_model.protocol.base import ChatModel
2221

@@ -51,8 +50,6 @@ async def _run_extractor(
5150
level: int,
5251
args: StrategyConfig,
5352
) -> CommunityReport | None:
54-
# RateLimiter
55-
rate_limiter = RateLimiter(rate=1, per=60)
5653
extractor = CommunityReportsExtractor(
5754
model,
5855
extraction_prompt=args.get("extraction_prompt", None),
@@ -63,7 +60,6 @@ async def _run_extractor(
6360
)
6461

6562
try:
66-
await rate_limiter.acquire()
6763
results = await extractor(input)
6864
report = results.structured_output
6965
if report is None:

graphrag/index/utils/rate_limiter.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

graphrag/utils/api.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,57 +190,58 @@ def update_context_data(
190190
"""
191191
updated_context_data = {}
192192
for key in context_data:
193+
entries = context_data[key].to_dict(orient="records")
193194
updated_entry = []
194195
if key == "reports":
195196
updated_entry = [
196197
dict(
197-
{k: entry[k] for k in entry},
198+
entry,
198199
index_name=links["community_reports"][int(entry["id"])][
199200
"index_name"
200201
],
201202
index_id=links["community_reports"][int(entry["id"])]["id"],
202203
)
203-
for entry in context_data[key]
204+
for entry in entries
204205
]
205206
if key == "entities":
206207
updated_entry = [
207208
dict(
208-
{k: entry[k] for k in entry},
209+
entry,
209210
entity=entry["entity"].split("-")[0],
210211
index_name=links["entities"][int(entry["id"])]["index_name"],
211212
index_id=links["entities"][int(entry["id"])]["id"],
212213
)
213-
for entry in context_data[key]
214+
for entry in entries
214215
]
215216
if key == "relationships":
216217
updated_entry = [
217218
dict(
218-
{k: entry[k] for k in entry},
219+
entry,
219220
source=entry["source"].split("-")[0],
220221
target=entry["target"].split("-")[0],
221222
index_name=links["relationships"][int(entry["id"])]["index_name"],
222223
index_id=links["relationships"][int(entry["id"])]["id"],
223224
)
224-
for entry in context_data[key]
225+
for entry in entries
225226
]
226227
if key == "claims":
227228
updated_entry = [
228229
dict(
229-
{k: entry[k] for k in entry},
230+
entry,
230231
entity=entry["entity"].split("-")[0],
231232
index_name=links["covariates"][int(entry["id"])]["index_name"],
232233
index_id=links["covariates"][int(entry["id"])]["id"],
233234
)
234-
for entry in context_data[key]
235+
for entry in entries
235236
]
236237
if key == "sources":
237238
updated_entry = [
238239
dict(
239-
{k: entry[k] for k in entry},
240+
entry,
240241
index_name=links["text_units"][int(entry["id"])]["index_name"],
241242
index_id=links["text_units"][int(entry["id"])]["id"],
242243
)
243-
for entry in context_data[key]
244+
for entry in entries
244245
]
245246
updated_context_data[key] = updated_entry
246247
return updated_context_data

0 commit comments

Comments
 (0)