Skip to content

Commit 4bac20d

Browse files
committed
Deprecate Ask tab
Remove the Ask/Q&A tab from the application as it was not widely used and duplicated functionality available in the Chat tab. Changes: - Remove Ask page frontend components (Ask.tsx, Ask.module.css) - Remove RetrieveThenReadApproach backend class - Remove /ask API endpoint - Remove Ask-related tests and snapshots - Update documentation to reflect removal - Update all translation files - Update evaluation configs Fixes #2834
1 parent 35a7885 commit 4bac20d

File tree

64 files changed

+28
-3722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+28
-3722
lines changed

AGENTS.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ If necessary, edit this file to ensure it accurately reflects the current state
1111
* app/backend: Contains the Python backend code, written with Quart framework.
1212
* app/backend/approaches: Contains the different approaches
1313
* app/backend/approaches/approach.py: Base class for all approaches
14-
* app/backend/approaches/retrievethenread.py: Ask approach, just searches and answers
1514
* app/backend/approaches/chatreadretrieveread.py: Chat approach, includes query rewriting step first
16-
* app/backend/approaches/prompts/ask_answer_question.prompty: Prompt used by the Ask approach to answer the question based off sources
1715
* app/backend/approaches/prompts/chat_query_rewrite.prompty: Prompt used to rewrite the query based off search history into a better search query
1816
* app/backend/approaches/prompts/chat_query_rewrite_tools.json: Tools used by the query rewriting prompt
1917
* app/backend/approaches/prompts/chat_answer_question.prompty: Prompt used by the Chat approach to actually answer the question based off sources
@@ -86,11 +84,9 @@ When adding a new developer setting, update:
8684
* app/frontend/src/components/Settings.tsx : Add a UI element for the setting
8785
* app/frontend/src/locales/*/translations.json: Add a translation for the setting label/tooltip for all languages
8886
* app/frontend/src/pages/chat/Chat.tsx: Add the setting to the component, pass it to Settings
89-
* app/frontend/src/pages/ask/Ask.tsx: Add the setting to the component, pass it to Settings
9087

9188
* backend:
9289
* app/backend/approaches/chatreadretrieveread.py : Retrieve from overrides parameter
93-
* app/backend/approaches/retrievethenread.py : Retrieve from overrides parameter
9490
* app/backend/app.py: Some settings may need to be sent down in the /config route.
9591

9692
## When adding tests for a new feature

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The repo includes sample data so it's ready to try end to end. In this sample ap
5757

5858
## Features
5959

60-
- Chat (multi-turn) and Q&A (single turn) interfaces
60+
- Chat (multi-turn) interface
6161
- Renders citations and thought process for each answer
6262
- Includes settings directly in the UI to tweak the behavior and experiment with options
6363
- Integrates Azure AI Search for indexing and retrieval of documents, with support for [many document formats](/docs/data_ingestion.md#supported-document-formats) as well as [cloud data ingestion](/docs/data_ingestion.md#cloud-data-ingestion)
@@ -228,7 +228,7 @@ See more tips in [the local development guide](docs/localdev.md).
228228

229229
Once in the web app:
230230

231-
- Try different topics in chat or Q&A context. For chat, try follow up questions, clarifications, ask to simplify or elaborate on answer, etc.
231+
- Try different topics in chat. Try follow up questions, clarifications, ask to simplify or elaborate on answer, etc.
232232
- Explore citations and sources
233233
- Click on "settings" to try different options, tweak prompts, etc.
234234

app/backend/app.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@
4747
from approaches.approach import Approach, DataPoints
4848
from approaches.chatreadretrieveread import ChatReadRetrieveReadApproach
4949
from approaches.promptmanager import PromptyManager
50-
from approaches.retrievethenread import RetrieveThenReadApproach
5150
from chat_history.cosmosdb import chat_history_cosmosdb_bp
5251
from config import (
5352
CONFIG_AGENTIC_KNOWLEDGEBASE_ENABLED,
54-
CONFIG_ASK_APPROACH,
5553
CONFIG_AUTH_CLIENT,
5654
CONFIG_CHAT_APPROACH,
5755
CONFIG_CHAT_HISTORY_BROWSER_ENABLED,
@@ -182,24 +180,6 @@ async def content_file(path: str, auth_claims: dict[str, Any]):
182180
return await send_file(blob_file, mimetype=mime_type, as_attachment=False, attachment_filename=path)
183181

184182

185-
@bp.route("/ask", methods=["POST"])
186-
@authenticated
187-
async def ask(auth_claims: dict[str, Any]):
188-
if not request.is_json:
189-
return jsonify({"error": "request must be json"}), 415
190-
request_json = await request.get_json()
191-
context = request_json.get("context", {})
192-
context["auth_claims"] = auth_claims
193-
try:
194-
approach: Approach = cast(Approach, current_app.config[CONFIG_ASK_APPROACH])
195-
r = await approach.run(
196-
request_json["messages"], context=context, session_state=request_json.get("session_state")
197-
)
198-
return jsonify(r)
199-
except Exception as error:
200-
return error_response(error, "/ask")
201-
202-
203183
class JSONEncoder(json.JSONEncoder):
204184
def default(self, o):
205185
if dataclasses.is_dataclass(o) and not isinstance(o, type):
@@ -722,40 +702,6 @@ async def setup_clients():
722702

723703
prompt_manager = PromptyManager()
724704

725-
# Set up the two default RAG approaches for /ask and /chat
726-
# RetrieveThenReadApproach is used by /ask for single-turn Q&A
727-
728-
current_app.config[CONFIG_ASK_APPROACH] = RetrieveThenReadApproach(
729-
search_client=search_client,
730-
search_index_name=AZURE_SEARCH_INDEX,
731-
knowledgebase_model=AZURE_OPENAI_KNOWLEDGEBASE_MODEL,
732-
knowledgebase_deployment=AZURE_OPENAI_KNOWLEDGEBASE_DEPLOYMENT,
733-
knowledgebase_client=knowledgebase_client,
734-
knowledgebase_client_with_web=knowledgebase_client_with_web,
735-
knowledgebase_client_with_sharepoint=knowledgebase_client_with_sharepoint,
736-
knowledgebase_client_with_web_and_sharepoint=knowledgebase_client_with_web_and_sharepoint,
737-
openai_client=openai_client,
738-
chatgpt_model=OPENAI_CHATGPT_MODEL,
739-
chatgpt_deployment=AZURE_OPENAI_CHATGPT_DEPLOYMENT,
740-
embedding_model=OPENAI_EMB_MODEL,
741-
embedding_deployment=AZURE_OPENAI_EMB_DEPLOYMENT,
742-
embedding_dimensions=OPENAI_EMB_DIMENSIONS,
743-
embedding_field=AZURE_SEARCH_FIELD_NAME_EMBEDDING,
744-
sourcepage_field=KB_FIELDS_SOURCEPAGE,
745-
content_field=KB_FIELDS_CONTENT,
746-
query_language=AZURE_SEARCH_QUERY_LANGUAGE,
747-
query_speller=AZURE_SEARCH_QUERY_SPELLER,
748-
prompt_manager=prompt_manager,
749-
reasoning_effort=OPENAI_REASONING_EFFORT,
750-
multimodal_enabled=USE_MULTIMODAL,
751-
image_embeddings_client=image_embeddings_client,
752-
global_blob_manager=global_blob_manager,
753-
user_blob_manager=user_blob_manager,
754-
use_web_source=current_app.config[CONFIG_WEB_SOURCE_ENABLED],
755-
use_sharepoint_source=current_app.config[CONFIG_SHAREPOINT_SOURCE_ENABLED],
756-
retrieval_reasoning_effort=AGENTIC_KNOWLEDGEBASE_REASONING_EFFORT,
757-
)
758-
759705
# ChatReadRetrieveReadApproach is used by /chat for multi-turn conversation
760706
current_app.config[CONFIG_CHAT_APPROACH] = ChatReadRetrieveReadApproach(
761707
search_client=search_client,

app/backend/approaches/prompts/ask_answer_question.prompty

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)