forked from phoenix/litellm-mirror
fix(add-custom-success-callback-for-streaming): add custom success callback for streaming
This commit is contained in:
parent
868c1c594f
commit
7e34736a38
8 changed files with 89 additions and 20 deletions
|
@ -961,7 +961,7 @@ def completion(
|
|||
messages=messages
|
||||
)
|
||||
else:
|
||||
prompt = prompt_factory(model=model, messages=messages)
|
||||
prompt = prompt_factory(model=model, messages=messages, custom_llm_provider=custom_llm_provider)
|
||||
|
||||
## LOGGING
|
||||
logging.pre_call(
|
||||
|
@ -1410,6 +1410,7 @@ def text_completion(*args, **kwargs):
|
|||
kwargs["messages"] = messages
|
||||
kwargs.pop("prompt")
|
||||
response = completion(*args, **kwargs) # assume the response is the openai response object
|
||||
print(f"response: {response}")
|
||||
formatted_response_obj = {
|
||||
"id": response["id"],
|
||||
"object": "text_completion",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue