aibirthday-haystack 0.1.0__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.
@@ -0,0 +1,3 @@
1
+ from aibirthday_haystack.generator import AIBirthdayVideoGenerator
2
+
3
+ __all__ = ["AIBirthdayVideoGenerator"]
@@ -0,0 +1,54 @@
1
+ """Haystack 2 component for AI Birthday Video Generator (https://aibirthdayvideogenerator.com/)."""
2
+
3
+ from __future__ import annotations
4
+ import time
5
+ from typing import Any, Dict, List, Optional
6
+
7
+ from aibirthday import Client
8
+ from haystack import component, default_from_dict, default_to_dict
9
+ from haystack.utils import Secret, deserialize_secrets_inplace
10
+
11
+
12
+ @component
13
+ class AIBirthdayVideoGenerator:
14
+ """Generate a 12-second 720p vertical birthday video in a Haystack pipeline."""
15
+
16
+ def __init__(
17
+ self,
18
+ api_key: Secret = Secret.from_env_var("ABVG_API_KEY"),
19
+ timeout: float = 1800.0,
20
+ poll_every: float = 10.0,
21
+ ):
22
+ self.api_key = api_key
23
+ self.timeout = timeout
24
+ self.poll_every = poll_every
25
+
26
+ def to_dict(self) -> Dict[str, Any]:
27
+ return default_to_dict(
28
+ self,
29
+ api_key=self.api_key.to_dict(),
30
+ timeout=self.timeout,
31
+ poll_every=self.poll_every,
32
+ )
33
+
34
+ @classmethod
35
+ def from_dict(cls, data: Dict[str, Any]) -> "AIBirthdayVideoGenerator":
36
+ deserialize_secrets_inplace(data["init_parameters"], keys=["api_key"])
37
+ return default_from_dict(cls, data)
38
+
39
+ @component.output_types(videos=List[str])
40
+ def run(self, prompt: str, image_url: Optional[str] = None) -> Dict[str, List[str]]:
41
+ """Generate a birthday video from a prompt and optional portrait photo URL."""
42
+ key = self.api_key.resolve_value()
43
+ client = Client(api_key=key, timeout=self.timeout, poll_every=self.poll_every)
44
+ task_id = client.submit(prompt, image_url=image_url)
45
+ deadline = time.monotonic() + self.timeout
46
+ while True:
47
+ st = client.status(task_id)
48
+ if st.get("status") == "success" and st.get("videos"):
49
+ return {"videos": [str(v) for v in st["videos"]]}
50
+ if st.get("status") in ("failed", "canceled"):
51
+ raise RuntimeError(st.get("errorMessage") or f"run {task_id} {st.get('status')}")
52
+ if time.monotonic() >= deadline:
53
+ raise TimeoutError(f"run {task_id} timed out")
54
+ time.sleep(self.poll_every)
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.4
2
+ Name: aibirthday-haystack
3
+ Version: 0.1.0
4
+ Summary: AI birthday video generator from a single photo: they pop champagne on a park bench, blow out a Scorpio cake, or light a crown cake at the car window. Haystack 2 component for aibirthdayvideogenerator.com.
5
+ Author-email: AI Birthday Video Generator <support@aibirthdayvideogenerator.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://aibirthdayvideogenerator.com/?utm_source=pypi-haystack&utm_medium=package
8
+ Project-URL: Documentation, https://aibirthdayvideogenerator.readthedocs.io/en/latest/
9
+ Project-URL: API Keys, https://aibirthdayvideogenerator.com/settings/apikeys
10
+ Project-URL: Pricing, https://aibirthdayvideogenerator.com/pricing?utm_source=pypi-haystack&utm_medium=package
11
+ Project-URL: Source, https://github.com/hanshs474/aibirthday-haystack
12
+ Keywords: haystack,ai,birthday-video,video-generation,image-to-video,seedance,pipeline
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Multimedia :: Video
15
+ Requires-Python: >=3.9
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: haystack-ai>=2.0
19
+ Requires-Dist: aibirthday>=0.1.0
20
+ Dynamic: license-file
21
+
22
+ # aibirthday-haystack
23
+
24
+ AI birthday video generator from a single photo: they pop champagne on a park bench, blow out a Scorpio cake, or light a crown cake at the car window.
25
+
26
+ Official Haystack 2 component for [AI Birthday Video Generator](https://aibirthdayvideogenerator.com/?utm_source=pypi-haystack&utm_medium=package) (`https://aibirthdayvideogenerator.com/`). Generate 12-second 720p vertical (`9:16`) birthday celebration videos on `seedance-2-mini` inside any Haystack pipeline.
27
+
28
+ - Create an API key at [API Keys](https://aibirthdayvideogenerator.com/settings/apikeys) and set `ABVG_API_KEY`.
29
+ - Scene guides: [Read the Docs](https://aibirthdayvideogenerator.readthedocs.io/en/latest/) · Credit packs: [Pricing](https://aibirthdayvideogenerator.com/pricing?utm_source=pypi-haystack&utm_medium=package).
30
+ - Source code: [github.com/hanshs474/aibirthday-haystack](https://github.com/hanshs474/aibirthday-haystack).
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ pip install aibirthday-haystack
36
+ ```
37
+
38
+ ## Quick start
39
+
40
+ ```python
41
+ from aibirthday_haystack import AIBirthdayVideoGenerator
42
+
43
+ gen = AIBirthdayVideoGenerator()
44
+ out = gen.run(
45
+ prompt="popping champagne on a park bench with a birthday cake",
46
+ image_url="https://example.com/portrait.jpg",
47
+ )
48
+ print(out["videos"][0])
49
+ ```
50
+
51
+ ## License
52
+
53
+ MIT
@@ -0,0 +1,7 @@
1
+ aibirthday_haystack/__init__.py,sha256=odJiGfOXe9a96xUgpEvz8Hvg8WiPe_jPBJuftDbaplo,107
2
+ aibirthday_haystack/generator.py,sha256=8euPFgnYBq2xLw_a1bUoizqNI4Ghrp6N5p1r6gqqX5k,2152
3
+ aibirthday_haystack-0.1.0.dist-info/licenses/LICENSE,sha256=JOM_GA-9vp_Pms4icVxdSdZpvMq2x75TT_MSX-PGaL4,1123
4
+ aibirthday_haystack-0.1.0.dist-info/METADATA,sha256=CZiFyUWpsGaTqNrT1MVZqpFdt6cwD-udZxQUh7rfenk,2457
5
+ aibirthday_haystack-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
6
+ aibirthday_haystack-0.1.0.dist-info/top_level.txt,sha256=XJlr44tUfYIvNUmrMS02cwRIE7zpUL_aIeNAeOe904s,20
7
+ aibirthday_haystack-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AI Birthday Video Generator (https://aibirthdayvideogenerator.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ aibirthday_haystack