public class KunLunWanWeiAIParser extends AbstractAIParser
Copyright (c) 2020 xsx All Rights Reserved. x-easypdf-pdfbox is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
AbstractAIParser.ImageContent, AbstractAIParser.ImageUrl, AbstractAIParser.Message, AbstractAIParser.TextContent
config, taskIdKey
document, log
Constructor and Description |
---|
KunLunWanWeiAIParser(Document document,
String ak,
String sk,
boolean isJsonResponse)
有参构造
|
Modifier and Type | Method and Description |
---|---|
protected com.alibaba.fastjson2.JSONObject |
getRequestBody(String model,
List<AbstractAIParser.Message> messages)
获取请求体
|
protected okhttp3.Headers |
getRequestHeaders()
获取请求头
|
protected com.alibaba.fastjson2.JSONObject |
getResponse(String url,
String model,
List<AbstractAIParser.Message> messages)
获取响应
|
protected String |
getSign(long timestamp)
获取签名
|
AIParseInfo |
parseImageWithPage(String prompt,
int pageIndex,
int imageIndex)
解析图像(页面中的图像)
|
AIParseInfo |
parsePageWithImage(String prompt,
int pageIndex)
解析页面(整个页面)
|
createImageMessageContents, createImageMessages, createTextMessages, getAuthorization, getPageImage, getPageImage, getPageText, getParseInfo, parseImageInfo, parseInfo, parseTexInfo, parseTextWithDocument, parseTextWithPage, setHttpClient, setImageModel, setImageSystemPrompt, setIsJsonResponse, setTextModel, setTextSystemPrompt
getDocument
public AIParseInfo parsePageWithImage(String prompt, int pageIndex)
注:访问大模型超时时间为1分钟
parsePageWithImage
in class AbstractAIParser
prompt
- 提示词pageIndex
- 页面索引public AIParseInfo parseImageWithPage(String prompt, int pageIndex, int imageIndex)
注:访问大模型超时时间为1分钟
parseImageWithPage
in class AbstractAIParser
prompt
- 提示词pageIndex
- 页面索引imageIndex
- 图像索引protected okhttp3.Headers getRequestHeaders()
getRequestHeaders
in class AbstractAIParser
protected com.alibaba.fastjson2.JSONObject getRequestBody(String model, List<AbstractAIParser.Message> messages)
getRequestBody
in class AbstractAIParser
model
- 模型messages
- 消息protected com.alibaba.fastjson2.JSONObject getResponse(String url, String model, List<AbstractAIParser.Message> messages)
getResponse
in class AbstractAIParser
url
- 地址model
- 模型messages
- 消息protected String getSign(long timestamp)
timestamp
- 时间戳Copyright © 2025. All rights reserved.