-
Notifications
You must be signed in to change notification settings - Fork 15
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
No Agent<A>
, only AI<A>
#78
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.
I really like it @serras! 🙌 Should we target it at my open PR, or should I close mine?
The more everything fits in the AI
DSL the better IMO, this all seems to compose together than what we had before. If we can introduce @javipacheco work here for building more complex prompts I think we've gotten a nice API for core.
I didn't realize I targeted |
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.
This is much nicer and simpler. I guess we had names and descriptions for agents, which with functions are gone, but those were only useful for logging purposes.
I tried to keep those by defining: interface Agent<A>: AI<A> {
val name: String
val description: String
}
fun agent<A>(name: String, val: String, block: AIScope.() -> A): Agent<A> but it was too hard for the compiler to figure out what was going on in several cases. In particular, it could no longer infer the type variables in |
I think now it's much better than before, looks more clean and also makes more sense. |
This PR goes one step further than #76 in removing the
Agent
abstraction altogether. "AI Agents" are now simply functions that use the shared "AI Scope". As you can see, no changes were needed in the examples.One side benefit of this is that
prompt
,image
, and so on, are no longer parts of theAIScope
class, they are just defined as simple extensions of it.Pinging @nomisRev @raulraja @realdavidvega for discussion
Note: the build breaks because I haven't updated the Scala code.