Repository navigation
v1.1.6
Changes
Brings the Conversation.ask_live / Agent.run_live interleaved streaming-tool experience to models without native function-calling training (Phi-3, Gemma, base Llama 3, etc.) — the parser detects tool-call delimiters in the token stream and emits the same LiveEvent sequence native drivers produce.
- prompture/agents/tool_grammars.py: ToolGrammar dataclass, XML_TAGS default grammar, system-prompt injection helper, grammar registry
- prompture/drivers/_prompted_tool_stream.py: PromptedToolStreamParser state machine (handles partial open/close delimiters across chunks, multi-tool turns, malformed-JSON recovery) + PromptedToolStreamMixin for driver opt-in
- OllamaDriver: generate_messages_with_tools_stream with Tier 1 native path (streams tokens live, emits tool events from final chunk) and Tier 2 fallback via options={"prompted_tools": True}
- AsyncOllamaDriver: same; also gains generate_messages_stream which was missing (httpx.AsyncClient.stream against /api/chat)
- driver-contract tests updated for the new mixin base ordering and the now-streaming AsyncOllamaDriver
- 25-test suite covering grammar registry, parser narration, single + multi tool calls, partial-delimiter splits, error recovery, and end-to-end mixin emulation
- examples/agent_live_stream_ollama.py demonstrating both tiers
- README "Live Streaming Tool Calls" section with the mixin opt-in pattern other drivers can follow