PromptCallbacks design #73
kindermannhubert
started this conversation in
General
Replies: 2 comments
-
Agreed! Let's make the change in this next release. The callbacks approach was OK when there were just a few, but I think it's time to go with a class / override approach like you've described. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Done via #87. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After making some changes to
PromptCallbacks
I think it would be nicer to replace these callbacks with virtual methods.CompletionCallbackAsync
).The current approach is simpler for "toy" applications because you can just set some lambdas to instance of existing
PromptCallbacks
. But for anything more complex it's an unnecessary hassle to have everything needed in delegate closures.With the new approach, you would need to implement custom class inheriting
PromptCallbacks
and override methods that you wish.(2) and (3) can be nicely seen on
PromptCallbacks.SpanToReplaceByCompletionCallback
.Instead of:
we could just have:
We could even use the same name for nonvirtual public and virtual protected methods with use of (possibly internal) interface:
Also, it would probably be a good time to do such a change now when we have already a lot of breaking changes for upcoming release.
Any thoughts @waf?
Beta Was this translation helpful? Give feedback.
All reactions