zhangyong 6 mesi fa
parent
commit
31eddfed04
2 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 4 2
      analyze_video.py
  2. 1 1
      google_ai/generativeai_video.py

+ 4 - 2
analyze_video.py

@@ -9,7 +9,7 @@ class VideoRequest(BaseModel):
     video_path: str
     prompt: str
     mark: str
-
+    sample_data: str
 
 @app.post("/testprocess_test_video/")
 async def process_video_test(request: VideoRequest):
@@ -17,10 +17,12 @@ async def process_video_test(request: VideoRequest):
     video_path = request.video_path
     prompt = request.prompt
     mark = request.mark
+    sample_data = request.sample_data
+
     api_key = "AIzaSyAUvBSpjFcm7b8FsgRUTG6anzoalDp9gYg"
     try:
         print("来一个请求,使用 API key:", api_key)
-        result, mark = await main(video_path, api_key, prompt, mark)
+        result, mark = await main(video_path, api_key, prompt, mark, sample_data)
         return {
             "code": 0,
             "message": "视频处理成功",

+ 1 - 1
google_ai/generativeai_video.py

@@ -133,7 +133,7 @@ class VideoAnalyzer:
             return int(duration)
         return 0
 
-async def main(video_path, api_key, prompt, mark):
+async def main(video_path, api_key, prompt, mark, sample_data):
     """主函数,执行视频上传、缓存创建、问题生成"""
     attempt = 0
     max_attempts = 1