Trying to understand the code; general questions #722
Unanswered
abhimanyupallavisudhir
asked this question in
Q&A
Replies: 0 comments
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.
-
I had been planning to write a similar library myself (for encyclopaedic article generation) and was pleasantly surprised when I saw that you guys had beaten me to it.
I'm looking through the code now -- with the intention of contributing code for my specific purposes -- I have a bunch of questions, which I'm documenting here and attempting to answer for myself as I go through them, but help would be appreciated on the unanswered ones!
Function
OK I see:
__call__
(the method Python calls by default when you try to use a Python class as a function) is defined at theChain
level, so all chains have the same implementation -- but it depends on_call
, which is defined differently for each subclass.apply
is just__call__
applied pointwise to a list of inputs.run
just removes the dict wrapping from the output of__call__
.generate
andpredict
are specifically methods for LLMchains.generate
operates on lists and returns an object of typeLLMResult
, which can contain metadata in addition to the result.predict
is the straightforward version.Style
Dev Tools & Setting up
This I figured out -- the virtual environment isn't activated by default. Codespaces has Poetry installed by default, so you just need to run
source .venv/bin/activate
.Beta Was this translation helpful? Give feedback.
All reactions