Open RiccardoRossi opened 1 week ago
Instead of Chatgpt I would use an API key to be able to do this in a more systematic manner. For some reason LLM are not good with JSON, see https://github.com/imaurer/awesome-llm-json
Well, the point here was to do the exercise of underdtanding how a schema woukd look like for a parameter of medium complexity like the one of amgcl
Do you think that the output wpuld look different domingo it in a different way?
Well, the point here was to do the exercise of underdtanding how a schema woukd look like for a parameter of medium complexity like the one of amgcl
Do you think that the output wpuld look different domingo it in a different way?
Not, it would look similar. I am just saying we have many many classes set via Parameters. So the ideal would be to do it in the most systematic manner, as it is not a complex task, but repetitive and tiresome.
well, first of all we need to decide if this is the way we want to pursue. (this is a poposal by @matekelemen), i expressed my concern about the verbosity, but it actually looks better than what i expected
As i understand the idea of @matekelemen and @pooyan-dadvand would be to have GetDefaults to eventually return a schema to validate against.
GetDefaults to eventually return a schema to validate against
Yes, this would eventually be one of the goals. It would have some other advantages as well:
Parameters
could outsource its input validation to the schema.nlohmann_json
(the third-party JSON lib we use in C++) supports schemas, so we don't have to add any additional dependencies.The obvious trade-offs are that
I must confess that I've never used JSON schemas before, and I've only heard about them from @Igarizza. Still, I think they have enough to offer to be worth the hassle. I say let's at least give them a shot.
Just to add that I agree with @matekelemen and I think we should tackle this gradually. Also I agree with @RiccardoRossi that we should first define what we want to put in the GetSpecification method before start populating them everywhere.
Description @matekelemen @pooyan-dadvand i am sitting at the airport and i did (with the help of chatgpt) the exercise of generating a json scheme for amgcl, adding the possible choices and the current defaults. Indeed it looks cleaner that i expected.
to be honest i am not 100% sure this schema is valid ... but i think it should be close enough