Replies: 4 comments 1 reply
-
Hi @gkfirst8, good idea!
|
Beta Was this translation helpful? Give feedback.
-
I'm working on a PR that will implement this for @SystemMessage & @Usermessage. During the implementation I also noticed @StructuredPrompt. Will look into that but do not want to bog-down this PR to much. So when this first PR finds your favour, I will also make one for @StructuredPrompt. |
Beta Was this translation helpful? Give feedback.
-
This is the PR created for this: #527 Looking forward to your review (and the merge 😉) |
Beta Was this translation helpful? Give feedback.
-
I did look into the I'd love to learn why they live apart so far. Or what I'm missing. Maybe we can share some 'core-code' from dev.langchain4j.service.DefaultAiServices like getPromptText(Method, String, String, String[], String) as that's static anyway? |
Beta Was this translation helpful? Give feedback.
-
It would be valuable to our team if we could specify a resource to read as a prompt-message. We use this technique for more things like SQL-queries. Makes reading and crafting these texts easier.
I would be happy to add this to the source via a PR but I thought let's test the waters first to see if more people would like this and how high the chance would be of the PR getting pulled.
It would work like this: where the annotation is read (eg. DefaultAiServices.prepareUserMessage) we could switch on available parameters to the annotation and read the resource specified (based on the methods-class using clazz.getResourceAsStream) in stead of using the provided text. (I do realize we could want to cache the resource reading when that becomes a bottleneck later)
What would you think? What would the names of the parameters to @SystemMessage & @Usermessage need to be? Something like "resource" or "resourceName"?
This is the code I could use to text resource:
Any suggestions in this area would be welcome too.
Beta Was this translation helpful? Give feedback.
All reactions