| | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | public class KnowledgeBaseUtil { |
| | | private static String ACCESS_KEY_ID = "LTAI5tCyQRwhZ2eimxCFKbdq"; |
| | | private static String ACCESS_KEY_SECRET = "fs1mEwLXg2j9XuKJsFoW8ThQbJFqHl"; |
| | | private static String WORKSPACE_ID = "llm-4bcr09yfxlgz0b0t"; |
| | | private static String ENDPOINT = "bailian.cn-beijing.aliyuncs.com"; |
| | | public static final String ACCESS_KEY_ID = "LTAI5tCyQRwhZ2eimxCFKbdq"; |
| | | public static final String ACCESS_KEY_SECRET = "fs1mEwLXg2j9XuKJsFoW8ThQbJFqHl"; |
| | | public static final String WORKSPACE_ID = "llm-4bcr09yfxlgz0b0t"; |
| | | public static final String ENDPOINT = "bailian.cn-beijing.aliyuncs.com"; |
| | | |
| | | /** |
| | | * <b>description</b> : |
| | |
| | | * @throws Exception 当API调用失败或其他异常情况时抛出 |
| | | */ |
| | | public static String AddCategory(String categoryName, String parentCategoryId) throws Exception { |
| | | if (StrUtil.isBlank(parentCategoryId)){ |
| | | parentCategoryId = ""; |
| | | } |
| | | // 创建阿里云百炼客户端 |
| | | com.aliyun.bailian20231229.Client client = KnowledgeBaseUtil.createClient(); |
| | | // 构造添加分类请求参数 |