Commit History
-
Fix Polish language: hardcode language=pl, remove langdetect
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 -
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 -
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
-
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
-
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 -
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 -
Lazy loading
Jacek Zadrożny59c860e
-
Aktualizacja ostatniej szansy
Jacek Zadrożny5fb63e2 -
Re-initialize repository with correct LFS setup
Jacek Zadrożny1dab660