Haere ki ihirangi matua

Waihanga Panui ki nga Reo rereke

I roto i tenei tauira ka titiro tatou me pehea te hanga pou i roto i nga reo ke atu i te reo Ingarihi taunoa ma te whakamahi i te Predis.ai API. Te tawhā output_language ka whakahaere i te reo o te pou i hangaia. Ka taea hoki e koe te whakarite input_language tawhā mena ka tukuna e koe te text tawhā i roto i te reo rerekē.

Ka whakatauhia e matou te uara o output_language Tuhinga o mua spanish ki te whakaputa i te pou ki te reo Paniora. Tirohia te API Tohutoro ki te mohio atu mo nga reo tautoko.

import requests, json

url = "https://brain.predis.ai/predis_api/v1/create_content/"

payload = {
"brand_id": "YOUR_BRAND_ID",
"text": "3 tips for a healthy morning breakfast",
"media_type": "video",
"model_version": "2", # Video not supported by model_version 4
"video_duration": "long", # long signifies multi-scene videos
"template_ids": json.dumps(["TEMPLATE_ID_1"]), # pass template_ids if you want video in specific design
"output_language": "spanish",
"input_language": "english" # change it if your text param is in a different language
}

headers = {"Authorization": "YOUR_API_KEY"}

response = requests.request("POST", url, data=payload, headers=headers)

if response.status_code == 200:
json_response = response.json()
post_id = json_response.get("post_id")
post_status = json_response.get("status")

else:
print("Error occurred - {}".format(response.text))

Mena ka whiwhi koe i te inProgress mana ki te whakautu, kua angitu to tono, kei te hanga te ataata. Ina oti pai te whakaputanga o te ataata (ka rahua ranei), ka whiwhi koe i tetahi tono i runga i to URLhook kua whirihorahia me etahi atu korero mo te ataata.