Commit Graph

6 Commits

Author SHA1 Message Date
Z User
b811162f78 Implement tool calling loop for LLM
- Pass all registered tools to LLM during chat completion
- Handle tool_calls from LLM response
- Execute tools and feed results back to LLM
- Loop until LLM returns final response
- Updated system prompt to encourage tool use
- Updated streaming to handle tool calls
- Increased MAX_TOOL_ITERATIONS to 5
2026-03-29 16:07:56 +00:00
Z User
4394e7d6f9 Add comprehensive set of free data tools for RAG
Tools added:
- Wikipedia: search, get article, get full article
- News: Hacker News, Reddit, aggregated news search
- Finance: stocks (yfinance), crypto (CoinGecko), exchange rates
- Medical: PubMed, FDA, disease data, health topics
- Weather: current, forecast, air quality (Open-Meteo)
- Science: arXiv, Semantic Scholar, DOAJ
- Web: DuckDuckGo search, instant answers, page content

All tools use completely free APIs with no authentication required.
2026-03-29 06:27:32 +00:00
Z User
b23964b35a Switch from ZAI SDK to OpenRouter with openrouter/free model
- Replace z-ai-web-dev-sdk with openai SDK
- Add OPENROUTER_API_KEY and OPENROUTER_BASE_URL config
- Update AsyncOpenAI client for OpenRouter
- Update generate_response and stream_chat_completion
- Update .env.example with OpenRouter settings
2026-03-29 04:35:54 +00:00
Z User
eabdadfb62 Implement full DocRAG server with OpenAI-compatible API
Features:
- FastAPI server with OpenAI-compatible endpoints (/v1/chat/completions, /v1/models)
- RAG system with document processing and vector storage
- Support for multiple document formats (PDF, DOCX, HTML, text, code)
- Streaming response support
- Tool integration with website_downloader
- Document management API endpoints
- GLM-4.7-Flash integration via z-ai-web-dev-sdk
- Works transparently with Open WebUI and other OpenAI clients

Components:
- main.py: FastAPI application with OpenAI-compatible API
- rag/: RAG system (document processor, vector store, retriever)
- tools/: Tool manager with website_downloader integration
- .env.example: Configuration template
2026-03-29 00:57:37 +00:00
Z User
aa69b2f496 Add website downloader tool wrapper for GLM-4.7-Flash
- Create website_downloader_tool.py with OpenAI function calling schema
- Add comprehensive tool documentation
- Update README with usage examples
- Update requirements.txt with optional sdk dependency
2026-03-29 00:16:54 +00:00
1623ee8d2c tool1 and init req file 2026-03-28 16:04:27 -07:00