File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def fetch_doc(uri: str = "") -> Dict[str, Any]:
9999 - title: Document title
100100 - content: Full document text content
101101 - error: Error message (if fetch failed)
102-
102+
103103 Or when uri is empty:
104104 - urls: List of all available document URLs with titles
105105
@@ -109,18 +109,12 @@ def fetch_doc(uri: str = "") -> Dict[str, Any]:
109109 # If no URI provided, return all available URLs (llms.txt catalog)
110110 if not uri :
111111 url_titles = cache .get_url_titles ()
112- return {
113- "urls" : [
114- {"url" : url , "title" : title }
115- for url , title in url_titles .items ()
116- ]
117- }
118-
119- # Accept HTTP/HTTPS URLs
120- if uri .startswith ("http://" ) or uri .startswith ("https://" ):
121- url = uri
122- else :
123- return {"error" : "unsupported uri" , "url" : uri }
112+ return {"urls" : [{"url" : url , "title" : title } for url , title in url_titles .items ()]}
113+ # Only accept https://strandsagents.com URLs
114+ if not uri .startswith ("https://strandsagents.com" ):
115+ return {"error" : "only https://strandsagents.com URLs allowed" , "url" : uri }
116+
117+ url = uri
124118
125119 page = cache .ensure_page (url )
126120 if page is None :
You can’t perform that action at this time.
0 commit comments