Closed smokestacklightnin closed 3 months ago
@nenb As follow-up to https://github.com/Quansight/ragna/pull/376#discussion_r1616776865, I've refactored the logic we merged in #425 a little to make it even more flexible.
HttpApiCaller
base class that handles the different streaming protocols for us. It is instantiated by the base class of the builtin assistants and parametrized by the streaming protocol, which is set as class constant.HttpApiCaller
also handles JSON streaming for Google assistants now and thus abstracts the complexity away.OpenaiCompliantHttpApiAssistant
to OpenaiLikeHttpApiAssistant
, because the term "compliant" is even less meaningless when adding Ollama into the mixOpenaiLikeHttpApiAssistant
now has to implement answer
itself given that their is no standard way of handling it. The only common functionality is the call to the API, which so far seems to be rather constant across all models.
This PR adds support for Ollama assistants.