prompty
prompty copied to clipboard
feature:.NET - support passing file and params as Attributes on a class def
In .NET it is idiomatic to have tools like Prompty injected with custom attributes.
If you have a custom attribute for Prompty you could do something like:
csharp
using Prompty.Core
...
[Prompty (File="/some/path", Params[], etc]
public MyClass () {...}
Then when referencing MyClass:
csharp
...
var prompty = myClass.GetCustomAttributes<PromptyAttribute>().Prompt
# or
var system = myClass.GetCustomAttributes<PromptyAttribute>().Messages.system
....
draft PR for discussion will be inbound.
scenario: as a developper I want to associate a prompt file with a class or method so that I can...
conveniently reference those prompts from within my code while maintaining prompts separately from code.
alt
the attribute syntax is an easy way to associate external resources with a class or method in an easy to read syntax