prompty icon indicating copy to clipboard operation
prompty copied to clipboard

feature:.NET - support passing file and params as Attributes on a class def

Open rysweet opened this issue 9 months ago • 1 comments

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.

rysweet avatar Mar 13 '25 15:03 rysweet

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

rysweet avatar Mar 13 '25 19:03 rysweet