rig
rig copied to clipboard
refactor: Unify openai-with-reasoning streaming
Right now we do a great job of re-using streaming for providers that are openai completion api compliant. But we don't do a good job of those that are also the same but allow reasoning (openrouter, together, groq).
Open to suggestions where we could put that code, but the streaming logic is identical except the reasoning. We might want to externalize that logic into it's own module external to any provider with its own set of structures?
streaming/
- completion.rs
- completion_reasoning.rs
- response.rs