From 8b3afdb20e40109ffe37788664363d5931ac2cce Mon Sep 17 00:00:00 2001 From: Evangelos Kassos Date: Mon, 24 Nov 2025 14:35:51 -0500 Subject: [PATCH 1/4] feat/ Control Web Search UI details in Next-Gen Assistants --- ...1564bb31d_hide_extra_web_search_details.py | 59 +++++++++ pingpong/ai.py | 32 ++++- pingpong/copy.py | 3 + pingpong/models.py | 3 + pingpong/schemas.py | 9 ++ pingpong/server.py | 77 ++++++++++- web/pingpong/src/lib/api.ts | 9 ++ .../assistant/[assistantId]/+page.svelte | 120 +++++++++++++++++- 8 files changed, 299 insertions(+), 13 deletions(-) create mode 100644 alembic/versions/90e1564bb31d_hide_extra_web_search_details.py diff --git a/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py b/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py new file mode 100644 index 000000000..d4ef21bc0 --- /dev/null +++ b/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py @@ -0,0 +1,59 @@ +"""Hide Extra Web Search details + +Revision ID: 90e1564bb31d +Revises: 838ea0f68a2e +Create Date: 2025-11-24 14:17:28.920970 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = "90e1564bb31d" +down_revision: Union[str, None] = "838ea0f68a2e" +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.add_column( + "assistants", + sa.Column( + "hide_web_search_sources", + sa.Boolean(), + server_default="false", + nullable=True, + ), + ) + op.add_column( + "assistants", + sa.Column( + "hide_web_search_actions", + sa.Boolean(), + server_default="false", + nullable=True, + ), + ) + op.add_column( + "assistants", + sa.Column( + "hide_web_search_citations", + sa.Boolean(), + server_default="false", + nullable=True, + ), + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("assistants", "hide_web_search_citations") + op.drop_column("assistants", "hide_web_search_actions") + op.drop_column("assistants", "hide_web_search_sources") + # ### end Alembic commands ### diff --git a/pingpong/ai.py b/pingpong/ai.py index 23e40babd..43544b1e7 100644 --- a/pingpong/ai.py +++ b/pingpong/ai.py @@ -851,6 +851,9 @@ def __init__( show_file_search_result_quotes: bool | None = None, show_file_search_document_names: bool | None = None, show_file_search_queries: bool | None = None, + show_web_search_sources: bool | None = None, + show_web_search_actions: bool | None = None, + show_web_search_citations: bool | None = None, show_reasoning_summaries: bool | None = None, *args, **kwargs, @@ -905,6 +908,15 @@ def __init__( self.show_reasoning_summaries = ( show_reasoning_summaries if show_reasoning_summaries is not None else False ) + self.show_web_search_sources = ( + show_web_search_sources if show_web_search_sources is not None else True + ) + self.show_web_search_actions = ( + show_web_search_actions if show_web_search_actions is not None else True + ) + self.show_web_search_citations = ( + show_web_search_citations if show_web_search_citations is not None else True + ) def enqueue(self, data: Dict) -> None: self.__buffer.write(orjson.dumps(data)) @@ -1347,6 +1359,8 @@ async def add_cached_message_part_on_output_text_url_citation_added( await add_cached_message_part_on_output_text_url_citation_added() + if not self.show_web_search_citations: + return self.enqueue( { "type": "message_delta", @@ -1755,7 +1769,9 @@ def get_action_payload( return { "type": WebSearchActionType.SEARCH.value, "query": action.query, - "sources": [{"url": source.url} for source in action.sources or []], + "sources": [{"url": source.url} for source in action.sources or []] + if self.show_web_search_sources + else [], } case "find": return { @@ -1817,7 +1833,9 @@ async def add_cached_tool_call_on_web_search_call_created( "output_index": self.prev_output_index, "type": "web_search", "web_search": { - "action": self.get_action_payload(data.action), + "action": self.get_action_payload(data.action) + if self.show_web_search_actions + else None, }, }, } @@ -2014,7 +2032,9 @@ async def add_cached_tool_call_on_web_search_call_done( "index": self.prev_output_index, "run_id": str(self.run_id), "status": data.status, - "action": self.get_action_payload(data.action), + "action": self.get_action_payload(data.action) + if self.show_web_search_actions + else None, }, } ) @@ -2750,6 +2770,9 @@ async def run_response( show_file_search_result_quotes: bool | None = None, show_file_search_document_names: bool | None = None, show_file_search_queries: bool | None = None, + show_web_search_sources: bool | None = None, + show_web_search_actions: bool | None = None, + show_web_search_citations: bool | None = None, show_reasoning_summaries: bool | None = None, user_auth: str | None = None, anonymous_link_auth: str | None = None, @@ -2873,6 +2896,9 @@ async def run_response( show_file_search_queries=show_file_search_queries, show_file_search_result_quotes=show_file_search_result_quotes, show_file_search_document_names=show_file_search_document_names, + show_web_search_sources=show_web_search_sources, + show_web_search_actions=show_web_search_actions, + show_web_search_citations=show_web_search_citations, show_reasoning_summaries=show_reasoning_summaries, user_id=run.creator_id, user_auth=user_auth, diff --git a/pingpong/copy.py b/pingpong/copy.py index 76fccc7df..db0563ef7 100644 --- a/pingpong/copy.py +++ b/pingpong/copy.py @@ -314,6 +314,9 @@ async def copy_assistant( hide_file_search_result_quotes=assistant.hide_file_search_result_quotes, hide_file_search_document_names=assistant.hide_file_search_document_names, hide_file_search_queries=assistant.hide_file_search_queries, + hide_web_search_sources=assistant.hide_web_search_sources, + hide_web_search_actions=assistant.hide_web_search_actions, + hide_web_search_citations=assistant.hide_web_search_citations, ) session.add(new_assistant) diff --git a/pingpong/models.py b/pingpong/models.py index 210829819..2f195dd9e 100644 --- a/pingpong/models.py +++ b/pingpong/models.py @@ -2239,6 +2239,9 @@ class Assistant(Base): hide_file_search_result_quotes = Column(Boolean, server_default="true") hide_file_search_document_names = Column(Boolean, server_default="false") hide_file_search_queries = Column(Boolean, server_default="true") + hide_web_search_sources = Column(Boolean, server_default="false") + hide_web_search_actions = Column(Boolean, server_default="false") + hide_web_search_citations = Column(Boolean, server_default="false") class_id = Column(Integer, ForeignKey("classes.id")) class_ = relationship("Class", back_populates="assistants", foreign_keys=[class_id]) threads = relationship("Thread", back_populates="assistant") diff --git a/pingpong/schemas.py b/pingpong/schemas.py index 26eee9a97..91d9c13c4 100644 --- a/pingpong/schemas.py +++ b/pingpong/schemas.py @@ -439,6 +439,9 @@ class Assistant(BaseModel): hide_file_search_result_quotes: bool | None = None hide_file_search_document_names: bool | None = None hide_file_search_queries: bool | None = None + hide_web_search_sources: bool | None = None + hide_web_search_actions: bool | None = None + hide_web_search_citations: bool | None = None use_latex: bool | None use_image_descriptions: bool | None hide_prompt: bool | None @@ -490,6 +493,9 @@ class CreateAssistant(BaseModel): hide_file_search_result_quotes: bool = True hide_file_search_document_names: bool = False hide_file_search_queries: bool = True + hide_web_search_sources: bool = False + hide_web_search_actions: bool = False + hide_web_search_citations: bool = False deleted_private_files: list[int] = [] create_classic_assistant: bool = False @@ -534,6 +540,9 @@ class UpdateAssistant(BaseModel): hide_file_search_result_quotes: bool | None = None hide_file_search_document_names: bool | None = None hide_file_search_queries: bool | None = None + hide_web_search_sources: bool | None = None + hide_web_search_actions: bool | None = None + hide_web_search_citations: bool | None = None use_image_descriptions: bool | None = None deleted_private_files: list[int] = [] diff --git a/pingpong/server.py b/pingpong/server.py index 31d09450e..a8810b7de 100644 --- a/pingpong/server.py +++ b/pingpong/server.py @@ -2508,6 +2508,15 @@ async def get_thread( show_file_search_document_names = is_supervisor or ( assistant and not assistant.hide_file_search_document_names ) + show_web_search_sources = is_supervisor or ( + assistant and not assistant.hide_web_search_sources + ) + show_web_search_actions = is_supervisor or ( + assistant and not assistant.hide_web_search_actions + ) + show_web_search_citations = is_supervisor or ( + assistant and not assistant.hide_web_search_citations + ) thread_messages: list[schemas.ThreadMessage] = [] placeholder_ci_calls = [] @@ -2596,7 +2605,7 @@ async def get_thread( elif tool_call.type == schemas.ToolCallType.WEB_SEARCH: action = ( tool_call.web_search_actions[0] - if tool_call.web_search_actions + if tool_call.web_search_actions and show_web_search_actions else None ) @@ -2610,7 +2619,7 @@ async def get_thread( ActionSearchSource(url=source.url or "", type="url") for source in action.sources ] - if action and action.sources + if action and action.sources and show_web_search_sources else [] ) action_obj = ActionSearch( @@ -2834,6 +2843,7 @@ async def get_thread( elif ( annotation.type == schemas.AnnotationType.URL_CITATION + and show_web_search_citations ): _annotations.append( AnnotationURLCitation( @@ -3428,6 +3438,15 @@ async def get_assistant( show_file_search_document_names = is_supervisor or ( assistant and not assistant.hide_file_search_document_names ) + show_web_search_sources = is_supervisor or ( + assistant and not assistant.hide_web_search_sources + ) + show_web_search_actions = is_supervisor or ( + assistant and not assistant.hide_web_search_actions + ) + show_web_search_citations = is_supervisor or ( + assistant and not assistant.hide_web_search_citations + ) thread_messages: list[schemas.ThreadMessage] = [] placeholder_ci_calls = [] @@ -3518,7 +3537,7 @@ async def get_assistant( elif tool_call.type == schemas.ToolCallType.WEB_SEARCH: action = ( tool_call.web_search_actions[0] - if tool_call.web_search_actions + if tool_call.web_search_actions and show_web_search_actions else None ) @@ -3532,7 +3551,7 @@ async def get_assistant( ActionSearchSource(url=source.url or "", type="url") for source in action.sources ] - if action and action.sources + if action and action.sources and show_web_search_sources else [] ) action_obj = ActionSearch( @@ -3755,6 +3774,7 @@ async def get_assistant( elif ( annotation.type == schemas.AnnotationType.URL_CITATION + and show_web_search_citations ): _annotations.append( AnnotationURLCitation( @@ -4922,6 +4942,12 @@ async def get_vector_store_id_by_id_or_none( or not asst.hide_file_search_result_quotes, show_reasoning_summaries=is_supervisor or not asst.hide_reasoning_summaries, + show_web_search_sources=is_supervisor + or not asst.hide_web_search_sources, + show_web_search_actions=is_supervisor + or not asst.hide_web_search_actions, + show_web_search_citations=is_supervisor + or not asst.hide_web_search_citations, ) except Exception as e: logger.exception("Error running thread") @@ -5326,6 +5352,15 @@ async def empty_file_list() -> list[models.File]: show_file_search_document_names = is_supervisor or ( asst and not asst.hide_file_search_document_names ) + show_web_search_sources = is_supervisor or ( + asst and not asst.hide_web_search_sources + ) + show_web_search_actions = is_supervisor or ( + asst and not asst.hide_web_search_actions + ) + show_web_search_citations = is_supervisor or ( + asst and not asst.hide_web_search_citations + ) messageContentParts: list[models.MessagePart] = [] part_index = 0 @@ -5399,6 +5434,9 @@ async def empty_file_list() -> list[models.File]: show_file_search_queries=show_file_search_queries, show_file_search_result_quotes=show_file_search_result_quotes, show_file_search_document_names=show_file_search_document_names, + show_web_search_sources=show_web_search_sources, + show_web_search_actions=show_web_search_actions, + show_web_search_citations=show_web_search_citations, user_auth=request.state.auth_user if hasattr(request.state, "auth_user") else None, @@ -5951,6 +5989,12 @@ async def create_assistant( detail="Cannot hide document names while showing result quotes. Please enable 'Hide File Search Result Quotes from Members' or disable 'Completely Hide File Search Results from Members'.", ) + if req.hide_web_search_actions and not req.hide_web_search_sources: + raise HTTPException( + status_code=400, + detail="Cannot hide web search actions while showing sources. Please enable 'Hide Web Search Sources from Members' or disable 'Completely Hide Web Search Actions from Members'.", + ) + uses_web_search = {"type": "web_search"} in req.tools if uses_web_search and not model_record.supports_web_search: raise HTTPException( @@ -6786,6 +6830,31 @@ async def update_assistant( ): asst.hide_file_search_queries = req.hide_file_search_queries + if ( + "hide_web_search_citations" in req.model_fields_set + and req.hide_web_search_citations is not None + ): + asst.hide_web_search_citations = req.hide_web_search_citations + + if ( + "hide_web_search_actions" in req.model_fields_set + and req.hide_web_search_actions is not None + ): + # Validate before assignment + # Determine what the value of hide_web_search_sources will be after this request + new_hide_web_search_sources = ( + req.hide_web_search_sources + if "hide_web_search_sources" in req.model_fields_set + and req.hide_web_search_sources is not None + else asst.hide_web_search_sources + ) + if req.hide_web_search_actions and not new_hide_web_search_sources: + raise HTTPException( + status_code=400, + detail="Cannot hide web search actions while showing sources. Please enable 'Hide Web Search Sources from Members' or disable 'Completely Hide Web Search Actions from Members'.", + ) + asst.hide_web_search_actions = req.hide_web_search_actions + if is_toggling_publish_status: ptuple = (f"class:{class_id}#member", "can_view", f"assistant:{asst.id}") if req.published: diff --git a/web/pingpong/src/lib/api.ts b/web/pingpong/src/lib/api.ts index 4add76cc1..a2b9e86c1 100644 --- a/web/pingpong/src/lib/api.ts +++ b/web/pingpong/src/lib/api.ts @@ -1302,6 +1302,9 @@ export type Assistant = { hide_file_search_result_quotes: boolean | null; hide_file_search_document_names: boolean | null; hide_file_search_queries: boolean | null; + hide_web_search_sources: boolean | null; + hide_web_search_actions: boolean | null; + hide_web_search_citations: boolean | null; endorsed: boolean | null; created: string; updated: string | null; @@ -1387,6 +1390,9 @@ export type CreateAssistantRequest = { hide_file_search_result_quotes?: boolean; hide_file_search_document_names?: boolean; hide_file_search_queries?: boolean; + hide_web_search_sources?: boolean; + hide_web_search_actions?: boolean; + hide_web_search_citations?: boolean; }; /** @@ -1418,6 +1424,9 @@ export type UpdateAssistantRequest = { hide_file_search_result_quotes?: boolean; hide_file_search_document_names?: boolean; hide_file_search_queries?: boolean; + hide_web_search_sources?: boolean; + hide_web_search_actions?: boolean; + hide_web_search_citations?: boolean; }; /** diff --git a/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte b/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte index e7dd28ac9..c66de682a 100644 --- a/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte +++ b/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte @@ -172,7 +172,7 @@ value: 'web_search', name: 'Web Search', description: - 'Web search allows models to access up-to-date information from the internet and provide answers with sourced citations. Web search is currently in preview and may be unstable. Do not use for important tasks.' + 'Web search allows models to access up-to-date information from the internet and provide answers with sourced citations.' }; const defaultTools = [{ type: 'file_search' }]; @@ -494,6 +494,45 @@ hideFileSearchResultQuotes = true; } + let hideWebSearchSources = true; + let hasSetHideWebSearchSources = false; + $: if ( + assistant?.hide_web_search_sources !== undefined && + assistant?.hide_web_search_sources !== null && + !hasSetHideWebSearchSources + ) { + hideWebSearchSources = assistant?.hide_web_search_sources; + hasSetHideWebSearchSources = true; + } + + let hideWebSearchActions = true; + let hasSetHideWebSearchActions = false; + $: if ( + assistant?.hide_web_search_actions !== undefined && + assistant?.hide_web_search_actions !== null && + !hasSetHideWebSearchActions + ) { + hideWebSearchActions = assistant?.hide_web_search_actions; + if (hideWebSearchActions) { + hideWebSearchSources = true; + } + hasSetHideWebSearchActions = true; + } + + let hideWebSearchCitations = true; + let hasSetHideWebSearchCitations = false; + $: if ( + assistant?.hide_web_search_citations !== undefined && + assistant?.hide_web_search_citations !== null && + !hasSetHideWebSearchCitations + ) { + hideWebSearchCitations = assistant?.hide_web_search_citations; + hasSetHideWebSearchCitations = true; + } + $: if (hideWebSearchActions) { + hideWebSearchSources = true; + } + // Handle updates from the file upload component. const handleFSPrivateFilesChange = (e: CustomEvent>) => { privateUploadFSFileInfo = e.detail; @@ -905,7 +944,10 @@ ? true : hideFileSearchResultQuotes, hide_file_search_document_names: hideFileSearchDocumentNames, - hide_file_search_queries: hideFileSearchQueries + hide_file_search_queries: hideFileSearchQueries, + hide_web_search_sources: hideWebSearchActions ? true : hideWebSearchSources, + hide_web_search_actions: hideWebSearchActions, + hide_web_search_citations: hideWebSearchCitations }; return params; }; @@ -1577,10 +1619,6 @@ }} >
{webSearchMetadata.name}
- Preview
{webSearchMetadata.description} @@ -1883,6 +1921,76 @@ > +
+
+
+
Hide Web Search Sources from Members
+ {#if hideWebSearchActions}
·
+
"Completely Hide Web Search Actions" selected
{/if} +
+ When the assistant uses web search, it may consider a number of sources before + drafting its response. Many of the sources are often not used in the final response. + Control whether members can see all sources. When checked, members will not see the + sources the assistant used during web searches. Moderators can always review web + search sources. This setting will only apply to Chat Mode models with Web Search enabled. +
+ +
+
+
Completely Hide Web Search Actions from Members
+
+ When the assistant uses web search, it may perform various actions such as querying + search engines, clicking on links, and extracting information. This setting controls + whether members can see these web search actions. When checked, members will see + that the assistant is searching the web without revealing specific actions. + Moderators can always review web search actions. This setting will only apply to Chat Mode models with Web Search enabled. +
+
+
+
Hide Inline URL Citations from Members
+
+ When the assistant uses web search, URL citations may be included in its responses. + Citations show the domain (e.g., apnews.com) inline, and the web address and title + in a popover. When enabled, members can click the inline citation to visit the + source. This setting controls whether members can see these citations. When checked, + members will not see the inline URL citations. Moderators can always review inline + URL citations. This setting will only apply to Chat Mode models with Web Search enabled. +
+
From a904160dcbc9f4d57931df0f4ba9d04f0b7e7cf0 Mon Sep 17 00:00:00 2001 From: Evangelos Kassos Date: Mon, 24 Nov 2025 14:59:53 -0500 Subject: [PATCH 2/4] Lint --- pingpong/server.py | 6 ++++++ .../group/[classId]/assistant/[assistantId]/+page.svelte | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pingpong/server.py b/pingpong/server.py index a8810b7de..ed909f363 100644 --- a/pingpong/server.py +++ b/pingpong/server.py @@ -6836,6 +6836,12 @@ async def update_assistant( ): asst.hide_web_search_citations = req.hide_web_search_citations + if ( + "hide_web_search_sources" in req.model_fields_set + and req.hide_web_search_sources is not None + ): + asst.hide_web_search_sources = req.hide_web_search_sources + if ( "hide_web_search_actions" in req.model_fields_set and req.hide_web_search_actions is not None diff --git a/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte b/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte index c66de682a..6a006a3d1 100644 --- a/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte +++ b/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte @@ -494,7 +494,7 @@ hideFileSearchResultQuotes = true; } - let hideWebSearchSources = true; + let hideWebSearchSources = false; let hasSetHideWebSearchSources = false; $: if ( assistant?.hide_web_search_sources !== undefined && @@ -505,7 +505,7 @@ hasSetHideWebSearchSources = true; } - let hideWebSearchActions = true; + let hideWebSearchActions = false; let hasSetHideWebSearchActions = false; $: if ( assistant?.hide_web_search_actions !== undefined && @@ -519,7 +519,7 @@ hasSetHideWebSearchActions = true; } - let hideWebSearchCitations = true; + let hideWebSearchCitations = false; let hasSetHideWebSearchCitations = false; $: if ( assistant?.hide_web_search_citations !== undefined && @@ -1905,7 +1905,6 @@ id="hide_file_search_document_names" name="hide_file_search_document_names" disabled={preventEdits} - class="" bind:checked={hideFileSearchDocumentNames} >
Completely Hide File Search Results from Members
@@ -1973,7 +1972,6 @@ id="hide_web_search_citations" name="hide_web_search_citations" disabled={preventEdits} - class="" bind:checked={hideWebSearchCitations} >
Hide Inline URL Citations from Members
From 5b7d8e56c0d5ecf6d80e54fc18a7e7815ea14616 Mon Sep 17 00:00:00 2001 From: Evangelos Kassos Date: Mon, 24 Nov 2025 15:30:45 -0500 Subject: [PATCH 3/4] Lint --- ...1564bb31d_hide_extra_web_search_details.py | 10 --- pingpong/ai.py | 8 --- pingpong/copy.py | 1 - pingpong/models.py | 1 - pingpong/schemas.py | 3 - pingpong/server.py | 20 ------ web/pingpong/src/lib/api.ts | 3 - .../lib/components/WebSearchCallItem.svelte | 14 +++-- .../assistant/[assistantId]/+page.svelte | 62 +++++++++---------- 9 files changed, 41 insertions(+), 81 deletions(-) diff --git a/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py b/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py index d4ef21bc0..dc3b54bd1 100644 --- a/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py +++ b/alembic/versions/90e1564bb31d_hide_extra_web_search_details.py @@ -39,21 +39,11 @@ def upgrade() -> None: nullable=True, ), ) - op.add_column( - "assistants", - sa.Column( - "hide_web_search_citations", - sa.Boolean(), - server_default="false", - nullable=True, - ), - ) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.drop_column("assistants", "hide_web_search_citations") op.drop_column("assistants", "hide_web_search_actions") op.drop_column("assistants", "hide_web_search_sources") # ### end Alembic commands ### diff --git a/pingpong/ai.py b/pingpong/ai.py index 43544b1e7..68cb1fe8f 100644 --- a/pingpong/ai.py +++ b/pingpong/ai.py @@ -853,7 +853,6 @@ def __init__( show_file_search_queries: bool | None = None, show_web_search_sources: bool | None = None, show_web_search_actions: bool | None = None, - show_web_search_citations: bool | None = None, show_reasoning_summaries: bool | None = None, *args, **kwargs, @@ -914,9 +913,6 @@ def __init__( self.show_web_search_actions = ( show_web_search_actions if show_web_search_actions is not None else True ) - self.show_web_search_citations = ( - show_web_search_citations if show_web_search_citations is not None else True - ) def enqueue(self, data: Dict) -> None: self.__buffer.write(orjson.dumps(data)) @@ -1359,8 +1355,6 @@ async def add_cached_message_part_on_output_text_url_citation_added( await add_cached_message_part_on_output_text_url_citation_added() - if not self.show_web_search_citations: - return self.enqueue( { "type": "message_delta", @@ -2772,7 +2766,6 @@ async def run_response( show_file_search_queries: bool | None = None, show_web_search_sources: bool | None = None, show_web_search_actions: bool | None = None, - show_web_search_citations: bool | None = None, show_reasoning_summaries: bool | None = None, user_auth: str | None = None, anonymous_link_auth: str | None = None, @@ -2898,7 +2891,6 @@ async def run_response( show_file_search_document_names=show_file_search_document_names, show_web_search_sources=show_web_search_sources, show_web_search_actions=show_web_search_actions, - show_web_search_citations=show_web_search_citations, show_reasoning_summaries=show_reasoning_summaries, user_id=run.creator_id, user_auth=user_auth, diff --git a/pingpong/copy.py b/pingpong/copy.py index db0563ef7..05ed1011a 100644 --- a/pingpong/copy.py +++ b/pingpong/copy.py @@ -316,7 +316,6 @@ async def copy_assistant( hide_file_search_queries=assistant.hide_file_search_queries, hide_web_search_sources=assistant.hide_web_search_sources, hide_web_search_actions=assistant.hide_web_search_actions, - hide_web_search_citations=assistant.hide_web_search_citations, ) session.add(new_assistant) diff --git a/pingpong/models.py b/pingpong/models.py index 2f195dd9e..b8f5bbbfb 100644 --- a/pingpong/models.py +++ b/pingpong/models.py @@ -2241,7 +2241,6 @@ class Assistant(Base): hide_file_search_queries = Column(Boolean, server_default="true") hide_web_search_sources = Column(Boolean, server_default="false") hide_web_search_actions = Column(Boolean, server_default="false") - hide_web_search_citations = Column(Boolean, server_default="false") class_id = Column(Integer, ForeignKey("classes.id")) class_ = relationship("Class", back_populates="assistants", foreign_keys=[class_id]) threads = relationship("Thread", back_populates="assistant") diff --git a/pingpong/schemas.py b/pingpong/schemas.py index 91d9c13c4..f1e5b9020 100644 --- a/pingpong/schemas.py +++ b/pingpong/schemas.py @@ -441,7 +441,6 @@ class Assistant(BaseModel): hide_file_search_queries: bool | None = None hide_web_search_sources: bool | None = None hide_web_search_actions: bool | None = None - hide_web_search_citations: bool | None = None use_latex: bool | None use_image_descriptions: bool | None hide_prompt: bool | None @@ -495,7 +494,6 @@ class CreateAssistant(BaseModel): hide_file_search_queries: bool = True hide_web_search_sources: bool = False hide_web_search_actions: bool = False - hide_web_search_citations: bool = False deleted_private_files: list[int] = [] create_classic_assistant: bool = False @@ -542,7 +540,6 @@ class UpdateAssistant(BaseModel): hide_file_search_queries: bool | None = None hide_web_search_sources: bool | None = None hide_web_search_actions: bool | None = None - hide_web_search_citations: bool | None = None use_image_descriptions: bool | None = None deleted_private_files: list[int] = [] diff --git a/pingpong/server.py b/pingpong/server.py index ed909f363..32dde4cb3 100644 --- a/pingpong/server.py +++ b/pingpong/server.py @@ -2514,9 +2514,6 @@ async def get_thread( show_web_search_actions = is_supervisor or ( assistant and not assistant.hide_web_search_actions ) - show_web_search_citations = is_supervisor or ( - assistant and not assistant.hide_web_search_citations - ) thread_messages: list[schemas.ThreadMessage] = [] placeholder_ci_calls = [] @@ -2843,7 +2840,6 @@ async def get_thread( elif ( annotation.type == schemas.AnnotationType.URL_CITATION - and show_web_search_citations ): _annotations.append( AnnotationURLCitation( @@ -3444,9 +3440,6 @@ async def get_assistant( show_web_search_actions = is_supervisor or ( assistant and not assistant.hide_web_search_actions ) - show_web_search_citations = is_supervisor or ( - assistant and not assistant.hide_web_search_citations - ) thread_messages: list[schemas.ThreadMessage] = [] placeholder_ci_calls = [] @@ -3774,7 +3767,6 @@ async def get_assistant( elif ( annotation.type == schemas.AnnotationType.URL_CITATION - and show_web_search_citations ): _annotations.append( AnnotationURLCitation( @@ -4946,8 +4938,6 @@ async def get_vector_store_id_by_id_or_none( or not asst.hide_web_search_sources, show_web_search_actions=is_supervisor or not asst.hide_web_search_actions, - show_web_search_citations=is_supervisor - or not asst.hide_web_search_citations, ) except Exception as e: logger.exception("Error running thread") @@ -5358,9 +5348,6 @@ async def empty_file_list() -> list[models.File]: show_web_search_actions = is_supervisor or ( asst and not asst.hide_web_search_actions ) - show_web_search_citations = is_supervisor or ( - asst and not asst.hide_web_search_citations - ) messageContentParts: list[models.MessagePart] = [] part_index = 0 @@ -5436,7 +5423,6 @@ async def empty_file_list() -> list[models.File]: show_file_search_document_names=show_file_search_document_names, show_web_search_sources=show_web_search_sources, show_web_search_actions=show_web_search_actions, - show_web_search_citations=show_web_search_citations, user_auth=request.state.auth_user if hasattr(request.state, "auth_user") else None, @@ -6830,12 +6816,6 @@ async def update_assistant( ): asst.hide_file_search_queries = req.hide_file_search_queries - if ( - "hide_web_search_citations" in req.model_fields_set - and req.hide_web_search_citations is not None - ): - asst.hide_web_search_citations = req.hide_web_search_citations - if ( "hide_web_search_sources" in req.model_fields_set and req.hide_web_search_sources is not None diff --git a/web/pingpong/src/lib/api.ts b/web/pingpong/src/lib/api.ts index a2b9e86c1..46aa1e971 100644 --- a/web/pingpong/src/lib/api.ts +++ b/web/pingpong/src/lib/api.ts @@ -1304,7 +1304,6 @@ export type Assistant = { hide_file_search_queries: boolean | null; hide_web_search_sources: boolean | null; hide_web_search_actions: boolean | null; - hide_web_search_citations: boolean | null; endorsed: boolean | null; created: string; updated: string | null; @@ -1392,7 +1391,6 @@ export type CreateAssistantRequest = { hide_file_search_queries?: boolean; hide_web_search_sources?: boolean; hide_web_search_actions?: boolean; - hide_web_search_citations?: boolean; }; /** @@ -1426,7 +1424,6 @@ export type UpdateAssistantRequest = { hide_file_search_queries?: boolean; hide_web_search_sources?: boolean; hide_web_search_actions?: boolean; - hide_web_search_citations?: boolean; }; /** diff --git a/web/pingpong/src/lib/components/WebSearchCallItem.svelte b/web/pingpong/src/lib/components/WebSearchCallItem.svelte index 4129681df..da157a7e2 100644 --- a/web/pingpong/src/lib/components/WebSearchCallItem.svelte +++ b/web/pingpong/src/lib/components/WebSearchCallItem.svelte @@ -25,13 +25,15 @@
- {#if content.action && content.action.type === 'search' && (uniqueSources.length > 0 || content.action.query)} + {#if content.action && content.action.type === 'search' && uniqueSources.length > 0}

From ee07914a64822c75552630457cb4c2aefc64e815 Mon Sep 17 00:00:00 2001 From: Evangelos Kassos Date: Mon, 24 Nov 2025 15:32:42 -0500 Subject: [PATCH 4/4] Lint --- .../group/[classId]/assistant/[assistantId]/+page.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte b/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte index 780b62080..8fdd4680d 100644 --- a/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte +++ b/web/pingpong/src/routes/group/[classId]/assistant/[assistantId]/+page.svelte @@ -39,8 +39,7 @@ MessageDotsOutline, MicrophoneOutline, MicrophoneSolid, - ArchiveOutline, - LinkOutline + ArchiveOutline } from 'flowbite-svelte-icons'; import MultiSelectWithUpload from '$lib/components/MultiSelectWithUpload.svelte'; import { writable, type Writable } from 'svelte/store';