- Issue created by @Roman_L
- Status changed to Fixed
about 1 year ago 11:27am 4 October 2023 - 🇱🇹Lithuania mindaugasd
Hi, you are welcome.
This error appears in openai-php/client library.
Someone else described this error in https://github.com/openai-php/client/issues/189 and closed the bug report without explanation.
But we can now see that this bug is already fixed in latest code https://github.com/openai-php/client/blob/main/src/Responses/Chat/Create...
To solve this error, please update to the latest openai library version (as listed in https://github.com/openai-php/client/tags) - 🇫🇷France Roman_L
Hi,
right, updating openai lib solved this issue.
Also, do you plan to add 'name' param in MessageBase.php for function calls usage?
as there are not setName/getName OpenAI lib will return :
Missing parameter 'name': messages with role 'function' must have a 'name'
Thanks and let me know if i can help on this.
- 🇱🇹Lithuania mindaugasd
aichat is meant to display things to the user (messages with audio, images, files, code etc.)
And function calling part belongs to the backend.In case you would like to display something to the user within the message, there are
MessageBase.php
methods calledsetContent()
andgetContent()
. At the moment, only text was tested implementing methods calledsetText()
andgetText()
.There is a task on the roadmap → called
8. Test with images, audio and other media display
, which would allow for me to test and adapt for multimedia content. Development of this needs funding.Here is a demo video https://youtu.be/V-0EqaQvAXo?feature=shared&t=41 showing aichat could allow to interact with AI in all kinds of ways, like reviewing code, providing buttons to click (interactive features) etc. But this demo is built in custom code back then.
let me know if i can help on this.
It is either funding aichat features on the roadmap, or contributing code (for content display).
Function calling as a default Drupal feature is meant to be implemented within AI Work ( https://www.drupal.org/project/aiwork → ) backend module, which would allow to interact with AI with all kinds of different ways (like displayed in the video). AI work module is for "AI doing the work" (includes function calling). And "AI chat user interface" is a frontend module for displaying things and providing user interface for the user to interact with AI. Since AI Work is unfunded, so you have to implement function calling with your custom code (within your custom backend).
do you plan to add 'name' param
Maybe no, because there are infinite number of variations of the data that aichat could display (from different service providers like Google, Meta, open source etc.) To save message data, maybe you want to look at ExampleBackend.php methods called
loadMessages()
andsaveMessage()
in custom backend, or modifying
Message.php
file in your custom backend. Full response data is stored within
Message
array keyed 'response_data', but you can also extend Message.php. - Status changed to Closed: works as designed
about 1 year ago 6:53am 6 October 2023