All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.langchain4j.runtime.tool.ToolInvoker Maven / Gradle / Ivy

There is a newer version: 0.21.0
Show newest version
package io.quarkiverse.langchain4j.runtime.tool;

import java.util.Map;

public interface ToolInvoker {

    MethodMetadata methodMetadata();

    Object invoke(Object tool, Object[] params) throws Exception;

    class MethodMetadata {

        private final boolean returnsVoid;
        private final Map nameToParamPosition;
        private final Integer memoryIdParamPosition;

        public MethodMetadata(boolean returnsVoid, Map nameToParamPosition,
                Integer memoryIdParamPosition) {
            this.returnsVoid = returnsVoid;
            this.nameToParamPosition = nameToParamPosition;
            this.memoryIdParamPosition = memoryIdParamPosition;
        }

        public boolean isReturnsVoid() {
            return returnsVoid;
        }

        public Map getNameToParamPosition() {
            return nameToParamPosition;
        }

        public Integer getMemoryIdParamPosition() {
            return memoryIdParamPosition;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy