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

com.dingtalk.baymax.framework.sdk.mercury.agent.BaseOutputParser Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.dingtalk.baymax.framework.sdk.mercury.agent;

import com.dingtalk.baymax.framework.sdk.mercury.prompt.PromptValue;

/**
 * 解析LLM调用输出的类
 *
 * @param 
 */
public abstract class BaseOutputParser {

    /**
     * 关于如何格式化 LLM 输出的说明
     *
     * @return
     */
    public abstract String getFormatInstructions();

    /**
     * 返回类型键
     *
     * @return
     */
    public abstract String getParserType();

    /**
     * 解析LLM调用的输出
     *
     * @param text
     * @return
     */
    public abstract T parse(String text);

    public Object parseWithPrompt(String completion, PromptValue prompt) {
        return parse(completion);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy