mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
palm streaming
This commit is contained in:
parent
0d47663b8b
commit
d1692e89dd
2 changed files with 24 additions and 3 deletions
|
@ -800,6 +800,7 @@ def completion(
|
|||
or litellm.api_key
|
||||
)
|
||||
|
||||
# palm does not support streaming as yet :(
|
||||
model_response = palm.completion(
|
||||
model=model,
|
||||
messages=messages,
|
||||
|
@ -812,10 +813,12 @@ def completion(
|
|||
api_key=palm_api_key,
|
||||
logging_obj=logging
|
||||
)
|
||||
if "stream_tokens" in optional_params and optional_params["stream_tokens"] == True:
|
||||
# don't try to access stream object,
|
||||
# fake palm streaming
|
||||
if stream == True:
|
||||
# fake streaming for palm
|
||||
resp_string = model_response["choices"][0]["message"]["content"]
|
||||
response = CustomStreamWrapper(
|
||||
model_response, model, custom_llm_provider="palm", logging_obj=logging
|
||||
resp_string, model, custom_llm_provider="palm", logging_obj=logging
|
||||
)
|
||||
return response
|
||||
response = model_response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue