mirror of
https://github.com/langchain-ai/langchain.git
synced 2026-10-09 19:35:20 +03:00
5.6 KiB
5.6 KiB
In [ ]:
#!pip install --upgrade protobuf
#!pip install nucliadb-protosIn [ ]:
import os
os.environ["NUCLIA_ZONE"] = "<YOUR_ZONE>" # e.g. europe-1
os.environ["NUCLIA_NUA_KEY"] = "<YOUR_API_KEY>"In [ ]:
from langchain.tools.nuclia import NucliaUnderstandingAPI
nua = NucliaUnderstandingAPI(enable_ml=False)In [ ]:
nua.run({"action": "push", "id": "1", "path": "./report.docx"})
nua.run({"action": "push", "id": "2", "path": "./interview.mp4"})In [ ]:
import time
pending = True
data = None
while pending:
time.sleep(15)
data = nua.run({"action": "pull", "id": "1", "path": None})
if data:
print(data)
pending = False
else:
print("waiting...")In [ ]:
import asyncio
async def process():
data = await nua.arun(
{"action": "push", "id": "1", "path": "./talk.mp4", "text": None}
)
print(data)
asyncio.run(process())