From 4e0ac8f06508c52b402cf61e37180dd12989bd6d Mon Sep 17 00:00:00 2001 From: Gianluca Capuzzi Date: Tue, 8 Jul 2025 12:02:07 +0200 Subject: [PATCH] Fixed CONTRIBUTING.md path, NOTICE path and query rewriting just if param is True Signed-off-by: Gianluca Capuzzi --- README.md | 31 ++++++++++++++++--------------- src/mvt/pages/chatbot.py | 5 +---- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 42b31ee..0be1583 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,20 @@ The **Hyperledger Labs AIFAQ Prototype (Agents Branch)** is an open-source conve 👉 Official Wiki Pages: -* [Hyperledger Labs Wiki](https://lf-hyperledger.atlassian.net/wiki/spaces/labs/pages/20290949/AI+FAQ+2025) +- [Hyperledger Labs Wiki](https://lf-hyperledger.atlassian.net/wiki/spaces/labs/pages/20290949/AI+FAQ+2025) 👉 Weekly Community Calls: -* Every Monday (public) — join via [Hyperledger Labs Calendar](https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings). +- Every Monday (public) — join via [Hyperledger Labs Calendar](https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings). --- ## 🧩 Features -* Conversational AI for targeted question answering -* Supports RAG (Retrieval Augmented Generation) for enhanced accuracy -* Easy integration via API and UI samples -* Extensible architecture for multi-agent support +- Conversational AI for targeted question answering +- Supports RAG (Retrieval Augmented Generation) for enhanced accuracy +- Easy integration via API and UI samples +- Extensible architecture for multi-agent support --- @@ -76,6 +76,7 @@ MISTRALAI_API_KEY= OPENAI_API_KEY= HF_TOKEN= ``` + Mistral API Key HF Access Token @@ -87,10 +88,10 @@ HF_TOKEN= ```bash streamlit run app.py ``` + HF Access Token HF Access Token - 🎉 Access the demo at: [http://3.225.169.87:8502/](http://3.225.169.87:8502/) HF Access Token @@ -98,15 +99,15 @@ streamlit run app.py ## 🌐 Open Source License -* **License:** Apache 2.0 (see [`LICENSE`](./LICENSE) and [`NOTICE`](./NOTICE)) -* **3rd Party Libraries:** [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html) -* **License Assembly:** [Assembling LICENSE and NOTICE](https://infra.apache.org/licensing-howto.html#mod-notice) +- **License:** Apache 2.0 (see [`LICENSE`](./LICENSE) and [`NOTICE`](./docs/NOTICE)) +- **3rd Party Libraries:** [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html) +- **License Assembly:** [Assembling LICENSE and NOTICE](https://infra.apache.org/licensing-howto.html#mod-notice) --- ## 🤝 Contributing -We welcome contributions! Please check our [CONTRIBUTING](./CONTRIBUTING.md) guidelines and [Antitrust Policy and Code of Conduct](https://lf-hyperledger.atlassian.net/wiki/spaces/HIRC/pages/19169404/Anti-trust+Policy+Notice+Code+of+Conduct). +We welcome contributions! Please check our [CONTRIBUTING](./docs/CONTRIBUTING.md) guidelines and [Antitrust Policy and Code of Conduct](https://lf-hyperledger.atlassian.net/wiki/spaces/HIRC/pages/19169404/Anti-trust+Policy+Notice+Code+of+Conduct). --- @@ -118,12 +119,12 @@ Join our weekly public calls every Monday! See the [Hyperledger Labs Calendar](h ## 📢 Stay Connected -* [Slack Discussions](https://join.slack.com/t/aifaqworkspace/shared_invite/zt-337k74jsl-tvH_4ct3zLj99dvZaf9nZw) -* [Hyperledger Labs Community](https://lf-hyperledger.atlassian.net/wiki/spaces/labs/pages/20290949/AI+FAQ+2025) -* Official Website: [aifaq.pro](https://aifaq.pro) +- [Slack Discussions](https://join.slack.com/t/aifaqworkspace/shared_invite/zt-337k74jsl-tvH_4ct3zLj99dvZaf9nZw) +- [Hyperledger Labs Community](https://lf-hyperledger.atlassian.net/wiki/spaces/labs/pages/20290949/AI+FAQ+2025) +- Official Website: [aifaq.pro](https://aifaq.pro) --- ## ⭐️ Star Graph -![Star Graph](https://starchart.cc/hyperledger-labs/aifaq.svg) \ No newline at end of file +![Star Graph](https://starchart.cc/hyperledger-labs/aifaq.svg) diff --git a/src/mvt/pages/chatbot.py b/src/mvt/pages/chatbot.py index b5151f8..fd7058c 100644 --- a/src/mvt/pages/chatbot.py +++ b/src/mvt/pages/chatbot.py @@ -148,13 +148,10 @@ def save_feedback(username, msg_idx, feedback_type, response_snippet, reason=Non with st.chat_message("user"): st.write(prompt) - # Rewrite the query for better search - rewritten_query = query_rewriting_llm(prompt) - with st.chat_message("assistant", avatar=logo_path): with st.spinner("Thinking..."): # Use rewritten query or original prompt based on config - query = rewritten_query if config_data.get("use_query_rewriting", True) else prompt + query = query_rewriting_llm(prompt) if config_data.get("use_query_rewriting", True) else prompt response = rag_chain.invoke({"input": query}) # Save response to database instead of text file