Skip to content

Commit 9179ac1

Browse files
committed
thrid attempt of fixing index.py
1 parent 7b21f63 commit 9179ac1

File tree

1 file changed

+7
-2
lines changed
  • supporting-blog-content/github-assistant

1 file changed

+7
-2
lines changed

supporting-blog-content/github-assistant/index.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def parse_documents():
8585
owner = os.getenv("GITHUB_OWNER")
8686
repo = os.getenv("GITHUB_REPO")
8787
branch = os.getenv("GITHUB_BRANCH")
88-
base_path = os.getenv("BASE_PATH", "/tmp")
88+
base_path = os.getenv("BASE_PATH", "/tmp")
8989

9090
if not owner or not repo:
9191
raise ValueError(
@@ -124,7 +124,9 @@ def parse_documents():
124124

125125
if len(matching_files) > 0:
126126
extension_list = ", ".join(extensions)
127-
file_summary.append(f"Found {len(matching_files)} {extension_list} files in the repository.")
127+
file_summary.append(
128+
f"Found {len(matching_files)} {extension_list} files in the repository."
129+
)
128130

129131
loader = SimpleDirectoryReader(
130132
input_dir=local_repo_path, required_exts=extensions, recursive=True
@@ -143,6 +145,7 @@ def parse_documents():
143145
print("\n")
144146
return nodes
145147

148+
146149
def get_es_vector_store():
147150
print("Initializing Elasticsearch store...")
148151
es_cloud_id = os.getenv("ELASTIC_CLOUD_ID")
@@ -166,6 +169,7 @@ def get_es_vector_store():
166169
time.sleep(10)
167170
raise Exception("Failed to initialize Elasticsearch store after multiple attempts")
168171

172+
169173
def main():
170174
nodes = parse_documents()
171175
es_vector_store = get_es_vector_store()
@@ -181,5 +185,6 @@ def main():
181185
es_vector_store.close()
182186
print("Elasticsearch connection closed.")
183187

188+
184189
if __name__ == "__main__":
185190
main()

0 commit comments

Comments
 (0)