Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functionResult messages missing 'name' parameter with OpenAI #194

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kaeldric
Copy link

@kaeldric kaeldric commented Aug 5, 2024

Adding message of type "functionResult" did not work in OpenAI chat because the parameter 'name' is required.
I could not test the fix with other models.

@f-lombardo
Copy link
Contributor

Hi @kaeldric , can you provide any integration and unit tests?

@MaximeThoonsen
Copy link
Collaborator

hey @kaeldric, thanks for your contribution!
If you can add test that would be amazing or maybe some example code in the doc to show the usage?

@kaeldric
Copy link
Author

kaeldric commented Aug 8, 2024

Hi all! I wrote some tests based on my current usage, I don't know if those work for you.

About the documentation, what do you think about the Integration/Chat/OpenAIChatTest.php function?
I can try to elaborate on that with the idea of providing additional context to the assistant with the result function, maybe checking the result function value.

$functionInfo->name
);

$chat->generateChatOrReturnFunctionCalled($messages);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could use the generateChat method here, making some assertions on the results?

@@ -20,6 +20,29 @@
expect(isset($chat))->toBeTrue();
});

it('can process system, user, assistant and functionResult messages', function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the integration test seems really useful, I don't see much value in this unit test. Moreover I think it does not represent an example of real usage of the function, so it could be misleading.

@MaximeThoonsen
Copy link
Collaborator

@kaeldric maybe we can use CalledFunction now it has been introduced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants