mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-02 18:49:09 +00:00
Merge pull request #233 from MODSetter/dev
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
fix: when nothing is selected for context
This commit is contained in:
commit
237e11f2ae
3 changed files with 8365 additions and 4764 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
||||||
.flashrank_cache*
|
.flashrank_cache*
|
||||||
podcasts/
|
podcasts/
|
||||||
.env
|
.env
|
||||||
|
node_modules/
|
||||||
.ruff_cache/
|
.ruff_cache/
|
|
@ -552,6 +552,19 @@ async def fetch_relevant_documents(
|
||||||
# Only use streaming if both writer and state are provided
|
# Only use streaming if both writer and state are provided
|
||||||
streaming_service = state.streaming_service if state is not None else None
|
streaming_service = state.streaming_service if state is not None else None
|
||||||
|
|
||||||
|
# Handle case when no connectors are selected
|
||||||
|
if not connectors_to_search or len(connectors_to_search) == 0:
|
||||||
|
if streaming_service and writer:
|
||||||
|
writer(
|
||||||
|
{
|
||||||
|
"yield_value": streaming_service.format_terminal_info_delta(
|
||||||
|
"📹 No data sources selected. Research will be generated using general knowledge and any user-selected documents."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
print("No connectors selected for research. Returning empty document list.")
|
||||||
|
return [] # Return empty list gracefully
|
||||||
|
|
||||||
# Stream initial status update
|
# Stream initial status update
|
||||||
if streaming_service and writer:
|
if streaming_service and writer:
|
||||||
connector_names = [
|
connector_names = [
|
||||||
|
@ -1363,8 +1376,8 @@ async def process_section_with_documents(
|
||||||
if state and state.streaming_service and writer:
|
if state and state.streaming_service and writer:
|
||||||
writer(
|
writer(
|
||||||
{
|
{
|
||||||
"yield_value": state.streaming_service.format_error(
|
"yield_value": state.streaming_service.format_terminal_info_delta(
|
||||||
f'Warning: No relevant documents found for section: "{section_title}"'
|
f'📝 Writing section "{section_title}" using general knowledge (no specific sources found)'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
13014
surfsense_web/pnpm-lock.yaml
generated
13014
surfsense_web/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue