Global Search
In [1]:
Copied!
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License.
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License.
In [2]:
Copied!
import os
import pandas as pd
import tiktoken
from graphrag.query.indexer_adapters import (
read_indexer_communities,
read_indexer_entities,
read_indexer_reports,
)
from graphrag.query.llm.oai.chat_openai import ChatOpenAI
from graphrag.query.llm.oai.typing import OpenaiApiType
from graphrag.query.structured_search.global_search.community_context import (
GlobalCommunityContext,
)
from graphrag.query.structured_search.global_search.search import GlobalSearch
import os
import pandas as pd
import tiktoken
from graphrag.query.indexer_adapters import (
read_indexer_communities,
read_indexer_entities,
read_indexer_reports,
)
from graphrag.query.llm.oai.chat_openai import ChatOpenAI
from graphrag.query.llm.oai.typing import OpenaiApiType
from graphrag.query.structured_search.global_search.community_context import (
GlobalCommunityContext,
)
from graphrag.query.structured_search.global_search.search import GlobalSearch
Global Search example¶
Global search method generates answers by searching over all AI-generated community reports in a map-reduce fashion. This is a resource-intensive method, but often gives good responses for questions that require an understanding of the dataset as a whole (e.g. What are the most significant values of the herbs mentioned in this notebook?).
LLM setup¶
In [3]:
Copied!
api_key = os.environ["GRAPHRAG_API_KEY"]
llm_model = os.environ["GRAPHRAG_LLM_MODEL"]
llm = ChatOpenAI(
api_key=api_key,
model=llm_model,
api_type=OpenaiApiType.OpenAI, # OpenaiApiType.OpenAI or OpenaiApiType.AzureOpenAI
max_retries=20,
)
token_encoder = tiktoken.encoding_for_model(llm_model)
api_key = os.environ["GRAPHRAG_API_KEY"]
llm_model = os.environ["GRAPHRAG_LLM_MODEL"]
llm = ChatOpenAI(
api_key=api_key,
model=llm_model,
api_type=OpenaiApiType.OpenAI, # OpenaiApiType.OpenAI or OpenaiApiType.AzureOpenAI
max_retries=20,
)
token_encoder = tiktoken.encoding_for_model(llm_model)
Load community reports as context for global search¶
- Load all community reports in the
create_final_community_reports
table from the GraphRAG, to be used as context data for global search. - Load entities from the
create_final_nodes
andcreate_final_entities
tables from the GraphRAG, to be used for calculating community weights for context ranking. Note that this is optional (if no entities are provided, we will not calculate community weights and only use the rank attribute in the community reports table for context ranking) - Load all communities in the
create_final_communites
table from the GraphRAG, to be used to reconstruct the community graph hierarchy for dynamic community selection.
In [4]:
Copied!
# parquet files generated from indexing pipeline
INPUT_DIR = "./inputs/operation dulce"
COMMUNITY_TABLE = "create_final_communities"
COMMUNITY_REPORT_TABLE = "create_final_community_reports"
ENTITY_TABLE = "create_final_nodes"
ENTITY_EMBEDDING_TABLE = "create_final_entities"
# community level in the Leiden community hierarchy from which we will load the community reports
# higher value means we use reports from more fine-grained communities (at the cost of higher computation cost)
COMMUNITY_LEVEL = 2
# parquet files generated from indexing pipeline
INPUT_DIR = "./inputs/operation dulce"
COMMUNITY_TABLE = "create_final_communities"
COMMUNITY_REPORT_TABLE = "create_final_community_reports"
ENTITY_TABLE = "create_final_nodes"
ENTITY_EMBEDDING_TABLE = "create_final_entities"
# community level in the Leiden community hierarchy from which we will load the community reports
# higher value means we use reports from more fine-grained communities (at the cost of higher computation cost)
COMMUNITY_LEVEL = 2
In [5]:
Copied!
community_df = pd.read_parquet(f"{INPUT_DIR}/{COMMUNITY_TABLE}.parquet")
entity_df = pd.read_parquet(f"{INPUT_DIR}/{ENTITY_TABLE}.parquet")
report_df = pd.read_parquet(f"{INPUT_DIR}/{COMMUNITY_REPORT_TABLE}.parquet")
entity_embedding_df = pd.read_parquet(f"{INPUT_DIR}/{ENTITY_EMBEDDING_TABLE}.parquet")
communities = read_indexer_communities(community_df, entity_df, report_df)
reports = read_indexer_reports(report_df, entity_df, COMMUNITY_LEVEL)
entities = read_indexer_entities(entity_df, entity_embedding_df, COMMUNITY_LEVEL)
print(f"Total report count: {len(report_df)}")
print(
f"Report count after filtering by community level {COMMUNITY_LEVEL}: {len(reports)}"
)
report_df.head()
community_df = pd.read_parquet(f"{INPUT_DIR}/{COMMUNITY_TABLE}.parquet")
entity_df = pd.read_parquet(f"{INPUT_DIR}/{ENTITY_TABLE}.parquet")
report_df = pd.read_parquet(f"{INPUT_DIR}/{COMMUNITY_REPORT_TABLE}.parquet")
entity_embedding_df = pd.read_parquet(f"{INPUT_DIR}/{ENTITY_EMBEDDING_TABLE}.parquet")
communities = read_indexer_communities(community_df, entity_df, report_df)
reports = read_indexer_reports(report_df, entity_df, COMMUNITY_LEVEL)
entities = read_indexer_entities(entity_df, entity_embedding_df, COMMUNITY_LEVEL)
print(f"Total report count: {len(report_df)}")
print(
f"Report count after filtering by community level {COMMUNITY_LEVEL}: {len(reports)}"
)
report_df.head()
Total report count: 72 Report count after filtering by community level 2: 56
Out[5]:
id | human_readable_id | community | parent | level | title | summary | full_content | rank | rank_explanation | findings | full_content_json | period | size | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 16949a5d17b740b2b4a6f787b0a637f1 | 43 | 43 | 10 | 2 | Ben Bloomberg and the Harmoniser Project | The community centers around Ben Bloomberg, a ... | # Ben Bloomberg and the Harmoniser Project\n\n... | 7.5 | The impact severity rating is high due to the ... | [{'explanation': 'Ben Bloomberg is a pivotal f... | {\n "title": "Ben Bloomberg and the Harmoni... | 2025-01-10 | 35 |
1 | 4ff756b7041f4dcab6612e016af2b14d | 44 | 44 | 10 | 2 | North Hampton and Influential Musicians | The community centers around North Hampton, a ... | # North Hampton and Influential Musicians\n\nT... | 6.5 | The impact severity rating is moderately high ... | [{'explanation': 'North Hampton serves as the ... | {\n "title": "North Hampton and Influential... | 2025-01-10 | 4 |
2 | 2d3df394272743a781606ad80ccb5312 | 45 | 45 | 10 | 2 | Prince of Monaco and Monaco | The community revolves around the Prince of Mo... | # Prince of Monaco and Monaco\n\nThe community... | 4.0 | The impact severity rating is moderate due to ... | [{'explanation': 'The Prince of Monaco is a ke... | {\n "title": "Prince of Monaco and Monaco",... | 2025-01-10 | 2 |
3 | becbd958973f42b0bd53cca9250feaf1 | 46 | 46 | 10 | 2 | Robot Opera and Broadway | The community revolves around the Robot Opera,... | # Robot Opera and Broadway\n\nThe community re... | 7.5 | The impact severity rating is high due to the ... | [{'explanation': 'The Robot Opera is a notable... | {\n "title": "Robot Opera and Broadway",\n ... | 2025-01-10 | 2 |
4 | f7d29921ae3e41a79ae7f88dae584892 | 47 | 47 | 13 | 2 | Ben and Jacob's Fusion of Art and Technology | The community centers around Ben and Jacob, wh... | # Ben and Jacob's Fusion of Art and Technology... | 7.5 | The impact severity rating is high due to the ... | [{'explanation': 'Ben and Jacob are key collab... | {\n "title": "Ben and Jacob's Fusion of Art... | 2025-01-10 | 5 |
Build global context based on community reports¶
In [6]:
Copied!
context_builder = GlobalCommunityContext(
community_reports=reports,
communities=communities,
entities=entities, # default to None if you don't want to use community weights for ranking
token_encoder=token_encoder,
)
context_builder = GlobalCommunityContext(
community_reports=reports,
communities=communities,
entities=entities, # default to None if you don't want to use community weights for ranking
token_encoder=token_encoder,
)
Perform global search¶
In [7]:
Copied!
context_builder_params = {
"use_community_summary": False, # False means using full community reports. True means using community short summaries.
"shuffle_data": True,
"include_community_rank": True,
"min_community_rank": 0,
"community_rank_name": "rank",
"include_community_weight": True,
"community_weight_name": "occurrence weight",
"normalize_community_weight": True,
"max_tokens": 12_000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 5000)
"context_name": "Reports",
}
map_llm_params = {
"max_tokens": 1000,
"temperature": 0.0,
"response_format": {"type": "json_object"},
}
reduce_llm_params = {
"max_tokens": 2000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 1000-1500)
"temperature": 0.0,
}
context_builder_params = {
"use_community_summary": False, # False means using full community reports. True means using community short summaries.
"shuffle_data": True,
"include_community_rank": True,
"min_community_rank": 0,
"community_rank_name": "rank",
"include_community_weight": True,
"community_weight_name": "occurrence weight",
"normalize_community_weight": True,
"max_tokens": 12_000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 5000)
"context_name": "Reports",
}
map_llm_params = {
"max_tokens": 1000,
"temperature": 0.0,
"response_format": {"type": "json_object"},
}
reduce_llm_params = {
"max_tokens": 2000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 1000-1500)
"temperature": 0.0,
}
In [8]:
Copied!
search_engine = GlobalSearch(
llm=llm,
context_builder=context_builder,
token_encoder=token_encoder,
max_data_tokens=12_000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 5000)
map_llm_params=map_llm_params,
reduce_llm_params=reduce_llm_params,
allow_general_knowledge=False, # set this to True will add instruction to encourage the LLM to incorporate general knowledge in the response, which may increase hallucinations, but could be useful in some use cases.
json_mode=True, # set this to False if your LLM model does not support JSON mode.
context_builder_params=context_builder_params,
concurrent_coroutines=32,
response_type="multiple paragraphs", # free form text describing the response type and format, can be anything, e.g. prioritized list, single paragraph, multiple paragraphs, multiple-page report
)
search_engine = GlobalSearch(
llm=llm,
context_builder=context_builder,
token_encoder=token_encoder,
max_data_tokens=12_000, # change this based on the token limit you have on your model (if you are using a model with 8k limit, a good setting could be 5000)
map_llm_params=map_llm_params,
reduce_llm_params=reduce_llm_params,
allow_general_knowledge=False, # set this to True will add instruction to encourage the LLM to incorporate general knowledge in the response, which may increase hallucinations, but could be useful in some use cases.
json_mode=True, # set this to False if your LLM model does not support JSON mode.
context_builder_params=context_builder_params,
concurrent_coroutines=32,
response_type="multiple paragraphs", # free form text describing the response type and format, can be anything, e.g. prioritized list, single paragraph, multiple paragraphs, multiple-page report
)
In [9]:
Copied!
result = await search_engine.asearch(
"What is Cosmic Vocalization and who are involved in it?"
)
print(result.response)
result = await search_engine.asearch(
"What is Cosmic Vocalization and who are involved in it?"
)
print(result.response)
Exception in _map_response_single_batch Traceback (most recent call last): File "/home/runner/work/graphrag/graphrag/graphrag/query/structured_search/global_search/search.py", line 232, in _map_response_single_batch search_response = await self.llm.agenerate( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 142, in agenerate async for attempt in retryer: File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 166, in __anext__ do = await self.iter(retry_state=self._retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 153, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/_utils.py", line 99, in inner return call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/__init__.py", line 418, in exc_check raise retry_exc.reraise() ^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/__init__.py", line 185, in reraise raise self.last_attempt.result() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 144, in agenerate return await self._agenerate( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 268, in _agenerate response = await self.async_client.chat.completions.create( # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1720, in create return await self._post( ^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1849, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1543, in request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1644, in _request raise self._make_status_error_from_response(err.response) from None openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
Exception in _map_response_single_batch Traceback (most recent call last): File "/home/runner/work/graphrag/graphrag/graphrag/query/structured_search/global_search/search.py", line 232, in _map_response_single_batch search_response = await self.llm.agenerate( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 142, in agenerate async for attempt in retryer: File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 166, in __anext__ do = await self.iter(retry_state=self._retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 153, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/_utils.py", line 99, in inner return call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/__init__.py", line 418, in exc_check raise retry_exc.reraise() ^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/__init__.py", line 185, in reraise raise self.last_attempt.result() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 144, in agenerate return await self._agenerate( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 268, in _agenerate response = await self.async_client.chat.completions.create( # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1720, in create return await self._post( ^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1849, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1543, in request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1644, in _request raise self._make_status_error_from_response(err.response) from None openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
Exception in _map_response_single_batch Traceback (most recent call last): File "/home/runner/work/graphrag/graphrag/graphrag/query/structured_search/global_search/search.py", line 232, in _map_response_single_batch search_response = await self.llm.agenerate( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 142, in agenerate async for attempt in retryer: File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 166, in __anext__ do = await self.iter(retry_state=self._retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/asyncio/__init__.py", line 153, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/_utils.py", line 99, in inner return call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/__init__.py", line 418, in exc_check raise retry_exc.reraise() ^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/tenacity/__init__.py", line 185, in reraise raise self.last_attempt.result() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 144, in agenerate return await self._agenerate( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/work/graphrag/graphrag/graphrag/query/llm/oai/chat_openai.py", line 268, in _agenerate response = await self.async_client.chat.completions.create( # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1720, in create return await self._post( ^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1849, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1543, in request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1629, in _request return await self._retry_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1676, in _retry_request return await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/home/runner/.cache/pypoetry/virtualenvs/graphrag-F2jvqev7-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1644, in _request raise self._make_status_error_from_response(err.response) from None openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
Warning: All map responses have score 0 (i.e., no relevant information found from the dataset), returning a canned 'I do not know' answer. You can try enabling `allow_general_knowledge` to encourage the LLM to incorporate relevant general knowledge, at the risk of increasing hallucinations.
I am sorry but I am unable to answer this question given the provided data.
In [10]:
Copied!
# inspect the data used to build the context for the LLM responses
result.context_data["reports"]
# inspect the data used to build the context for the LLM responses
result.context_data["reports"]
Out[10]:
id | title | occurrence weight | content | rank | |
---|---|---|---|---|---|
0 | 50 | Alex Mercer and the Dulce Base Team | 0.956522 | # Alex Mercer and the Dulce Base Team\n\nThe c... | 8.5 |
1 | 35 | Kevin Scott and Technology Development | 0.608696 | # Kevin Scott and Technology Development\n\nTh... | 7.5 |
2 | 53 | Dulce Base and Paranormal Military Squad | 0.565217 | # Dulce Base and Paranormal Military Squad\n\n... | 8.5 |
3 | 22 | Paranormal Military Squad and Technological Ex... | 0.434783 | # Paranormal Military Squad and Technological ... | 8.5 |
4 | 60 | First Contact with Extraterrestrial Civilization | 0.304348 | # First Contact with Extraterrestrial Civiliza... | 9.5 |
5 | 61 | Dulce Base Operations and Distress | 0.173913 | # Dulce Base Operations and Distress\n\nThe co... | 8.5 |
6 | 57 | Operation: Dulce in New Mexico | 0.130435 | # Operation: Dulce in New Mexico\n\nThe commun... | 7.5 |
7 | 48 | Jacob Collier and Ben Bloomberg's First Tour | 0.130435 | # Jacob Collier and Ben Bloomberg's First Tour... | 7.5 |
8 | 51 | Cosmic Translators and Alien Script | 0.086957 | # Cosmic Translators and Alien Script\n\nThe c... | 8.5 |
9 | 64 | Terminal and Deep Hum | 0.086957 | # Terminal and Deep Hum\n\nThe community revol... | 8.5 |
10 | 29 | Paranormal Military Squad and Cosmic Dialogue | 0.086957 | # Paranormal Military Squad and Cosmic Dialogu... | 8.5 |
11 | 39 | Extraterrestrial Signal Decryption Community | 0.086957 | # Extraterrestrial Signal Decryption Community... | 8.5 |
12 | 34 | Growth Mindset and Stanford | 0.086957 | # Growth Mindset and Stanford\n\nThe community... | 7.5 |
13 | 20 | Jacob Collier and Taylor Swift's Albums | 0.086957 | # Jacob Collier and Taylor Swift's Albums\n\nT... | 7.5 |
14 | 0 | Omberg and Jacob Collier Collaboration | 0.086957 | # Omberg and Jacob Collier Collaboration\n\nTh... | 7.5 |
15 | 65 | Galactic Orchestra and Interstellar Duet | 0.043478 | # Galactic Orchestra and Interstellar Duet\n\n... | 8.5 |
16 | 59 | Alien Intelligence and Interstellar Siren's Call | 0.043478 | # Alien Intelligence and Interstellar Siren's ... | 8.5 |
17 | 16 | Jimmy Fallon Project on Primetime Television | 0.043478 | # Jimmy Fallon Project on Primetime Television... | 6.5 |
18 | 42 | Decryption Process and Digital Soundscape | 0.043478 | # Decryption Process and Digital Soundscape\n\... | 6.5 |
19 | 5 | Jacob Collier's Video Production | 0.043478 | # Jacob Collier's Video Production\n\nThe comm... | 4.0 |
20 | 14 | Ben Bloomberg's Phone System and House | 0.043478 | # Ben Bloomberg's Phone System and House\n\nTh... | 3.0 |
21 | 9 | Jacob Collier's Video Production | 0.043478 | # Jacob Collier's Video Production\n\nThe comm... | 3.0 |
22 | 17 | Ben Bloomberg's Phone System and Parental Conc... | 0.043478 | # Ben Bloomberg's Phone System and Parental Co... | 3.0 |
23 | 58 | Paranormal Military Squad and Alien Communicat... | 0.956522 | # Paranormal Military Squad and Alien Communic... | 7.5 |
24 | 52 | Paranormal Military Squad at Dulce Base | 0.695652 | # Paranormal Military Squad at Dulce Base\n\nT... | 8.5 |
25 | 11 | Jacob Collier and His Musical Collaborations | 0.565217 | # Jacob Collier and His Musical Collaborations... | 8.5 |
26 | 54 | Dr. Jordan Hayes and the Paranormal Military S... | 0.347826 | # Dr. Jordan Hayes and the Paranormal Military... | 8.5 |
27 | 55 | Operation: Dulce and Paranormal Military Squad | 0.260870 | # Operation: Dulce and Paranormal Military Squ... | 8.5 |
28 | 68 | Earth's Interstellar Communication and Galacti... | 0.260870 | # Earth's Interstellar Communication and Galac... | 8.5 |
29 | 70 | Paranormal Military Squad and Interstellar Com... | 0.130435 | # Paranormal Military Squad and Interstellar C... | 8.5 |
30 | 71 | Threshold and Humankind's Communication with E... | 0.130435 | # Threshold and Humankind's Communication with... | 8.5 |
31 | 56 | Dulce Military Base and Paranormal Operations | 0.130435 | # Dulce Military Base and Paranormal Operation... | 8.5 |
32 | 69 | Paranormal Military Squad and Interstellar Com... | 0.130435 | # Paranormal Military Squad and Interstellar C... | 8.5 |
33 | 33 | Behind the Tech and Microsoft Community | 0.130435 | # Behind the Tech and Microsoft Community\n\nT... | 7.5 |
34 | 49 | Djesse Vol. 3 and Djesse Albums Series | 0.130435 | # Djesse Vol. 3 and Djesse Albums Series\n\nTh... | 7.5 |
35 | 66 | Humanity and Cosmic Relationships | 0.086957 | # Humanity and Cosmic Relationships\n\nThe com... | 8.5 |
36 | 19 | Pandemic and Its Impact on Work and Art | 0.086957 | # Pandemic and Its Impact on Work and Art\n\nT... | 8.5 |
37 | 67 | Decryption and Understanding of Alien Signal | 0.043478 | # Decryption and Understanding of Alien Signal... | 8.5 |
38 | 12 | Montreux Jazz Festival and Key Performers | 0.043478 | # Montreux Jazz Festival and Key Performers\n\... | 7.5 |
39 | 46 | Robot Opera and Broadway | 0.043478 | # Robot Opera and Broadway\n\nThe community re... | 7.5 |
40 | 21 | Taylor Swift's Albums and Documentary | 0.043478 | # Taylor Swift's Albums and Documentary\n\nThe... | 7.0 |
41 | 7 | Stage Equipment and Transportation Network | 0.043478 | # Stage Equipment and Transportation Network\n... | 6.5 |
42 | 37 | Jaron Lanier and His Collection of Musical Ins... | 0.043478 | # Jaron Lanier and His Collection of Musical I... | 4.5 |
43 | 45 | Prince of Monaco and Monaco | 0.043478 | # Prince of Monaco and Monaco\n\nThe community... | 4.0 |
44 | 62 | Paranormal Military Squad at Dulce Base | 1.000000 | # Paranormal Military Squad at Dulce Base\n\nT... | 8.5 |
45 | 63 | Paranormal Military Squad and Operation: Dulce | 0.782609 | # Paranormal Military Squad and Operation: Dul... | 9.0 |
46 | 43 | Ben Bloomberg and the Harmoniser Project | 0.478261 | # Ben Bloomberg and the Harmoniser Project\n\n... | 7.5 |
47 | 47 | Ben and Jacob's Fusion of Art and Technology | 0.173913 | # Ben and Jacob's Fusion of Art and Technology... | 7.5 |
48 | 28 | Mission to Uncover Dulce's Mysteries | 0.130435 | # Mission to Uncover Dulce's Mysteries\n\nThe ... | 8.5 |
49 | 18 | Taylor Swift and Album of the Year | 0.130435 | # Taylor Swift and Album of the Year\n\nThe co... | 7.5 |
50 | 40 | Conversation between Kevin Scott and Jacob Col... | 0.086957 | # Conversation between Kevin Scott and Jacob C... | 8.5 |
51 | 41 | Humanity and the Unseen Partner | 0.043478 | # Humanity and the Unseen Partner\n\nThe commu... | 8.5 |
52 | 15 | Jimmy Fallon Project on Primetime TV | 0.043478 | # Jimmy Fallon Project on Primetime TV\n\nThe ... | 7.5 |
53 | 38 | Kevin Scott and the Engineering Mindset | 0.043478 | # Kevin Scott and the Engineering Mindset\n\nT... | 6.5 |
54 | 44 | North Hampton and Influential Musicians | 0.043478 | # North Hampton and Influential Musicians\n\nT... | 6.5 |
55 | 36 | Kevin Scott's Daughter and Her Fantasy Novel | 0.043478 | # Kevin Scott's Daughter and Her Fantasy Novel... | 2.0 |
In [11]:
Copied!
# inspect number of LLM calls and tokens
print(
f"LLM calls: {result.llm_calls}. Prompt tokens: {result.prompt_tokens}. Output tokens: {result.output_tokens}."
)
# inspect number of LLM calls and tokens
print(
f"LLM calls: {result.llm_calls}. Prompt tokens: {result.prompt_tokens}. Output tokens: {result.output_tokens}."
)
LLM calls: 3. Prompt tokens: 32067. Output tokens: 0.