Commit History
-
Fix Polish language: hardcode language=pl, remove langdetect Running
langdetect misclassified short Polish questions (especially without history context). Since the app is Polish-only, remove all language detection and set language='pl' unconditionally. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>26c0ed5 -
Enforce Polish language: history-aware detection + stricter prompt
a11y_agent.py: when langdetect classifies current message as EN, check last 3 user turns in history — if any is Polish, keep PL. Prevents misclassification of short follow-up questions. agent/prompts.py: rewrite PL language rule as hard constraint — explicit prohibition of English regardless of source document language, history language, or standard citation language. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>887509f -
Remove source citations from chat responses
Sources list was noisy in conversational context — sources are already embedded in the knowledge base context passed to the LLM. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>a6e8502 -
Fix history content format: normalize Gradio list-type content to str
Gradio 6.x passes message content as list[dict] (multimodal format) instead of plain str. Normalize history in ask() before passing to OpenAI API and RAG query enrichment. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>841b1fc -
Convert Q&A interface to conversational chatbot with memory
app.py: replace static Q&A (Textbox in/out) with gr.ChatInterface + gr.Chatbot(layout="bubble") embedded in gr.Blocks alongside notes panel. ChatInterface handles history, Enter-to-submit, streaming, and clear button automatically. Social sharing buttons retained below chat. agent/a11y_agent.py: ask() now accepts optional history list[dict]. Passes last 6 history turns to LLM messages. Enriches RAG query with last 2 user turns for context-aware retrieval on follow-up questions. agent/prompts.py: rewrite PL and EN system prompts for conversational style — agent now explicitly references prior conversation context, adapts response format to question type (structured for requirements, natural for follow-ups), and knows to say so when context is missing. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>9bc459e -
Improve RAG retrieval: distance filtering, cross-lang fallback, structured prompts
config.py: add rag_top_k (20), rag_final_top_k (7), rag_distance_threshold (1.5) - threshold set to 1.5 to match text-embedding-3-large distance range (0.48-0.69) agent/tools.py: overhaul search_knowledge_base() - fetch rag_top_k=20 candidates instead of hardcoded 5 - filter by distance threshold, log rejected count - cross-language fallback when primary language returns 0 results - deduplicate chunks by first 100 chars of text - prioritize specification > pattern > test within same distance band - send all unique results to LLM (no hard cutoff — model has 128k context) - add relevance stars ★★★/★★☆/★☆☆ to context so LLM weights sources agent/prompts.py: add structured response format to PL and EN prompts - PL: kryterium → poziom → wymaganie → techniki → źródła - EN: equivalent structure + LLM instructed to interpret relevance stars - both: explicit instruction to say so when knowledge base lacks the answer Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>fa4b04d -
Fix Enter key to submit question instead of adding newline
Change question_input from lines=5 to lines=1 with max_lines=8. Gradio textboxes with lines=1 treat Enter as submit; the field still grows up to 8 lines for longer questions. Update placeholder to hint Enter/Shift+Enter behavior. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>894decc -
Optimize performance: lazy file handle, configurable LLM params, lancedb 0.30.2
- agent/a11y_agent.py: open qa_dataset.jsonl once in __init__ (buffering=1) instead of open/close on every request; move json/datetime imports to module level; add llm_temperature/max_tokens/top_p from settings; pre-cache system prompts for both languages in __init__ - config.py: add llm_temperature, llm_max_tokens, llm_top_p fields - database/vector_store_client.py: upgrade to lancedb 0.30.2 API — list_tables().tables instead of table_names(); to_list() instead of to_df().to_dict(); count_rows() instead of len(); remove unused asyncio - requirements.txt: pin lancedb==0.30.2 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>c657f22
-
Simplify Polish language prompts for better gpt-4o-mini compliance
Jacek Zadrożny- Shortened system prompt (less is more approach) - Simplified user prompt structure - Clearer language instruction placement - Should improve Polish response consistency with gpt-4o-mini5c9813c -
Revert to OPENAI_API_KEY and switch to gpt-4o-mini
Jacek ZadrożnyChanges: - Changed configuration from GITHUB_TOKEN back to OPENAI_API_KEY - Switched LLM model from gpt-4o to gpt-4o-mini (15x cheaper, faster) - Updated all code references in config.py, agent, models, and tests - Added .github/copilot-instructions.md for better AI assistance - Updated .gitignore to exclude node_modules and npm filesf2986d3 -
Fix misleading docstring: replace openai_api_key with github_token in config.py documentation
Jacek Zadrożnydeaaf9d -
Zamiana OPENAI_API_KEY na GITHUB_TOKEN w kodzie, dokumentacji i konfiguracji
Jacek Zadrożnyf9779bd -
Rebrand do Jacek AI + nowy interfejs Q&A + social sharing
Jacek Zadrożny +1: Claude Sonnet 4.5GŁÓWNE ZMIANY: - Zmiana nazwy z "A11y Expert" na "Jacek AI" (wszędzie) - Przeprojektowanie interfejsu z chatbota na formularz Q&A - Naprawiono system prompty (usunięto mylące instrukcje o narzędziach) - Dodano przyciski social media i kopiowania INTERFEJS: - Usunięto chat bubbles, zastąpiono pojedynczym polem Q&A - Zmieniono ikonę z ♿ na 🎯 - Usunięto przykładowe pytania - Dodano duże pole textarea (5 linii) na pytania - Przycisk "Zapytaj eksperta" zamiast "Wyślij" FUNKCJE: - 📋 Przycisk kopiowania odpowiedzi (bez alertu) - 🐦 Twitter/X sharing (pełny tekst + link) - 💼 LinkedIn sharing (tylko URL - ograniczenie API) - 📘 Facebook sharing (tylko URL - ograniczenie API) - Open Graph meta tagi dla lepszych preview KONFIGURACJA: - Dodano PUBLIC_URL do config.py - Domyślny URL: https://huggingface.co/spaces/jaczad/JacekAI - Wsparcie dla zmiennej środowiskowej OPEN_API_KEY (alias) POPRAWKI PROMPTÓW: - Usunięto mylące "DOSTĘPNE NARZĘDZIA" z system promptu - Agent odpowiada bezpośrednio z…68287f9 -
Zmiana na bezstanowy agent z loggingiem Q&A
Jacek Zadrożny +1: Claude Sonnet 4.5- Agent jest teraz stateless (brak conversation_history) - Każde pytanie jest niezależne - rozwiązuje problem współdzielenia stanu między użytkownikami na HF Spaces - Dodano automatyczne logowanie Q&A do qa_dataset.jsonl (format JSONL) - Dodano .gitignore dla qa_dataset.jsonl - Dodano informację o loggingu w UI (GDPR compliance) - Dataset gotowy do fine-tuningu modeli (czyste pary Q&A) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>86d06c6 -
Optymalizacja agenta: background init, źródła i cleanup
Jacek Zadrożny +1: Claude Sonnet 4.5- Dodano CLAUDE.md z dokumentacją dla Claude Code - Włączono background initialization agenta (szybszy start) - Dodano wyświetlanie źródeł na końcu odpowiedzi (📚 Źródła) - Wzmocniono wymuszanie języka polskiego w promptach - Zmniejszono temperature z 0.7 na 0.3 (bardziej deterministyczne odpowiedzi) - Usunięto duplikat vector_store_client.py i app_old.py Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>b3cdeaa
-
Naprawiony format wymiany z chatem
Jacek Zadrożny3a40a92 -
Dodałem platformę DD.info
Jacek Zadrożnyf509ce1 -
Dodałem własną treść do notatki.
Jacek Zadrożny2446101 -
Add two-column layout with editable notes
Jacek Zadrożny- Left column: Chatbot interface - Right column: Markdown notes loaded from notes.md - Notes can be edited locally and pushed to update HF Spaces - Refresh button to reload notes without restarting app - Simpler than embedded editor - use your favorite text editor!af22390 -
Add explicit demo.queue() for HF Spaces
Jacek ZadrożnyHF Spaces needs queue() to be called on ChatInterface - Add demo.queue() for HF Spaces deployment - Keep demo.launch() for local development - This ensures Gradio server starts properlyd05e81c -
Simplify Gradio UI to ChatInterface only
Jacek ZadrożnyFix HF Spaces hang by removing complex Blocks structure - Use simple ChatInterface instead of Blocks with nested ChatInterface - Remove custom status indicator that may cause issues - Simpler = more reliable on HF Spaces This is the minimal working configuration.129b45b -
Switch to on-demand agent initialization
Jacek ZadrożnyBREAKING CHANGE: Remove background thread initialization that was hanging on HF Spaces - Agent now initializes only on first user query - Fixes double-start issue on Hugging Face Spaces - Removes threading complexity that caused hangs - Simpler, more reliable initialization - Better error handling with detailed logging This should fix the persistent hang issue during deployment.f3e3a9b -
Add detailed logging and fix read-only filesystem issues
Jacek Zadrożny- Add verbose logging to agent creation process - Fix VectorStoreClient to handle read-only filesystem - Fix EmbeddingsClient cache creation with proper error handling - Only create directories if they don't exist and we have write permissions - Better traceback logging for database connection errors787b7ff -
Fix signal error in background thread
Jacek Zadrożny- Remove signal-based timeout (doesn't work in threads) - Simplify to basic background initialization - Update HUGGINGFACE_DEBUG.md with correct approach77bf306 -
Fix HuggingFace deployment issues
Jacek Zadrożny- Remove blocking vector_store.connect() call - Add lazy database connection with timeout - Add conditional API key validation for HF Spaces - Add detailed error logging with traceback - Add timeout to agent initialization (30s) - Fix test_startup.py for new architecture - Add HUGGINGFACE_DEBUG.md documentation - Improve error handling in VectorStoreClient637ed9b
-
Force rebuild - clear cache
Jacek Zadrożnyed669a0 -
Pin huggingface-hub version
Jacek Zadrożny6a603f9 -
Fix Gradio version compatibility - update to 6.1.0
Jacek Zadrożnyb1e48a7 -
Usunąłem wersje bibliotek wbrew sugestiom AI
Jacek Zadrożny40d07b7 -
Fix: Import Optional from typing in config.py
Jacek Zadrożny- Added rom typing import Optional to resolve NameError: name 'Optional' is not defined when llm_base_url is defined with type hint Optional[str].f991885 -
Fix: Revert to Pydantic v2 and add pydantic-settings
Jacek Zadrożny- Reverted config.py to use Pydantic v2 syntax, as the new Gradio version installs Pydantic v2 in the environment. - Re-added pydantic-settings to requirements.txt. This aligns the application code with the actual package versions being installed in the HF Spaces environment, fixing the PydanticImportError.f73bfd0 -
Fix: Finalize huggingface-hub version in requirements.txt
Jacek Zadrożny- Ensured huggingface-hub is pinned to v0.33.5 to satisfy Gradio's dependency. - This addresses the specific version conflict indicated by previous build logs.087bbfb -
Fix: Resolve dependency conflicts for HF Spaces
Jacek Zadrożny- Updated gradio-client to v2.0.1 to match gradio v6.1.0 dependency. - Removed pydantic-settings and refactored config.py to use Pydantic v1. This resolves the 'ResolutionImpossible' error from pip and avoids a version conflict with the pydantic v1 pre-installed in the base HF Spaces environment.e67817b
-
Fix: Force pin core Gradio dependencies
Jacek Zadrożny- Explicitly pins gradio, gradio-client, and huggingface-hub to their latest stable versions. - This is a more aggressive strategy to force the Hugging Face Spaces environment to use a fully compatible set of libraries and avoid issues with dependency caching or resolution.001f6a3 -
Fix: Pin Gradio to v6.1.0 in requirements.txt
Jacek Zadrożny- Updated Gradio version from a broad range (>=4.0.0,<5.0.0) to a specific version (6.1.0) to match the declared SDK version in README.md. - This should resolve the ImportError related to huggingface_hub by ensuring a compatible set of dependencies is installed for the latest Gradio.9725abb -
Fix: Make LLM base_url optional to prevent startup hang
Jacek Zadrożny- Changed llm_base_url in config.py to be optional (defaulting to None). - Updated 11y_agent.py to only pass ase_url to the OpenAI client if it is explicitly provided. This prevents potential network hangs during OpenAI client initialization on platforms like Hugging Face Spaces, making the default setup more robust.f21ff52 -
Docs: Update README.md and consolidate deployment info
Jacek Zadrożny- Updated README.md with comprehensive project information, installation instructions, and deployment details for Hugging Face Spaces. - Consolidated information from README_DEPLOYMENT.md into the main README.md. - Deleted the now redundant README_DEPLOYMENT.md. - Corrected Gradio SDK version in README metadata.ed9cfa3 -
Hotfix: Disable atexit handler to prevent premature shutdown on HF Spaces
Jacek Zadrożny5a209a3 -
Fix: Gradio app init for HF Spaces. Moved agent init and cleanup, removed demo.launch.
Jacek Zadrożny4ce8d8c -
Add ResourceWarning suppression for asyncio cleanup errors from external libs
Jacek Zadrożny478d8a6 -
Remove Dockerfile - not needed for Gradio Space
Jacek Zadrożny6422f6d -
Remove asyncio completely to fix event loop cleanup errors
Jacek Zadrożny- Convert all async functions to synchronous - Remove asyncio.to_thread() and event loop management - Simplify embeddings client (direct API calls with retry logic) - Simplify agent initialization (no event loops needed) - Fix all docstring examples to remove await - Eliminates 'Invalid file descriptor: -1' errors completely5411262 -
Fix asyncio event loop cleanup errors
Jacek Zadrożny- Replace asyncio.run() with persistent event loop in background thread - Properly close event loop in cleanup_resources() - Prevents 'Invalid file descriptor: -1' errors on garbage collection06bb39f -
Fix: Use asyncio.run() for proper loop lifecycle management
Jacek Zadrożnyf7099e6 -
Fix: Simplify event loop management - let Gradio handle async
Jacek Zadrożny493650d -
Fix: Remove 'every' parameter for Gradio 6.x compatibility
Jacek Zadrożny9cbfb5d -
Fix: Quote Python version to prevent YAML float parsing (3.10 -> '3.10')
Jacek Zadrożny32addc8 -
Fix: Clarify Python 3.10 version in Dockerfile
Jacek Zadrożny7f9aa38 -
Lazy loading
Jacek Zadrożny59c860e
-
Poprawka błędu w pliku readme.md
Jacek Zadrożnya010946