Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -119,11 +119,18 @@ def clear_all():
|
|
| 119 |
|
| 120 |
def format_source_link(chunk: dict) -> str:
|
| 121 |
source = chunk.get("source", "Okänd källa")
|
|
|
|
| 122 |
|
| 123 |
-
if
|
| 124 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
-
if
|
| 127 |
return f"[{source}]({source})"
|
| 128 |
|
| 129 |
return source
|
|
|
|
| 119 |
|
| 120 |
def format_source_link(chunk: dict) -> str:
|
| 121 |
source = chunk.get("source", "Okänd källa")
|
| 122 |
+
source_type = chunk.get("source_type")
|
| 123 |
|
| 124 |
+
if source_type == "pdf":
|
| 125 |
+
return (
|
| 126 |
+
f"[{source}]("
|
| 127 |
+
f"https://raw.githubusercontent.com/"
|
| 128 |
+
f"tomashelmfridsson/systeminforande/main/"
|
| 129 |
+
f"rag/files/{source}"
|
| 130 |
+
f")"
|
| 131 |
+
)
|
| 132 |
|
| 133 |
+
if source_type == "web":
|
| 134 |
return f"[{source}]({source})"
|
| 135 |
|
| 136 |
return source
|