Modified PromptLayerChatOpenAI class to support function call (#6366)

Introduction of newest function calling feature doesn't work properly
with PromptLayerChatOpenAI model since on the `_generate` method,
functions argument are not even getting passed to the `ChatOpenAI` base
class which results in empty `ai_message.additional_kwargs`

Fixes  #6365
pull/7253/head^2
Avinash Raj 1 year ago committed by GitHub
parent e0cb3ea90c
commit 09acbb8410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -49,7 +49,7 @@ class PromptLayerChatOpenAI(ChatOpenAI):
from promptlayer.utils import get_api_key, promptlayer_api_request
request_start_time = datetime.datetime.now().timestamp()
generated_responses = super()._generate(messages, stop, run_manager)
generated_responses = super()._generate(messages, stop, run_manager, **kwargs)
request_end_time = datetime.datetime.now().timestamp()
message_dicts, params = super()._create_message_dicts(messages, stop)
for i, generation in enumerate(generated_responses.generations):

Loading…
Cancel
Save