feat: add internal policy gem foundation and controls#134
feat: add internal policy gem foundation and controls#134Vigno04 wants to merge 7 commits intoNativu5:mainfrom
Conversation
|
I don't understand the purpose of forcing internal gems when initializing the client you're working on. Can you explain it more clearly? Why would it block video or audio generation? |
|
The inplemented gem is an example but it could be used in many different ways, for example:
In my specific api video out wasn't supported so i just ported the same message but there are almost infinite use cases and is very easily adaptable to the specific one a user might want, for now i kept only internal access but it could even be expanded |
|
I think it would be better to allow users to proactively enable gems, declare the gem name and prompt they want, and add them in configuration or environment variables as they wish. The default should be disabled, allowing advanced users to choose. Forcing a gem like that would affect many users because gems are essentially system prompts. |
|
Yeah, I know, above the default there is the explanation on how to add one, it's fairly easy, i just put an example there if the main contributor think a default could be useful to block currently not supported method or adding some info on how the data gets passed, adding them trough config is pretty easy to inplement |
|
For example sone endpoint could pass system prompt or tools but they are passed as text inside so maybe adding an explanation could be useful to Gemini, still it's very easy to add or remove gems and they gets automatically managed so it's just a design choice then |
There was a problem hiding this comment.
Pull request overview
Adds an internal foundation for “policy gems” management/synchronization across Gemini clients, controlled via runtime configuration, intended to support future conditional policy usage without exposing public gem endpoints.
Changes:
- Introduces
gemini.gemsconfiguration (enablement, fetch behavior, hidden-gem inclusion, policy-gem settings). - Adds
PolicyGemSpec+sync_policy_gems()to upsert/deduplicate/cleanup server-managed policy gems. - Extends
GeminiClientWrapperto initialize gem cache and sync policy gems during client init, plus helper methods for gem lookup and CRUD.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| config/config.yaml | Adds gemini.gems settings to the default YAML config. |
| app/utils/config.py | Adds Pydantic models for gemini.gems and gemini.gems.policies runtime config. |
| app/services/policy_gems.py | New service implementing policy gem spec + sync/upsert/delete logic. |
| app/services/client.py | Initializes gem cache/policy gems on client init; adds gem helper APIs and locking. |
| README.md | Documents the new gemini.gems YAML snippet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
also tested speed and in order the operation fastest to slowest are delete,create,edit
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
i think now it is finished if you want to look into it @Nativu5 |
Summary
Context
I created an API similar to this before discovering the existence of this project, and I am now porting some of my features into it in incremental PRs.
Notes