helmfridsson commited on
Commit
fe47241
·
verified ·
1 Parent(s): a673fe6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
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 chunk.get("source_type") == "pdf":
124
- return f"[{source}](/file={PUBLIC_DIR}/{source})"
 
 
 
 
 
 
125
 
126
- if chunk.get("source_type") == "web":
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