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

feat: Add system promt support for beta #45

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

davidgustys
Copy link

This is almost 1:1 copy of @gregpriday PR:#42, but added on beta branch instead of main.

This PR introduces system instruction support and adds the ability to easily configure the client to use the beta API endpoint (required for system instructions).

Changes

  1. System Instruction Support:

    • Added withSystemInstruction method to the GenerativeModel class
    • Updated GenerateContentRequest and related components to include system instructions in API requests
    • Modified Client and GenerativeModelContract to support system instructions
    • Added tests to verify system instruction functionality
  2. Added tests to cover the new beta API configuration

Additional Notes:

  • The code follows the project's coding style (verified using composer lint)
  • Tests have been added for the new functionality
  • The commit history is coherent and meaningful
  • No breaking changes have been introduced, maintaining SemVer compatibility
  • Tested in my own project, and everything is working properly
  • Please review and let me know if any further changes are needed.

Copy link
Contributor

@aydinfatih aydinfatih left a comment

Choose a reason for hiding this comment

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

Finally, you can run composer test before submitting commits.

src/Requests/GenerativeModel/GenerateContentRequest.php Outdated Show resolved Hide resolved
src/Requests/GenerativeModel/GenerateContentRequest.php Outdated Show resolved Hide resolved
src/Client.php Outdated Show resolved Hide resolved
@Plytas
Copy link
Contributor

Plytas commented Oct 29, 2024

Hey @aydinfatih, I have adjusted the PR according to your comments. Also ran composer test and it's all green now.

@aydinfatih aydinfatih merged commit 0d023f0 into google-gemini-php:beta Oct 29, 2024
8 checks passed
@Plytas Plytas deleted the beta branch October 29, 2024 13:56
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