mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-16 06:14:12 +00:00
feat: add filename to the top
This commit is contained in:
1 parent
c04687fdd1
commit
6932c7e3e9
1 file changed
+2
-2
@@ -21,12 +21,12 @@ class GitHubLoader(BaseRemote):
|
|||||||
if content.get("encoding") == "base64":
|
if content.get("encoding") == "base64":
|
||||||
try:
|
try:
|
||||||
decoded_content = base64.b64decode(content["content"]).decode("utf-8")
|
decoded_content = base64.b64decode(content["content"]).decode("utf-8")
|
||||||
return decoded_content
|
return f"Filename: {file_path}\n\n{decoded_content}"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error decoding content for {file_path}: {e}")
|
print(f"Error decoding content for {file_path}: {e}")
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
return content["content"]
|
return f"Filename: {file_path}\n\n{content['content']}"
|
||||||
else:
|
else:
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user