|
48 | 48 | "openai_api_base = config_details['OPENAI_API_BASE']\n", |
49 | 49 | "\n", |
50 | 50 | "# The API key for your Azure OpenAI resource.\n", |
51 | | - "openai_api_key = os.getenv(\"OPENAI_API_KEY\")\n", |
| 51 | + "openai_api_key = \"de4528459b9a4b1fa94a89807b82e189\" #os.getenv(\"OPENAI_API_KEY\")\n", |
52 | 52 | "\n", |
53 | 53 | "# Currently OPENAI API have the following versions available: 2022-12-01. All versions follow the YYYY-MM-DD date structure.\n", |
54 | 54 | "openai_api_version = config_details['OPENAI_API_VERSION']" |
|
221 | 221 | " url = f\"{vision_api_endpoint}/computervision/retrieval/indexes/{index_name}/ingestions/my-ingestion?api-version=2023-05-01-preview\"\n", |
222 | 222 | " headers = {\"Ocp-Apim-Subscription-Key\": vision_api_key, \"Content-Type\": \"application/json\"}\n", |
223 | 223 | " data = {\n", |
224 | | - " 'videos': [{'mode': 'add', 'documentId': video_id, 'documentUrl': video_url}]\n", |
| 224 | + " \"videos\": [\n", |
| 225 | + " {\n", |
| 226 | + " \"mode\": \"add\", \n", |
| 227 | + " \"documentId\": video_id, \n", |
| 228 | + " \"documentUrl\": video_url\n", |
| 229 | + " }\n", |
| 230 | + " ],\n", |
| 231 | + " \"generateInsightIntervals\": False,\n", |
| 232 | + " \"moderation\": False,\n", |
| 233 | + " \"filterDefectedFrames\": False,\n", |
| 234 | + " \"includeSpeechTranscrpt\": True\n", |
225 | 235 | " }\n", |
226 | 236 | " response = requests.put(url, headers=headers, data=json.dumps(data))\n", |
227 | 237 | " return response\n", |
|
0 commit comments