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
This commit is contained in:
Avinash Raj 2023-07-06 22:46:04 +05:30 committed by GitHub
parent e0cb3ea90c
commit 09acbb8410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):