com.dingtalk.baymax.framework.sdk.mercury.agent.BaseOutputParser Maven / Gradle / Ivy
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);
}
}