Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
1803590e
Commit
1803590e
authored
May 12, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:插件文件缺失异常
parent
b9852218
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
DocumentUnderstandIngFunction.java
...document_understanding/DocumentUnderstandIngFunction.java
+6
-0
ImageOCRFunction.java
...source/demand/ai/function/image_ocr/ImageOCRFunction.java
+6
-0
PdfToMDFunction.java
...ce/demand/ai/function/text_in_pdf2md/PdfToMDFunction.java
+5
-0
No files found.
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/document_understanding/DocumentUnderstandIngFunction.java
View file @
1803590e
...
@@ -58,6 +58,12 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
...
@@ -58,6 +58,12 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
return
result
;
return
result
;
}
}
JSONObject
jsonObject
=
JSON
.
parseObject
(
content
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
content
);
if
(!
jsonObject
.
containsKey
(
"question"
)
||
!
jsonObject
.
containsKey
(
"file_url"
)){
result
.
setFunctionResult
(
StringUtils
.
EMPTY
);
result
.
setPromptContent
(
StringUtils
.
EMPTY
);
return
result
;
}
String
question
=
jsonObject
.
getString
(
"question"
);
String
question
=
jsonObject
.
getString
(
"question"
);
String
fileUrl
=
jsonObject
.
getString
(
"file_url"
);
String
fileUrl
=
jsonObject
.
getString
(
"file_url"
);
File
file
=
DocumentLoad
.
downloadURLDocument
(
fileUrl
);
File
file
=
DocumentLoad
.
downloadURLDocument
(
fileUrl
);
...
...
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/image_ocr/ImageOCRFunction.java
View file @
1803590e
...
@@ -50,6 +50,12 @@ public class ImageOCRFunction extends AbstractLargeModelFunction {
...
@@ -50,6 +50,12 @@ public class ImageOCRFunction extends AbstractLargeModelFunction {
public
AbstractFunctionResult
<
String
>
doFunction
(
String
content
,
String
identifier
)
{
public
AbstractFunctionResult
<
String
>
doFunction
(
String
content
,
String
identifier
)
{
AbstractFunctionResult
<
String
>
result
=
new
AbstractFunctionResult
<>();
AbstractFunctionResult
<
String
>
result
=
new
AbstractFunctionResult
<>();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
if
(!
jsonObject
.
containsKey
(
"query"
)
||
!
jsonObject
.
containsKey
(
"image_url"
))
{
result
.
setPromptContent
(
content
);
result
.
setFunctionResult
(
content
);
return
result
;
}
Message
systemMessage
=
new
Message
();
Message
systemMessage
=
new
Message
();
systemMessage
.
setRole
(
MessageRoleConstant
.
system
);
systemMessage
.
setRole
(
MessageRoleConstant
.
system
);
...
...
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/text_in_pdf2md/PdfToMDFunction.java
View file @
1803590e
...
@@ -43,6 +43,11 @@ public class PdfToMDFunction extends AbstractLargeModelFunction {
...
@@ -43,6 +43,11 @@ public class PdfToMDFunction extends AbstractLargeModelFunction {
public
AbstractFunctionResult
<
String
>
doFunction
(
String
content
,
String
identifier
)
{
public
AbstractFunctionResult
<
String
>
doFunction
(
String
content
,
String
identifier
)
{
AbstractFunctionResult
<
String
>
result
=
new
AbstractFunctionResult
<
String
>();
AbstractFunctionResult
<
String
>
result
=
new
AbstractFunctionResult
<
String
>();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
content
);
if
(!
jsonObject
.
containsKey
(
"file_url"
))
{
result
.
setPromptContent
(
content
);
result
.
setFunctionResult
(
content
);
return
result
;
}
String
url
=
jsonObject
.
getString
(
"file_url"
);
String
url
=
jsonObject
.
getString
(
"file_url"
);
byte
[]
fileContent
=
url
.
getBytes
(
StandardCharsets
.
UTF_8
);
byte
[]
fileContent
=
url
.
getBytes
(
StandardCharsets
.
UTF_8
);
HashMap
<
String
,
Object
>
options
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
options
=
new
HashMap
<>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment