zhangyong 6 月之前
父节点
当前提交
dee19f6d9f
共有 3 个文件被更改,包括 4 次插入6 次删除
  1. 1 1
      common/odps_data.py
  2. 1 2
      google_ai/generativeai_video.py
  3. 2 3
      video_processing/video_processing.py

+ 1 - 1
common/odps_data.py

@@ -20,7 +20,7 @@ class OdpsDataCount:
         )
         data_values = []
         try:
-            dt = "2024092717"
+            dt = "2024100819"
             sql = f'SELECT videoid,title,video_path FROM {project}.{table} WHERE dt = "{dt}" '
             with odps.execute_sql(sql).open_reader() as reader:
                 for row in reader:

+ 1 - 2
google_ai/generativeai_video.py

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

+ 2 - 3
video_processing/video_processing.py

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