vlapparov commited on
Commit
0617773
·
verified ·
1 Parent(s): 8112402

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -26
app.py CHANGED
@@ -48,32 +48,8 @@ class LinkupSearchTool(Tool):
48
  )
49
 
50
  answer_text = getattr(response, "answer", "No answer provided.")
51
- sources_obj = getattr(response, "sources", [])
52
-
53
- citations_list = []
54
- for i, source in enumerate(sources_obj, start=0):
55
- citation_marker = f"[{i}]"
56
- citations_list.append(
57
- {
58
- "marker": citation_marker,
59
- "name": source.name,
60
- "url": source.url,
61
- "snippet": source.snippet,
62
- }
63
- )
64
-
65
- if citations_list:
66
- citations_text = "\n".join(
67
- f"{c['marker']} {c['name']} ({c['url']})"
68
- for c in citations_list
69
- )
70
- answer_with_citations = (
71
- f"{answer_text}\n\n" "References:\n" + citations_text
72
- )
73
- else:
74
- answer_with_citations = answer_text
75
-
76
- return f'## Search Results\n{answer_with_citations}'
77
 
78
 
79
  custom_role_conversions = {"tool-call": "assistant", "tool-response": "user"}
 
48
  )
49
 
50
  answer_text = getattr(response, "answer", "No answer provided.")
51
+
52
+ return f'Answer:{answer_with_citations}'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
 
55
  custom_role_conversions = {"tool-call": "assistant", "tool-response": "user"}