google-gemini-php / client

⚡️ Gemini PHP is a community-maintained PHP API client that allows you to interact with the Gemini AI API.
MIT License
192 stars 41 forks source link

feat: Add system promt support for beta #45

Closed davidgustys closed 3 weeks ago

davidgustys commented 1 month ago

This is almost 1:1 copy of @gregpriday PR:https://github.com/google-gemini-php/client/pull/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:

Plytas commented 3 weeks ago

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