Skip to content
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

Drop transform throws NumberFormatException #549

Open
chrisjohnson16 opened this issue Oct 6, 2023 · 2 comments
Open

Drop transform throws NumberFormatException #549

chrisjohnson16 opened this issue Oct 6, 2023 · 2 comments

Comments

@chrisjohnson16
Copy link
Collaborator

When trying to drop messages that are output from the webcrawler agent the drop transform throws a NumberFormatException.

Example config that is dropping any message whose URL contains 'foo' anywhere in the string:

  - name: "Drop URLs"
    type: "drop"
    output: "drop-output-topic"
    configuration:
      when: "fn:contains(value.url, 'foo')"

This is the exception thrown:

ai.langstream.runtime.agent.AgentRunner$PermanentFailureException: java.lang.NumberFormatException: For input string: "url"
	at ai.langstream.runtime.agent.AgentRunner.lambda$runProcessorAgent$11(AgentRunner.java:828)
	at ai.langstream.runtime.agent.CompositeAgentProcessor.invokeProcessor(CompositeAgentProcessor.java:208)
	at ai.langstream.runtime.agent.CompositeAgentProcessor.process(CompositeAgentProcessor.java:225)
	at ai.langstream.api.runner.code.AgentCodeAndLoader$3.lambda$process$0(AgentCodeAndLoader.java:208)
	at ai.langstream.api.runner.code.AgentCodeAndLoader.executeNoExceptionWithContextClassloader(AgentCodeAndLoader.java:56)
	at ai.langstream.api.runner.code.AgentCodeAndLoader$3.process(AgentCodeAndLoader.java:207)
	at ai.langstream.runtime.agent.AgentRunner.runProcessorAgent(AgentRunner.java:790)
	at ai.langstream.runtime.agent.AgentRunner.runMainLoop(AgentRunner.java:602)
	at ai.langstream.runtime.agent.AgentRunner.runJavaAgent(AgentRunner.java:370)
	at ai.langstream.runtime.agent.AgentRunner.run(AgentRunner.java:179)
	at ai.langstream.runtime.agent.AgentRunner.runAgent(AgentRunner.java:118)
	at ai.langstream.runtime.tester.LocalApplicationRunner.lambda$executeAgentRunners$2(LocalApplicationRunner.java:210)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NumberFormatException: For input string: "url"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:668)
	at java.base/java.lang.Integer.parseInt(Integer.java:786)
	at jakarta.el.ArrayELResolver.coerce(ArrayELResolver.java:163)
	at jakarta.el.ArrayELResolver.getValue(ArrayELResolver.java:79)
	at jakarta.el.CompositeELResolver.getValue(CompositeELResolver.java:62)
	at org.apache.el.parser.AstValue.getValue(AstValue.java:169)
	at org.apache.el.parser.AstFunction.getValue(AstFunction.java:189)
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
	at ai.langstream.ai.agents.commons.jstl.JstlEvaluator.evaluate(JstlEvaluator.java:180)
	at ai.langstream.ai.agents.commons.jstl.predicate.JstlPredicate.test(JstlPredicate.java:41)
	at ai.langstream.ai.agents.commons.jstl.predicate.JstlPredicate.test(JstlPredicate.java:25)
	at ai.langstream.ai.agents.GenAIToolKitAgent.processStep(GenAIToolKitAgent.java:138)
	at ai.langstream.ai.agents.GenAIToolKitAgent.processRecord(GenAIToolKitAgent.java:117)
	at ai.langstream.ai.agents.GenAIToolKitAgent.process(GenAIToolKitAgent.java:93)
	at ai.langstream.api.runner.code.AgentCodeAndLoader$3.lambda$process$0(AgentCodeAndLoader.java:208)
	at ai.langstream.api.runner.code.AgentCodeAndLoader.executeNoExceptionWithContextClassloader(AgentCodeAndLoader.java:56)
	at ai.langstream.api.runner.code.AgentCodeAndLoader$3.process(AgentCodeAndLoader.java:207)
	at ai.langstream.runtime.agent.CompositeAgentProcessor.invokeProcessor(CompositeAgentProcessor.java:165)
@eolivelli
Copy link
Member

I am taking a look

@eolivelli
Copy link
Member

@chrisjohnson16 sorry for late reply.
I cannot reproduce the problem.

The stacktrace and the error don't match the configuration.

Can you please try to reproduce and provide more context ?

  • the pipeline
  • the input message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants