metaai-sdk 2.3.2__py3-none-any.whl → 2.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metaai_api/api_server.py CHANGED
@@ -216,8 +216,10 @@ async def chat(body: ChatRequest, cookies: Dict[str, str] = Depends(get_cookies)
216
216
  async def image(body: ImageRequest, cookies: Dict[str, str] = Depends(get_cookies)) -> Dict[str, Any]:
217
217
  ai = MetaAI(cookies=cookies, proxy=_get_proxies())
218
218
  try:
219
+ # Automatically prepend "generate image of" to the prompt
220
+ prompt = f"generate image of {body.prompt}" if not body.prompt.lower().startswith(("generate image", "create image")) else body.prompt
219
221
  return cast(Dict[str, Any], ai.prompt(
220
- body.prompt,
222
+ prompt,
221
223
  stream=False,
222
224
  new_conversation=body.new_conversation,
223
225
  media_ids=body.media_ids,
@@ -233,9 +235,11 @@ async def image(body: ImageRequest, cookies: Dict[str, str] = Depends(get_cookie
233
235
  async def video(body: VideoRequest, cookies: Dict[str, str] = Depends(get_cookies)) -> Dict[str, Any]:
234
236
  ai = MetaAI(cookies=cookies, proxy=_get_proxies())
235
237
  try:
238
+ # Automatically prepend "generate a video" to the prompt
239
+ prompt = f"generate a video {body.prompt}" if not body.prompt.lower().startswith(("generate a video", "generate video", "create a video", "create video")) else body.prompt
236
240
  return await run_in_threadpool(
237
241
  ai.generate_video,
238
- body.prompt,
242
+ prompt,
239
243
  body.media_ids,
240
244
  body.attachment_metadata,
241
245
  body.wait_before_poll,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metaai-sdk
3
- Version: 2.3.2
3
+ Version: 2.3.3
4
4
  Summary: Feature-rich Python SDK for Meta AI - Chat, Image & Video Generation powered by Llama 3
5
5
  Author-email: Ashiq Hussain Mir <imseldrith@gmail.com>
6
6
  License-Expression: MIT
@@ -1,12 +1,12 @@
1
1
  metaai_api/__init__.py,sha256=YT4Dn_m1Fm3Hh10D4Z9jtmADjQHnZSsdtwIn8IlCjN4,714
2
- metaai_api/api_server.py,sha256=p_h_jV6BNPrk2CVUs5ML9bt55brt-RgANrKTD5LdRr0,12804
2
+ metaai_api/api_server.py,sha256=hb1C3rEarPOHF6W-qqENaxrZWwn8A0qUrjSVlRtNV2s,13248
3
3
  metaai_api/client.py,sha256=Th46qW1l8OS8Hu5pj0aGFn4iQNz62A3sbXko-LP-SAU,5263
4
4
  metaai_api/exceptions.py,sha256=MRRAppZa0OFA0QLSvC0nABgZN_Ll1dUq9JfhECTqV-Q,114
5
5
  metaai_api/image_upload.py,sha256=DQ2xqKdM1I_pF1rZBsB7-QTvXLzke2_0XiIOxFhpc70,6563
6
6
  metaai_api/main.py,sha256=3kWYikKjq7pk2l8x6h12OkHe2pwxcs_UxzLj2qSy9Qs,28384
7
7
  metaai_api/utils.py,sha256=qzfIO3WkRH-gSV99b8RiECnMOku8lZEY3Jka9lTLExA,11979
8
- metaai_sdk-2.3.2.dist-info/licenses/LICENSE,sha256=hRLLSBixyX0tRh2k0iOGoF7nx-l-vBChNffFfVOIEtc,1290
9
- metaai_sdk-2.3.2.dist-info/METADATA,sha256=6S-IjAGMwlkrbItlRMp-flXMBjtFs5KTmQuQG0_jYbc,27602
10
- metaai_sdk-2.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- metaai_sdk-2.3.2.dist-info/top_level.txt,sha256=R6YCiIQLYFKKaqhNZXDwXbpj1u01P_YhcMCVbJiDUJs,11
12
- metaai_sdk-2.3.2.dist-info/RECORD,,
8
+ metaai_sdk-2.3.3.dist-info/licenses/LICENSE,sha256=hRLLSBixyX0tRh2k0iOGoF7nx-l-vBChNffFfVOIEtc,1290
9
+ metaai_sdk-2.3.3.dist-info/METADATA,sha256=6Xudn68v_wfaznuNiH0W5UmzK1JaxTtjVe08mUN7lJo,27602
10
+ metaai_sdk-2.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ metaai_sdk-2.3.3.dist-info/top_level.txt,sha256=R6YCiIQLYFKKaqhNZXDwXbpj1u01P_YhcMCVbJiDUJs,11
12
+ metaai_sdk-2.3.3.dist-info/RECORD,,