zhangyong 6 tháng trước cách đây
mục cha
commit
8b0cd30e9e
2 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 2 1
      google_ai/generativeai_video.py
  2. 2 2
      video_processing/video_processing.py

+ 2 - 1
google_ai/generativeai_video.py

@@ -313,7 +313,8 @@ async def main(video_path):
                                "品类-中国历史影像\n" \
                                "品类-国际军事\n" \
                                "品类-国内军事\n" \
-                               "品类-国家统一\n"
+                               "品类-国家统一\n" \
+                               "输出格式:要求输出格式为符合RFC8259标准的JSON格式的字符串"
 
 
     # 分析视频并打印结果

+ 2 - 2
video_processing/video_processing.py

@@ -23,8 +23,8 @@ class VideoProcessing:
         try:
             response = response.json()
             result = response['result']
-            print(result)
-            return result
+            cleaned_string = result.replace( "```json", '' ).replace( "```", '' ).strip()
+            return cleaned_string
         except Exception as e:
             print(f"视频请求异常:{e}")
             return None