(args: argparse.Namespace, presigned_url: str = "")
| 78 | |
| 79 | |
| 80 | def build_sync_payload(args: argparse.Namespace, presigned_url: str = "") -> Dict[str, Any]: |
| 81 | payload: Dict[str, Any] = { |
| 82 | "prompt": args.prompt, |
| 83 | "negative_prompt": args.negative_prompt, |
| 84 | "seed": args.seed, |
| 85 | "aspect_ratio": args.aspect_ratio, |
| 86 | "save_result_path": args.save_result_path, |
| 87 | } |
| 88 | payload = {key: value for key, value in payload.items() if value is not None} |
| 89 | if args.size is not None: |
| 90 | payload["size"] = args.size |
| 91 | if presigned_url: |
| 92 | payload["presigned_url"] = presigned_url |
| 93 | return payload |
| 94 | |
| 95 | |
| 96 | def call_sync(base_url: str, payload: Dict[str, Any], timeout_seconds: int, poll_interval_seconds: float) -> requests.Response: |
| 97 | endpoint = f"{base_url.rstrip('/')}/v1/tasks/sync?timeout_seconds={timeout_seconds}&poll_interval_seconds={poll_interval_seconds}" |
no outgoing calls
no test coverage detected