Open zonadevlab opened 1 month ago
can you please elaborate on what prompt you are trying to test? it looks like its trying to match prompt to action but not finding mapping action
I tried sooo very many things. I was able to get it to work though, not this one but a Tools4AI version. So I don't know exactly where I went wrong on this one unfortunately, but odds are the error was on my end. Is there a way to code this to where it can set the actions on the fly, or be more dynamic and fluid where I might not know ahead of time the universe of options. Like https://github.com/frdel/agent-zero
there are various options to set or predict actions please look at java docs here https://javadoc.io/doc/io.github.vishalmysore/tools4ai/latest/com/t4a/processor/AIProcessor.html
1) processSingleAction(String promptText)
The above method will trigger the action just based on prompt , you dont need to specify anything other than the prompt , it will predict based on LLM inference
2)processSingleAction(String promptText, Object actionInstance)
This method will call the action specified as actionIstance, it will map the parameters automatically
I have written an article describing how to build and autonomous agent here https://www.linkedin.com/pulse/enterprise-ai-hub-llm-agent-built-openai-java-vishal-mysore-0p7oc/?trackingId=qE91gQ%2Bngtn4vI45pxJEgg%3D%3D
Can you please let me know what prompt are you providing and where are you getting this exception
I can't get that one to load. This is my 25th version of it, and typical of how this has been going because changing out any action causes 3 other things to break. It's likely because I'm not familiar with java, because there has to be an easier way to swap actions than manually changing pom.....
[INFO] Installing /new/Tools4AI/target/tools4ai-1.0.4-jar-with-dependencies.jar to /repository/io/github/vishalmysore/tools4ai/1.0.4/tools4ai-1.0.4-jar-with-dependencies.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 50.138 s [INFO] Finished at: 2024-08-13T03:09:06Z [INFO] ------------------------------------------------------------------------ ~/new/Tools4AI java -jar target/tools4ai-1.0.4-jar-with-dependencies.jar Error: Could not find or load main class processor.AIProcessor Caused by: java.lang.ClassNotFoundException: processor.AIProcessor ~/new/Tools4AI
and others. delicate
Do you have additional instructions or installation options? I've tried multiple ways to fix the below error but every way just ends up breaking something else -
Aug 11, 2024 1:16:18 AM com.t4a.predict.ShellPredictionLoader loadYamlFile INFO: Group Name: Employee Actions Aug 11, 2024 1:16:18 AM com.t4a.predict.ShellPredictionLoader loadYamlFile INFO: Description: This is actions for all the new employees Aug 11, 2024 1:16:18 AM com.t4a.predict.ShellPredictionLoader loadYamlFile INFO: Group Name: Enterprise Actions Aug 11, 2024 1:16:18 AM com.t4a.predict.ShellPredictionLoader loadYamlFile INFO: Description: This is actions for all the new enterprise related applications Please make sure actions are configured Cannot invoke "String.trim()" because the return value of "java.util.Map.get(Object)" is null Details java.lang.NullPointerException: Cannot invoke "String.trim()" because the return value of "java.util.Map.get(Object)" is null at com.t4a.predict.PredictionLoader.getPredictedAction(PredictionLoader.java:310) at com.t4a.processor.GeminiV2ActionProcessor.processSingleAction(GeminiV2ActionProcessor.java:59) at com.t4a.processor.GeminiV2ActionProcessor.processSingleAction(GeminiV2ActionProcessor.java:44) at com.t4a.processor.GeminiV2ActionProcessor.processSingleAction(GeminiV2ActionProcessor.java:134) at org.example.GeminiActionExample.main(GeminiActionExample.java:23) Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.t4a.api.AIAction.getActionRisk()" because "action" is null at com.t4a.processor.GeminiV2ActionProcessor.processSingleAction(GeminiV2ActionProcessor.java:60) at com.t4a.processor.GeminiV2ActionProcessor.processSingleAction(GeminiV2ActionProcessor.java:44) at com.t4a.processor.GeminiV2ActionProcessor.processSingleAction(GeminiV2ActionProcessor.java:134) at org.example.GeminiActionExample.main(GeminiActionExample.java:23)