-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize agents and chains #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oustanding job, @serras. I have only left one comment
"LLMAgent should return a prediction with just the output" { | ||
val template = "Tell me {foo}." | ||
either { | ||
val promptTemplate = PromptTemplate(template, listOf("foo")) | ||
val chain = LLMAgent(testLLM, promptTemplate, model) | ||
with (chain) { call(mapOf("foo" to "a joke")) } | ||
} shouldBeRight listOf("I'm not good at jokes") | ||
} | ||
|
||
"LLMAgent should return a prediction with both output and inputs" { | ||
val template = "Tell me {foo}." | ||
either { | ||
val prompt = PromptTemplate(template, listOf("foo")) | ||
val chain = LLMAgent(testLLM, prompt, model) | ||
with (chain) { call(mapOf("foo" to "a joke")) } | ||
} shouldBeRight listOf("I'm not good at jokes") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tests check the same thing, aren't they?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I've removed one
This PR moves into the direction of a simpler interface, but with the nice composition abilities from the DSL. In particular there are no more chains/agents/..., everything is an
Agent
, which should provide a function of the form.I've re-implemented the
prompt
functionality fromAIScope
into two newAgent
s, namelyLLMAgent
andDeserializerLLMAgent
(which just wraps the former with deserialization capabilities). As a result, theAIScope
is much more contained: it only calls other agents, but doesn't perform the calls to OpenAI itself. Note that barely any change was required in the examples, but we've gained the ability to useLLMAgent
as an agent incontext
.A side effect is that the entire
chains
package is gone: instead of creating aSequenceChain
, the idea is that developers will manipulate the passing of information between agents themselves.@raulraja @nomisRev @realdavidvega any feedback is welcome :)