-
Notifications
You must be signed in to change notification settings - Fork 49
Added AgenticServices helper #835
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
base: main
Are you sure you want to change the base?
Conversation
2401aa7
to
61bd518
Compare
.outputName("story") | ||
.build()); | ||
spy( | ||
dev.langchain4j.agentic.AgenticServices.agentBuilder(CreativeWriter.class) |
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.
We can drop the FQCN
} | ||
} | ||
|
||
private static class AgentInvocationHandler implements InvocationHandler { |
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 think we already have something pretty similar on the agentic-langchain4j
module. Is it doable to share the same class?
21fa658
to
bfec4eb
Compare
experimental/lambda/src/main/java/io/serverlessworkflow/impl/executors/func/JavaFuncUtils.java
Outdated
Show resolved
Hide resolved
...mental/lambda/src/main/java/io/serverlessworkflow/impl/expressions/func/HasAgenticScope.java
Outdated
Show resolved
Hide resolved
bfec4eb
to
18e031d
Compare
Signed-off-by: Dmitrii Tikhomirov <[email protected]>
18e031d
to
0089734
Compare
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.
It's getting pretty neat!
CreativeWriter creativeWriter = | ||
spy( | ||
AgenticServices.agentBuilder(CreativeWriter.class) | ||
dev.langchain4j.agentic.AgenticServices.agentBuilder(CreativeWriter.class) |
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.
We should remove the FQCN
var styleEditor = newStyleEditor(); | ||
|
||
AgentsUtils.NovelCreator novelCreator = | ||
io.serverlessworkflow.fluent.agentic.AgenticServices.of(AgentsUtils.NovelCreator.class) |
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.
There are a few places with FQCN.
AgentsUtils.NovelCreator novelCreator = | ||
io.serverlessworkflow.fluent.agentic.AgenticServices.of(AgentsUtils.NovelCreator.class) | ||
.flow(workflow("seqFlow").agent(creativeWriter).sequence(audienceEditor, styleEditor)) | ||
.build(); |
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 DSL is looking pretty cool. We should do the same for FuncWorkflowBuilder
, which is the one we are using on quarkus-flow
next.
.flow( | ||
workflow("humanInTheLoop") | ||
.inputFrom(askSign) | ||
// .tasks(tasks -> tasks.callFn(fn(askSign))) // TODO should work too |
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.
Can you open an issue to track this?
} | ||
} | ||
|
||
private class AgentInvocationHandler implements InvocationHandler { |
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 class is similar to this one: https://github.com/serverlessworkflow/sdk-java/blob/main/experimental/fluent/agentic-langchain4j/src/main/java/io/serverlessworkflow/fluent/agentic/langchain4j/WorkflowInvocationHandler.java#L37
We should bring them together.
No description provided.