Commit Graph

2 Commits

Author SHA1 Message Date
JackChen bc31008f4e feat(llm): add fallback tool-call extraction for local models (#15)
Local models (Ollama, vLLM) sometimes return tool calls as text instead
of using the native tool_calls wire format. This adds a safety-net
extractor that parses tool calls from model text output when native
tool_calls is empty.

- Add text-tool-extractor with support for bare JSON, code fences,
  and Hermes <tool_call> tags
- Wire fallback into OpenAI adapter chat() and stream() paths
- Add onWarning callback when model ignores configured tools
- Add timeoutMs on AgentConfig for per-run abort (local models can
  be slow)
- Add 26 tests for extractor and fallback behavior
- Document local model compatibility in README
2026-04-05 11:49:10 +08:00
JackChen 31a0fa4951 docs: add examples for local models (Ollama) and fan-out/aggregate pattern
- 06-local-model.ts: mix Ollama (local) + Claude (cloud) in a runTasks pipeline,
  demonstrating baseURL and apiKey placeholder for OpenAI-compatible servers
- 07-fan-out-aggregate.ts: MapReduce pattern using AgentPool.runParallel() to
  fan out analysis to 3 perspective agents, then aggregate via a synthesizer
2026-04-03 02:12:05 +08:00