Testuj pojedynczego agenta TruthSeeker w izolacji.
Input: Nazwa agenta do testowania (scraper-intel, knowledge-architect, chat-interrogator, judge-dredd, prompt-refiner)
Steps
- •
Wybierz agenta do testu
Dostępni agenci:
Agent Odpowiedzialność Wymagania scraper-intelPobieranie treści stron Playwright knowledge-architectIndeksowanie do Qdrant Qdrant, OpenAI chat-interrogatorTestowanie chatbotów Playwright judge-dreddWeryfikacja odpowiedzi Qdrant, OpenAI prompt-refinerUlepszanie promptów OpenAI - •
Przygotuj dane testowe
Dla każdego agenta przygotuj odpowiednie dane wejściowe:
scraper-intel
pythonfrom src.agents.scraper_intel import ScraperIntel scraper = ScraperIntel() result = await scraper.scrape("https://example.com") print(result.content)knowledge-architect
pythonfrom src.agents.knowledge_architect import KnowledgeArchitect architect = KnowledgeArchitect() result = await architect.index_document( content="Treść dokumentu...", source_url="https://example.com", title="Przykładowy dokument" ) print(f"Zaindeksowano {result.chunk_count} fragmentów")chat-interrogator
pythonfrom src.agents.chat_interrogator import ChatInterrogator interrogator = ChatInterrogator() result = await interrogator.test_chatbot( url="https://example.com", questions=["Jakie są godziny otwarcia?", "Gdzie się znajdujecie?"] ) print(result.session_log)judge-dredd
pythonfrom src.agents.judge_dredd import JudgeDredd judge = JudgeDredd() verdict = await judge.verify( question="Jakie są godziny otwarcia?", chatbot_answer="Jesteśmy otwarci od 8 do 16.", rag_context=["Godziny otwarcia: 8:00-16:00 w dni robocze"] ) print(f"Ocena: {verdict.category} ({verdict.confidence}%)")prompt-refiner
pythonfrom src.agents.prompt_refiner import PromptRefiner refiner = PromptRefiner() improved = await refiner.improve_prompt( original_prompt="Jesteś pomocnym asystentem...", errors=["Halucynacja o cenach", "Zły ton formalny"] ) print(improved.new_prompt) - •
Uruchom test
bashcd c:\Users\Trzyb\Desktop\truthseeker uv run python -c " import asyncio # wklej kod testowy tutaj asyncio.run(test()) "
- •
Zweryfikuj wynik
- •Sprawdź czy agent zwraca oczekiwane dane
- •Sprawdź logi w konsoli
- •Sprawdź czy nie ma błędów/wyjątków
Guardrails
- •Testuj tylko jednego agenta na raz
- •Używaj danych testowych, nie produkcyjnych
- •Sprawdzaj logi infrastruktury (Qdrant, Redis)