Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
A
aidso-data
Project
Project
Details
Activity
Releases
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
Yaowentong
aidso-data
Commits
d521b79d
Commit
d521b79d
authored
Jun 23, 2026
by
Yaowentong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai对话机器人修复
parent
3fc3b1a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
ai_utils.py
ai_chat_stream/ai_utils.py
+2
-3
parse_utils.py
ai_chat_stream/parse_utils.py
+2
-0
spider_api.py
ai_chat_stream/spider_api.py
+2
-3
No files found.
ai_chat_stream/ai_utils.py
View file @
d521b79d
...
@@ -17,6 +17,7 @@ def _streaming_request(url, model,messages,type, batch_size=50):
...
@@ -17,6 +17,7 @@ def _streaming_request(url, model,messages,type, batch_size=50):
"type"
:
type
"type"
:
type
}
}
}
}
headers
=
{
headers
=
{
'Authorization'
:
API_KEY
,
'Authorization'
:
API_KEY
,
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
...
@@ -222,7 +223,7 @@ def get_bot_with_history_rag_stream(messages,type = "auto", batch_size=DEFAULT_B
...
@@ -222,7 +223,7 @@ def get_bot_with_history_rag_stream(messages,type = "auto", batch_size=DEFAULT_B
# 图像识别
# 图像识别
def
get_image_to_text_stream
(
content
,
type
=
"
auto
"
,
batch_size
=
DEFAULT_BATCH_SIZE
):
def
get_image_to_text_stream
(
content
,
type
=
"
disabled
"
,
batch_size
=
DEFAULT_BATCH_SIZE
):
messages
=
[{
"content"
:
content
,
"role"
:
"user"
}]
messages
=
[{
"content"
:
content
,
"role"
:
"user"
}]
return
_streaming_request
(
return
_streaming_request
(
url
=
CHAT_COMPLETIONS_URL
,
url
=
CHAT_COMPLETIONS_URL
,
...
@@ -263,6 +264,4 @@ def get_ai_chat_history_stream_comment(messages, type = "disabled", batch_size=D
...
@@ -263,6 +264,4 @@ def get_ai_chat_history_stream_comment(messages, type = "disabled", batch_size=D
)
)
if
__name__
==
'__main__'
:
print
(
get_ai_chat_history_stream_comment
(
"文案改写"
))
ai_chat_stream/parse_utils.py
View file @
d521b79d
...
@@ -642,3 +642,5 @@ def extract_user_contents(dialogues):
...
@@ -642,3 +642,5 @@ def extract_user_contents(dialogues):
if
item
[
'role'
]
==
'user'
:
if
item
[
'role'
]
==
'user'
:
user_contents
.
append
(
item
[
'content'
])
user_contents
.
append
(
item
[
'content'
])
return
user_contents
return
user_contents
ai_chat_stream/spider_api.py
View file @
d521b79d
...
@@ -54,7 +54,6 @@ def is_valid_xiaohongshu_link(url: str) -> bool:
...
@@ -54,7 +54,6 @@ def is_valid_xiaohongshu_link(url: str) -> bool:
def
get_xhs_info
(
video_url
):
def
get_xhs_info
(
video_url
):
url
=
""
url
=
""
if
is_valid_xiaohongshu_link
(
video_url
):
if
is_valid_xiaohongshu_link
(
video_url
):
print
(
video_url
)
url
=
f
"http://172.16.18.10:8875/api/v1/xhs?share_url={quote_plus(video_url)}"
url
=
f
"http://172.16.18.10:8875/api/v1/xhs?share_url={quote_plus(video_url)}"
payload
=
{}
payload
=
{}
headers
=
{}
headers
=
{}
...
@@ -120,7 +119,7 @@ if __name__ == '__main__':
...
@@ -120,7 +119,7 @@ if __name__ == '__main__':
# # url= "https://v.kuaishou.com/KFy0JkVY"
# # url= "https://v.kuaishou.com/KFy0JkVY"
# # "29 【要当可爱的水手啦~~~ - 夹克本人 | 小红书 - 你的生活兴趣社区】 😆 tx3lJkm14vxxx1A 😆 https://www.xiaohongshu.com/discovery/item/6894c614000000000403dcad?source=webshare&xhsshare=pc_web&xsec_token=CBmYaPr2HJVyffdsKGD_zkN5gOTLXgasc3dPOzNRGjKhs=&xsec_source=pc_share"
# # "29 【要当可爱的水手啦~~~ - 夹克本人 | 小红书 - 你的生活兴趣社区】 😆 tx3lJkm14vxxx1A 😆 https://www.xiaohongshu.com/discovery/item/6894c614000000000403dcad?source=webshare&xhsshare=pc_web&xsec_token=CBmYaPr2HJVyffdsKGD_zkN5gOTLXgasc3dPOzNRGjKhs=&xsec_source=pc_share"
# # #
# # #
url
=
"https://
v.douyin.com/MXCfDjwnbBs/
"
url
=
"https://
www.xiaohongshu.com/discovery/item/69d6aae5000000002102da3e?source=webshare&xhsshare=pc_web&xsec_token=CBxnnqlpIrloQXUm5cqwsVQpcNWp7RDwb9XCFKqq_d510=&xsec_source=pc_share
"
result
=
get_
dy_ocr
_info
(
url
)
result
=
get_
xhs
_info
(
url
)
print
(
result
)
print
(
result
)
# # print(len(result))
# # print(len(result))
\ No newline at end of file
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