milwright commited on
Commit
65a68da
Β·
1 Parent(s): 65ea2b0

increase primary source character limit to 8000 chars

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. space_template.py +3 -3
app.py CHANGED
@@ -232,7 +232,7 @@ class SpaceGenerator:
232
  # Create initial URL inputs
233
  for i in range(10):
234
  url_input = gr.Textbox(
235
- label=f"URL {i+1}" + (" (Primary - 5000 chars)" if i < 2 else " (Secondary - 2500 chars)"),
236
  placeholder="https://...",
237
  visible=(i < 2)
238
  )
@@ -549,7 +549,7 @@ class SpaceGenerator:
549
  grounding_context += "\nπŸ“š **PRIMARY SOURCES:**\n"
550
  for i, url in enumerate(primary_urls, 1):
551
  try:
552
- content = fetch_url_content(url, max_chars=5000)
553
  if not content.startswith("❌") and not content.startswith("⏱️"):
554
  grounding_context += f"\n**Primary Source {i}:** {content}\n"
555
  except:
 
232
  # Create initial URL inputs
233
  for i in range(10):
234
  url_input = gr.Textbox(
235
+ label=f"URL {i+1}" + (" (Primary - 8000 chars)" if i < 2 else " (Secondary - 2500 chars)"),
236
  placeholder="https://...",
237
  visible=(i < 2)
238
  )
 
549
  grounding_context += "\nπŸ“š **PRIMARY SOURCES:**\n"
550
  for i, url in enumerate(primary_urls, 1):
551
  try:
552
+ content = fetch_url_content(url, max_chars=8000)
553
  if not content.startswith("❌") and not content.startswith("⏱️"):
554
  grounding_context += f"\n**Primary Source {i}:** {content}\n"
555
  except:
space_template.py CHANGED
@@ -301,7 +301,7 @@ def get_grounding_context() -> str:
301
 
302
  context_parts = []
303
 
304
- # Process primary sources (first 2 URLs with 5000 char limit)
305
  primary_urls = urls[:2]
306
  if primary_urls:
307
  context_parts.append("πŸ“š **PRIMARY SOURCES:**\\n")
@@ -309,7 +309,7 @@ def get_grounding_context() -> str:
309
  if url in _url_content_cache:
310
  content = _url_content_cache[url]
311
  else:
312
- content = fetch_url_content(url, max_length=5000)
313
  _url_content_cache[url] = content
314
 
315
  if not content.startswith("❌") and not content.startswith("⏱️"):
@@ -843,7 +843,7 @@ def create_interface():
843
  placeholder="https://example.com/docs\\nhttps://example.com/api",
844
  value='\\n'.join(config.get('grounding_urls', [])),
845
  lines=5,
846
- info="First 2 URLs: Primary sources (5000 chars). URLs 3+: Secondary sources (2500 chars)."
847
  )
848
 
849
  with gr.Row():
 
301
 
302
  context_parts = []
303
 
304
+ # Process primary sources (first 2 URLs with 8000 char limit)
305
  primary_urls = urls[:2]
306
  if primary_urls:
307
  context_parts.append("πŸ“š **PRIMARY SOURCES:**\\n")
 
309
  if url in _url_content_cache:
310
  content = _url_content_cache[url]
311
  else:
312
+ content = fetch_url_content(url, max_length=8000)
313
  _url_content_cache[url] = content
314
 
315
  if not content.startswith("❌") and not content.startswith("⏱️"):
 
843
  placeholder="https://example.com/docs\\nhttps://example.com/api",
844
  value='\\n'.join(config.get('grounding_urls', [])),
845
  lines=5,
846
+ info="First 2 URLs: Primary sources (8000 chars). URLs 3+: Secondary sources (2500 chars)."
847
  )
848
 
849
  with gr.Row():