Repository navigation
Replies: 1 comment
|
I wrote it like that because then the struct doesn't need to be put on the heap. However, the content of this chain can be large because it contains another chain. So the extra memory usage and time used coping the object every call might outweigh the time used to put it on the heap. The performance change is likely small, but I still think that changing it might be smart to increase consistency. Some chains might want to change their state in the call function and the llm chain constructor already returns a pointer. I also belive returning pointers in new functions is more normal in Go, but I am not sure. Changing this might be a good idea. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Folks,
I'm exploring to see if I can contribute. I see that a struct's function is implemented as a value receiver rather than a pointer receiver.
Illustration :
As I understand this will make every invocation of
Callwill copy theRetrievalQAobject.I'm not experienced in using
value pointerin past projects, if anyone can help to understand the reasoning behind this that would be really helpful.All reactions