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
1e875b92
Commit
1e875b92
authored
Jan 16, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:微博热搜插件
parent
67ac952e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
1563 additions
and
0 deletions
+1563
-0
LargeModelFunctionEnum.java
...y/resource/demand/ai/function/LargeModelFunctionEnum.java
+2
-0
WeiboTopSearchFunction.java
...demand/ai/function/top_search/WeiboTopSearchFunction.java
+59
-0
TianApi.java
...va/cn/com/poc/thirdparty/resource/tianju/api/TianApi.java
+292
-0
TianBaseApi.java
...n/com/poc/thirdparty/resource/tianju/api/TianBaseApi.java
+101
-0
TianApiErrorCodeEnum.java
...ty/resource/tianju/api/constant/TianApiErrorCodeEnum.java
+41
-0
TianHotTopConstant.java
...arty/resource/tianju/api/constant/TianHotTopConstant.java
+43
-0
TianNewsChannelEnum.java
...rty/resource/tianju/api/constant/TianNewsChannelEnum.java
+61
-0
TianNewsSortConstant.java
...ty/resource/tianju/api/constant/TianNewsSortConstant.java
+19
-0
TianBaiduTopSearch.java
...dparty/resource/tianju/api/entity/TianBaiduTopSearch.java
+64
-0
TianBaiduTopSearchList.java
...ty/resource/tianju/api/entity/TianBaiduTopSearchList.java
+12
-0
TianCommonResult.java
...irdparty/resource/tianju/api/entity/TianCommonResult.java
+51
-0
TianDouyinTopSearch.java
...party/resource/tianju/api/entity/TianDouyinTopSearch.java
+48
-0
TianDouyinTopSearchList.java
...y/resource/tianju/api/entity/TianDouyinTopSearchList.java
+9
-0
TianNetworkTopSearch.java
...arty/resource/tianju/api/entity/TianNetworkTopSearch.java
+48
-0
TianNetworkTopSearchList.java
.../resource/tianju/api/entity/TianNetworkTopSearchList.java
+9
-0
TianNewsChannel.java
...hirdparty/resource/tianju/api/entity/TianNewsChannel.java
+42
-0
TianNewsSortRequest.java
...party/resource/tianju/api/entity/TianNewsSortRequest.java
+85
-0
TianNewsSortSearch.java
...dparty/resource/tianju/api/entity/TianNewsSortSearch.java
+100
-0
TianNewsSortSearchList.java
...ty/resource/tianju/api/entity/TianNewsSortSearchList.java
+9
-0
TianResult.java
...poc/thirdparty/resource/tianju/api/entity/TianResult.java
+64
-0
TianToutiaoTopSearch.java
...arty/resource/tianju/api/entity/TianToutiaoTopSearch.java
+36
-0
TianToutiaoTopSearchList.java
.../resource/tianju/api/entity/TianToutiaoTopSearchList.java
+10
-0
TianWeiboTopSearch.java
...dparty/resource/tianju/api/entity/TianWeiboTopSearch.java
+48
-0
TianWeiboTopSearchList.java
...ty/resource/tianju/api/entity/TianWeiboTopSearchList.java
+9
-0
TianWxNewRequest.java
...irdparty/resource/tianju/api/entity/TianWxNewRequest.java
+58
-0
TianWxNewSearch.java
...hirdparty/resource/tianju/api/entity/TianWxNewSearch.java
+140
-0
TianWxNewSearchList.java
...party/resource/tianju/api/entity/TianWxNewSearchList.java
+9
-0
TianWxTopSearch.java
...hirdparty/resource/tianju/api/entity/TianWxTopSearch.java
+35
-0
TianWxTopSearchList.java
...party/resource/tianju/api/entity/TianWxTopSearchList.java
+9
-0
Usage.java
.../com/poc/thirdparty/resource/tianju/api/entity/Usage.java
+32
-0
ImageOCRFunctionTest.java
...rty/resource/demand/ai/function/ImageOCRFunctionTest.java
+18
-0
No files found.
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/LargeModelFunctionEnum.java
View file @
1e875b92
...
...
@@ -7,6 +7,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.html_reader.HtmlReaderF
import
cn.com.poc.thirdparty.resource.demand.ai.function.image_ocr.ImageOCRFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.SetLongMemoryFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.memory_variable_writer.MemoryVariableWriterFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.top_search.WeiboTopSearchFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.web_seach.WebSearchFunction
;
public
enum
LargeModelFunctionEnum
{
...
...
@@ -18,6 +19,7 @@ public enum LargeModelFunctionEnum {
web_search
(
WebSearchFunction
.
class
),
image_ocr
(
ImageOCRFunction
.
class
),
weibo_search_top
(
WeiboTopSearchFunction
.
class
),
bing_web_search
(
null
),
...
...
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/top_search/WeiboTopSearchFunction.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
demand
.
ai
.
function
.
top_search
;
import
cn.com.poc.agent_application.entity.Variable
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.AbstractLargeModelFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.entity.FunctionLLMConfig
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.entity.Parameters
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.entity.Properties
;
import
cn.com.poc.thirdparty.resource.tianju.api.TianApi
;
import
cn.com.poc.thirdparty.resource.tianju.api.entity.TianCommonResult
;
import
cn.com.poc.thirdparty.resource.tianju.api.entity.TianResult
;
import
cn.com.poc.thirdparty.resource.tianju.api.entity.TianWeiboTopSearch
;
import
cn.hutool.core.collection.ListUtil
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* @author alex.yao
* @date 2025/1/16
*/
@Component
public
class
WeiboTopSearchFunction
extends
AbstractLargeModelFunction
{
private
final
String
DESC
=
"该方法获取今天微博的热点信息"
;
private
final
FunctionLLMConfig
functionLLMConfig
=
new
FunctionLLMConfig
.
FunctionLLMConfigBuilder
()
.
name
(
"weibo_search_top"
)
.
description
(
DESC
)
// .parameters(new Parameters("object").addProperties("content", new Properties("string", "内容的详细说明")))
.
build
();
@Resource
private
TianApi
tianApi
;
@Override
public
String
doFunction
(
String
content
,
String
identifier
)
{
TianCommonResult
<
TianWeiboTopSearch
>
weiboTopSearch
=
tianApi
.
getWeiboTopSearch
();
TianResult
<
TianWeiboTopSearch
>
result
=
weiboTopSearch
.
getResult
();
List
<
TianWeiboTopSearch
>
list
=
result
.
getList
();
return
JsonUtils
.
serialize
(
list
);
}
@Override
public
String
getDesc
()
{
return
DESC
;
}
@Override
public
List
<
String
>
getLLMConfig
()
{
return
ListUtil
.
toList
(
JsonUtils
.
serialize
(
functionLLMConfig
));
}
@Override
public
List
<
String
>
getLLMConfig
(
List
<
Variable
>
variableStructure
)
{
return
getLLMConfig
();
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/TianApi.java
0 → 100644
View file @
1e875b92
This diff is collapsed.
Click to expand it.
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/TianBaseApi.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
;
import
org.apache.http.Header
;
import
org.apache.http.HttpHeaders
;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.message.BasicHeader
;
/**
* 天聚基础API
*/
public
interface
TianBaseApi
{
/**
* 基础地址
*/
String
BASE_API
=
"https://apis.tianapi.com/"
;
/**
* 百度热搜榜
*/
String
BAIDU_TOP_SEARCH
=
BASE_API
+
"nethot/index"
;
/**
* 头条热搜榜
*/
String
TOUTIAO_TOP_SEARCH
=
BASE_API
+
"toutiaohot/index"
;
/**
* 抖音热搜榜
*/
String
DOUYIN_TOP_SEARCH
=
BASE_API
+
"douyinhot/index"
;
/**
* 微博热搜榜
*/
String
WEIBO_TOP_SEARCH
=
BASE_API
+
"weibohot/index"
;
/**
* 全网热搜榜
*/
String
NETWORK_TOP_SEARCH
=
BASE_API
+
"networkhot/index"
;
/**
* 微信热搜榜
*/
String
WX_TOP_SEARCH
=
BASE_API
+
"wxhottopic/index"
;
/**
* 今日头条热门新闻
*/
String
TOUTIAO_TOP_NEWS_SEARCH
=
BASE_API
+
"topnews/index"
;
/**
* 微信文章精选
*/
String
WX_NEW_SEARCH
=
BASE_API
+
"wxnew/index"
;
/**
* 分类新闻
*/
String
ALLNEWS_SEARCH
=
BASE_API
+
"allnews/index"
;
/**
* key参数
*/
String
KEY
=
"key"
;
String
KEY_SITE
=
"tianju.key"
;
/**
* num参数
*/
String
NUM
=
"num"
;
/**
* col参数
*/
String
COL
=
"col"
;
/**
* rand参数
*/
String
RAND
=
"rand"
;
/**
* word参数
*/
String
WORD
=
"word"
;
/**
* page参数
*/
String
PAGE
=
"page"
;
/**
* 通用头信息
*/
Header
urlencodedHeader
=
new
BasicHeader
(
HttpHeaders
.
CONTENT_TYPE
,
ContentType
.
APPLICATION_FORM_URLENCODED
.
toString
());
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/constant/TianApiErrorCodeEnum.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
constant
;
/**
* 天聚api请求错误状态码枚举
*/
public
enum
TianApiErrorCodeEnum
{
SERVER_ERROR
(
100
,
"内部服务器错误"
),
API_IS_OFFLINE
(
110
,
"当前API已下线"
),
API_IS_MAINTENANCE
(
120
,
"API暂时维护中"
),
API_CALL_OUT_LIMIT
(
130
,
"API调用超限"
),
API_NOT_HAVE_CALL_PERMISSION
(
140
,
"API没有调用权限"
),
API_NOT_ENOUGH_AVAILABLE
(
150
,
"API可用次数不足"
),
ACCOUNT_NOT_SUBSCRIBED_API
(
160
,
"账号未申请该API"
),
REFERER_REQUEST_LIMITED
(
170
,
"Referer请求来源受限"
),
IP_REQUEST_LIMITED
(
180
,
"IP请求来源受限"
),
KEY_NOT_AVAILABLE
(
190
,
"当前key不可用"
),
KEY_WRONG_OR_EMPTY
(
230
,
"key错误或为空"
),
KEY_MISSING_PARAMETER
(
240
,
"缺少key参数"
),
DATA_RETURN_EMPTY
(
250
,
"数据返回为空"
),
PARAMETER_NOT_BE_EMPTY
(
260
,
"参数值不得为空"
),
PARAMETER_NOT_MEET_REQUIREMENT
(
270
,
"参数值不符合要求"
),
MISSING_NECESSARY_PARAMETER
(
280
,
"缺少必要的参数"
),
EXCEED_INPUT_LIMIT
(
290
,
"超过最大输入限制"
);
private
final
Integer
errorCode
;
private
final
String
errorMessage
;
TianApiErrorCodeEnum
(
Integer
errorCode
,
String
errorMessage
){
this
.
errorCode
=
errorCode
;
this
.
errorMessage
=
errorMessage
;
}
public
Integer
getErrorCode
()
{
return
errorCode
;
}
public
String
getErrorMessage
()
{
return
errorMessage
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/constant/TianHotTopConstant.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
constant
;
/**
* @author Leon Liu
* @create 2024/4/19 17:19
*/
public
interface
TianHotTopConstant
{
/**
* 百度
*/
String
BAIDU
=
"Baidu"
;
/**
* 今日头条
*/
String
TOUTIAO
=
"Toutiao"
;
/**
* 抖音
*/
String
DOUYIN
=
"Douyin"
;
/**
* 微博
*/
String
WEIBO
=
"Weibo"
;
/**
* 微信
*/
String
WX
=
"Wx"
;
/**
* 全网
*/
String
NETWORK
=
"Network"
;
/**
* 微信文章精选
*/
String
WX_NEW
=
"WX_NEW"
;
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/constant/TianNewsChannelEnum.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
constant
;
/**
* 新闻频道分类枚举
*/
public
enum
TianNewsChannelEnum
{
PET_NEWS
(
46
,
"宠物"
,
"N"
),
ELECTRONIC_SPORTS_NEWS
(
45
,
"电竞"
,
"N"
),
FEMALE_NEWS
(
43
,
"女性"
,
"Y"
),
GARBAGE_CLASSIFICATION_NEWS
(
42
,
"垃圾分类"
,
"N"
),
ENVIRONMENTAL_PROTECTION_NEWS
(
41
,
"环保"
,
"N"
),
FILM_TELEVISION_NEWS
(
40
,
"影视"
,
"Y"
),
HANFU_NEWS
(
38
,
"汉服"
,
"N"
),
SCIENCE_EXPLORATION_NEWS
(
36
,
"科学探索"
,
"Y"
),
CARS_NEWS
(
35
,
"汽车"
,
"Y"
),
INTERNET_NEWS
(
34
,
"互联网"
,
"Y"
),
ANIMATION_NEWS
(
33
,
"动漫"
,
"Y"
),
FINANCE_ECONOMICS_NEWS
(
32
,
"财经"
,
"Y"
),
GAME_NEWS
(
31
,
"游戏"
,
"Y"
),
CBA_NEWS
(
30
,
"CBA"
,
"Y"
),
ARTIFICIAL_INTELLIGENCE_NEWS
(
29
,
"人工智能"
,
"Y"
),
MILITARY_AFFAIRS
(
27
,
"军事"
,
"Y"
),
FOOTBALL_NEWS
(
26
,
"足球"
,
"N"
),
START_BUSINESS_NEWS
(
24
,
"创业"
,
"Y"
),
IT_NEWS
(
22
,
"IT"
,
"Y"
),
VR_NEWS
(
21
,
"VR"
,
"N"
),
NBA_NEWS
(
20
,
"NBA"
,
"N"
),
APPLE_NEWS
(
19
,
"苹果"
,
"N"
),
TRAVEL_NEWS
(
18
,
"旅游"
,
"Y"
),
HEALTH_KNOWLEDGE
(
17
,
"健康知识"
,
"Y"
),
SCIENCE_NEWS
(
13
,
"科学"
,
"N"
),
SPORTS_NEWS
(
12
,
"体育"
,
"Y"
),
RECREATION_NEWS
(
10
,
"娱乐"
,
"Y"
),
INTERNATION_NEWS
(
8
,
"国际"
,
"Y"
),
INTERNAL_NEWS
(
7
,
"国内"
,
"N"
),
SOCIETY_NEWS
(
5
,
"社会"
,
"Y"
);
private
final
Integer
id
;
private
final
String
newType
;
private
final
String
isShow
;
TianNewsChannelEnum
(
Integer
id
,
String
newType
,
String
isShow
)
{
this
.
id
=
id
;
this
.
newType
=
newType
;
this
.
isShow
=
isShow
;
}
public
Integer
getId
()
{
return
id
;
}
public
String
getNewType
()
{
return
newType
;
}
public
String
getIsShow
()
{
return
isShow
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/constant/TianNewsSortConstant.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
constant
;
/**
* @Author: Leon Liu
* @Description:
* @Date: 2024/4/25 11:39
*/
public
interface
TianNewsSortConstant
{
/**
* 随机获取 true
*/
String
RAND_TRUE
=
"1"
;
/**
* 随机获取 false
*/
String
RAND_FALSE
=
"0"
;
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianBaiduTopSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Zackery
* @Description:
* @Date: 2024/4/16 11:14
*/
public
class
TianBaiduTopSearch
implements
Serializable
{
/**
* 热搜话题
*/
private
String
keyword
;
/**
* 简介描述
*/
private
String
brief
;
/**
* 热搜指数
*/
private
String
index
;
/**
* 发展趋势
*/
private
String
trend
;
public
String
getKeyword
()
{
return
keyword
;
}
public
void
setKeyword
(
String
keyword
)
{
this
.
keyword
=
keyword
;
}
public
String
getBrief
()
{
return
brief
;
}
public
void
setBrief
(
String
brief
)
{
this
.
brief
=
brief
;
}
public
String
getIndex
()
{
return
index
;
}
public
void
setIndex
(
String
index
)
{
this
.
index
=
index
;
}
public
String
getTrend
()
{
return
trend
;
}
public
void
setTrend
(
String
trend
)
{
this
.
trend
=
trend
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianBaiduTopSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Zackery
* @Description: 天聚百度热搜榜list字段数据
* @Date: 2024/4/16 12:13
*/
public
class
TianBaiduTopSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianCommonResult.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Zackery
* @Description: 天聚通用响应实体
* @Date: 2024/4/16 11:08
*/
public
class
TianCommonResult
<
T
>
implements
Serializable
{
/**
* 状态码
*/
private
Integer
code
;
/**
* 错误信息
*/
private
String
msg
;
/**
* 具体数据
*/
private
TianResult
<
T
>
result
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
TianResult
<
T
>
getResult
()
{
return
result
;
}
public
void
setResult
(
TianResult
<
T
>
result
)
{
this
.
result
=
result
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianDouyinTopSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/16 16:45
*/
public
class
TianDouyinTopSearch
implements
Serializable
{
/**
* 热搜榜指数
*/
private
Integer
hotindex
;
/**
* 标签类型,1新,2荐,3热
*/
private
Integer
label
;
/**
* 热点话题
*/
private
String
word
;
public
Integer
getHotindex
()
{
return
hotindex
;
}
public
void
setHotindex
(
Integer
hotindex
)
{
this
.
hotindex
=
hotindex
;
}
public
Integer
getLabel
()
{
return
label
;
}
public
void
setLabel
(
Integer
label
)
{
this
.
label
=
label
;
}
public
String
getWord
()
{
return
word
;
}
public
void
setWord
(
String
word
)
{
this
.
word
=
word
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianDouyinTopSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚抖音热搜榜list字段数据
* @Date: 2024/4/16 16:50
*/
public
class
TianDouyinTopSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianNetworkTopSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/16 17:20
*/
public
class
TianNetworkTopSearch
implements
Serializable
{
/**
* 热搜榜指数
*/
private
String
title
;
/**
* 热搜话题
*/
private
Integer
hotnum
;
/**
* 话题简介(可能为空)
*/
private
String
digest
;
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getHotnum
()
{
return
hotnum
;
}
public
void
setHotnum
(
Integer
hotnum
)
{
this
.
hotnum
=
hotnum
;
}
public
String
getDigest
()
{
return
digest
;
}
public
void
setDigest
(
String
digest
)
{
this
.
digest
=
digest
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianNetworkTopSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚全网热搜榜list字段数据
* @Date: 2024/4/16 17:25
*/
public
class
TianNetworkTopSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianNewsChannel.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description:
* @Date: 2024/4/18 14:22
*/
public
class
TianNewsChannel
{
/**
* 新闻频道ID
*/
private
Integer
id
;
/**
* 新闻类型
*/
private
String
newsType
;
public
TianNewsChannel
(
Integer
id
,
String
newsType
)
{
this
.
id
=
id
;
this
.
newsType
=
newsType
;
}
public
TianNewsChannel
()
{
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getNewsType
()
{
return
newsType
;
}
public
void
setNewsType
(
String
newsType
)
{
this
.
newsType
=
newsType
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianNewsSortRequest.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/17 15:54
*/
public
class
TianNewsSortRequest
implements
Serializable
{
/**
* 返回数量1-50 (必需)
*/
private
Integer
num
;
/**
* 新闻频道对应的ID (必需)
*/
private
Integer
col
;
/**
* 翻页
*/
private
Integer
page
;
/**
* 随机获取
*/
private
Integer
rand
;
/**
* 检索关键词
*/
private
String
word
;
public
TianNewsSortRequest
(
Integer
num
,
Integer
col
,
Integer
page
,
Integer
rand
,
String
word
)
{
this
.
num
=
num
;
this
.
col
=
col
;
this
.
page
=
page
;
this
.
rand
=
rand
;
this
.
word
=
word
;
}
public
TianNewsSortRequest
()
{
}
public
Integer
getNum
()
{
return
num
;
}
public
void
setNum
(
Integer
num
)
{
this
.
num
=
num
;
}
public
Integer
getCol
()
{
return
col
;
}
public
void
setCol
(
Integer
col
)
{
this
.
col
=
col
;
}
public
Integer
getPage
()
{
return
page
;
}
public
void
setPage
(
Integer
page
)
{
this
.
page
=
page
;
}
public
Integer
getRand
()
{
return
rand
;
}
public
void
setRand
(
Integer
rand
)
{
this
.
rand
=
rand
;
}
public
String
getWord
()
{
return
word
;
}
public
void
setWord
(
String
word
)
{
this
.
word
=
word
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianNewsSortSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/17 15:44
*/
public
class
TianNewsSortSearch
implements
Serializable
{
/**
* 新闻唯一ID
*/
private
String
id
;
/**
* 发布时间
*/
private
String
ctime
;
/**
* 文章标题
*/
private
String
title
;
/**
* 文章描述
*/
private
String
description
;
/**
* 文章来源
*/
private
String
source
;
/**
* 封面图片
*/
private
String
picUrl
;
/**
* 文章地址
*/
private
String
url
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getCtime
()
{
return
ctime
;
}
public
void
setCtime
(
String
ctime
)
{
this
.
ctime
=
ctime
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getSource
()
{
return
source
;
}
public
void
setSource
(
String
source
)
{
this
.
source
=
source
;
}
public
String
getPicUrl
()
{
return
picUrl
;
}
public
void
setPicUrl
(
String
picUrl
)
{
this
.
picUrl
=
picUrl
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianNewsSortSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚分类新闻list字段数据
* @Date: 2024/4/17 15:49
*/
public
class
TianNewsSortSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianResult.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Author: Zackery
* @Description: 天聚热搜榜公用响应result字段
* @Date: 2024/4/16 12:17
*/
public
class
TianResult
<
T
>
implements
Serializable
{
/**
* 数据列表
*/
private
List
<
T
>
list
;
/**
* 新闻分类数据列表
*/
private
List
<
T
>
newslist
;
/**
* 当前页数
*/
private
Integer
curpage
;
/**
* 数据个数
*/
private
Integer
allnum
;
public
List
<
T
>
getList
()
{
return
list
;
}
public
void
setList
(
List
<
T
>
list
)
{
this
.
list
=
list
;
}
public
List
<
T
>
getNewslist
()
{
return
newslist
;
}
public
void
setNewslist
(
List
<
T
>
newslist
)
{
this
.
newslist
=
newslist
;
}
public
Integer
getCurpage
()
{
return
curpage
;
}
public
void
setCurpage
(
Integer
curpage
)
{
this
.
curpage
=
curpage
;
}
public
Integer
getAllnum
()
{
return
allnum
;
}
public
void
setAllnum
(
Integer
allnum
)
{
this
.
allnum
=
allnum
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianToutiaoTopSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/16 15:18
*/
public
class
TianToutiaoTopSearch
implements
Serializable
{
/**
* 热搜榜指数
*/
private
Integer
hotindex
;
/**
* 热点话题
*/
private
String
word
;
public
Integer
getHotindex
()
{
return
hotindex
;
}
public
void
setHotindex
(
Integer
hotindex
)
{
this
.
hotindex
=
hotindex
;
}
public
String
getWord
()
{
return
word
;
}
public
void
setWord
(
String
word
)
{
this
.
word
=
word
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianToutiaoTopSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚头条热搜榜list字段数据
* @Date: 2024/4/16 15:27
*/
public
class
TianToutiaoTopSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWeiboTopSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/16 17:07
*/
public
class
TianWeiboTopSearch
implements
Serializable
{
/**
* 热搜话题
*/
private
String
hotword
;
/**
* 热搜指数
*/
private
String
hotwordnum
;
/**
* 热搜标签
*/
private
String
hottag
;
public
String
getHotword
()
{
return
hotword
;
}
public
void
setHotword
(
String
hotword
)
{
this
.
hotword
=
hotword
;
}
public
String
getHotwordnum
()
{
return
hotwordnum
;
}
public
void
setHotwordnum
(
String
hotwordnum
)
{
this
.
hotwordnum
=
hotwordnum
;
}
public
String
getHottag
()
{
return
hottag
;
}
public
void
setHottag
(
String
hottag
)
{
this
.
hottag
=
hottag
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWeiboTopSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚微博热搜榜list字段数据
* @Date: 2024/4/16 17:13
*/
public
class
TianWeiboTopSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWxNewRequest.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/17 10:50
*/
public
class
TianWxNewRequest
implements
Serializable
{
/**
* 返回数量(必需)
*/
private
Integer
num
;
/**
* 翻页
*/
private
Integer
page
;
/**
* 检索关键词
*/
private
String
word
;
public
TianWxNewRequest
(
Integer
num
,
Integer
page
,
String
word
)
{
this
.
num
=
num
;
this
.
page
=
page
;
this
.
word
=
word
;
}
public
TianWxNewRequest
()
{
}
public
Integer
getNum
()
{
return
num
;
}
public
void
setNum
(
Integer
num
)
{
this
.
num
=
num
;
}
public
Integer
getPage
()
{
return
page
;
}
public
void
setPage
(
Integer
page
)
{
this
.
page
=
page
;
}
public
String
getWord
()
{
return
word
;
}
public
void
setWord
(
String
word
)
{
this
.
word
=
word
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWxNewSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @Author: Leon Liu
* @Date: 2024/4/16 17:35
*/
public
class
TianWxNewSearch
implements
Serializable
{
/**
* 文章唯一ID
*/
private
String
id
;
/**
* 发布时间
*/
private
Date
ctime
;
/**
* 文章标题
*/
private
String
title
;
/**
* 文章描述
*/
private
String
description
;
/**
* 文章封面
*/
private
String
picurl
;
/**
* 文章地址
*/
private
String
url
;
/**
* 公众号名称
*/
private
String
username
;
/**
* 公众号ID
*/
private
String
wxnum
;
/**
* 文章分类
*/
private
String
type
;
/**
* 文章作者
*/
private
String
author
;
public
String
getId
()
{
return
id
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
Date
getCtime
()
{
return
ctime
;
}
public
void
setCtime
(
Date
ctime
)
{
this
.
ctime
=
ctime
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getPicurl
()
{
return
picurl
;
}
public
void
setPicurl
(
String
picurl
)
{
this
.
picurl
=
picurl
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getWxnum
()
{
return
wxnum
;
}
public
void
setWxnum
(
String
wxnum
)
{
this
.
wxnum
=
wxnum
;
}
public
String
getAuthor
()
{
return
author
;
}
public
void
setAuthor
(
String
author
)
{
this
.
author
=
author
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWxNewSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚微信精选list字段数据
* @Date: 2024/4/16 18:07
*/
public
class
TianWxNewSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWxTopSearch.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
import
java.io.Serializable
;
/**
* @Author: Leon Liu
* @Date: 2024/4/16 17:47
*/
public
class
TianWxTopSearch
implements
Serializable
{
/**
* 话题内容
*/
private
String
word
;
/**
* 热搜榜指数
*/
private
Integer
index
;
public
String
getWord
()
{
return
word
;
}
public
void
setWord
(
String
word
)
{
this
.
word
=
word
;
}
public
Integer
getIndex
()
{
return
index
;
}
public
void
setIndex
(
Integer
index
)
{
this
.
index
=
index
;
}
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/TianWxTopSearchList.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
/**
* @Author: Leon Liu
* @Description: 天聚微信热搜榜list字段数据
* @Date: 2024/4/16 17:52
*/
public
class
TianWxTopSearchList
{
}
src/main/java/cn/com/poc/thirdparty/resource/tianju/api/entity/Usage.java
0 → 100644
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
tianju
.
api
.
entity
;
public
class
Usage
{
private
String
completion_tokens
;
private
String
prompt_tokens
;
private
String
total_tokens
;
public
String
getCompletion_tokens
()
{
return
completion_tokens
;
}
public
void
setCompletion_tokens
(
String
completion_tokens
)
{
this
.
completion_tokens
=
completion_tokens
;
}
public
String
getPrompt_tokens
()
{
return
prompt_tokens
;
}
public
void
setPrompt_tokens
(
String
prompt_tokens
)
{
this
.
prompt_tokens
=
prompt_tokens
;
}
public
String
getTotal_tokens
()
{
return
total_tokens
;
}
public
void
setTotal_tokens
(
String
total_tokens
)
{
this
.
total_tokens
=
total_tokens
;
}
}
src/test/java/cn/com/poc/thirdparty/resource/demand/ai/function/ImageOCRFunctionTest.java
View file @
1e875b92
package
cn
.
com
.
poc
.
thirdparty
.
resource
.
demand
.
ai
.
function
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.html_reader.HtmlReaderFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.image_ocr.ImageOCRFunction
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.top_search.WeiboTopSearchFunction
;
import
cn.com.yict.framemax.core.spring.SingleContextInitializer
;
import
org.junit.runner.RunWith
;
import
org.junit.Test
;
...
...
@@ -27,4 +29,20 @@ public class ImageOCRFunctionTest {
String
content
=
"{\"query\":\"图片有什么?\",\"image_url\":\"https://ark-project.tos-cn-beijing.volces.com/images/view.jpeg\"}"
;
System
.
out
.
println
(
imageOCRFunction
.
doFunction
(
content
,
"test"
));
}
HtmlReaderFunction
htmlReaderFunction
=
new
HtmlReaderFunction
();
@Test
public
void
testHtmlReader
()
{
String
content
=
"{\"url\":\"https://top.baidu.com/board?tab=realtime\"}"
;
System
.
out
.
println
(
htmlReaderFunction
.
doFunction
(
content
,
"test"
));
}
@Resource
WeiboTopSearchFunction
weiboTopSearchFunction
;
@Test
public
void
weibo
()
{
System
.
out
.
println
(
weiboTopSearchFunction
.
getLLMConfig
());
}
}
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