agent-config: update rust sdk to expose agent config#2825
Conversation
9fbc0b3 to
8c7ad7d
Compare
8c7ad7d to
3d171b4
Compare
|
|
||
| #[diagnostic::on_unimplemented( | ||
| message = "Only autoinjectable types are allowed to be annotated with the autoinject attribute. Supported\n\ | ||
| types are `golem_rust::agentic::Config`" |
There was a problem hiding this comment.
Question: is it not going to be confusing that we have to mark config parameters with autoinject, but we don't have to principals?
There was a problem hiding this comment.
The plan is to have the same for principal in 1.5 misc #2830.
This is just already partially implemented for config as I couldn't get the behavior I want otherwise.
| } | ||
|
|
||
| #[derive(ConfigSchema)] | ||
| #[allow(unused)] |
There was a problem hiding this comment.
Minor thing:
Will user always end up needing to write this unused thing? Isn't it actually used in the next few lines.?
There was a problem hiding this comment.
This is just related to the config fields not being used in the tests. No unused needed in real code.
24349f0 to
7fca5af
Compare
|
✅ All contributors have signed the CLA. |
|
I have read the CLA Document and I hereby sign the CLA |
resolves #2805
had to partially implement the discussed #[autoinject] parameter to make it behave the way I want.
Final syntax looks like this:
The rules here are as follows:
ConfigFieldtrait).ConfigSchematrait)There is a new AutoInjectable trait (currently only implemented for ConfigSchema, but should also be implemented for Principal), that should be used together with the autoinject annotation.
The annotation macros in the example above produce the following code: