(Refactor) Code Quality improvement - Use Common base handler for clarifai/ (#7125)

* use base_llm_http_handler for clarifai

* fix clarifai completion

* handle faking streaming base llm http handler

* add fake streaming for clarifai

* add FakeStreamResponseIterator for base model iterator

* fix get_model_response_iterator

* fix base model iterator

* fix base model iterator

* add support for faking sync streams clarfiai

* add fake streaming for clarifai

* remove unused code

* fix import

* fix llm http handler

* test_async_completion_clarifai

* fix clarifai tests

* fix linting
This commit is contained in:
Ishaan Jaff 2024-12-09 21:04:48 -08:00 committed by GitHub
parent c5e0407703
commit 28ff38e35d
9 changed files with 155 additions and 269 deletions

View file

@ -136,7 +136,7 @@ class BaseConfig(ABC):
def get_model_response_iterator(
self,
streaming_response: Union[Iterator[str], AsyncIterator[str]],
streaming_response: Union[Iterator[str], AsyncIterator[str], ModelResponse],
sync_stream: bool,
json_mode: Optional[bool] = False,
) -> Any: