(args, input_content: str, input_type: str, output_dir: Path)
| 105 | |
| 106 | |
| 107 | async def run_frontend_workflow(args, input_content: str, input_type: str, output_dir: Path): |
| 108 | from fastapi_app.schemas import FrontendPPTGenerationRequest, Paper2PPTRequest |
| 109 | from fastapi_app.services.paper2ppt_frontend_service import Paper2PPTFrontendService |
| 110 | from fastapi_app.services.managed_api_service import resolve_llm_credentials |
| 111 | from fastapi_app.workflow_adapters.wa_paper2ppt import run_paper2page_content_wf_api |
| 112 | |
| 113 | resolved_chat_api_url, resolved_api_key = resolve_llm_credentials( |
| 114 | args.api_url, |
| 115 | args.api_key, |
| 116 | scope=args.credential_scope, |
| 117 | ) |
| 118 | |
| 119 | outline_req = Paper2PPTRequest( |
| 120 | language=args.language, |
| 121 | chat_api_url=resolved_chat_api_url, |
| 122 | credential_scope=args.credential_scope, |
| 123 | chat_api_key=resolved_api_key, |
| 124 | api_key=resolved_api_key, |
| 125 | model=args.outline_model, |
| 126 | gen_fig_model="", |
| 127 | input_type=input_type, |
| 128 | input_content=input_content, |
| 129 | style=args.style, |
| 130 | ref_img="", |
| 131 | email=args.email, |
| 132 | page_count=args.page_count, |
| 133 | use_long_paper=bool(args.use_long_paper), |
| 134 | ) |
| 135 | |
| 136 | log.info("%s", "=" * 60) |
| 137 | log.info("Paper2PPT Frontend Editable CLI") |
| 138 | log.info("%s", "=" * 60) |
| 139 | log.info("Input Type: %s", input_type) |
| 140 | log.info("Page Count: %s", args.page_count) |
| 141 | log.info("Use Long Paper: %s", args.use_long_paper) |
| 142 | log.info("Include Images: %s", args.include_images) |
| 143 | log.info("Output Directory: %s", output_dir) |
| 144 | log.info("%s", "=" * 60) |
| 145 | |
| 146 | pagecontent_resp = await run_paper2page_content_wf_api(outline_req, result_path=output_dir) |
| 147 | pagecontent = pagecontent_resp.pagecontent or [] |
| 148 | result_path = pagecontent_resp.result_path or str(output_dir) |
| 149 | |
| 150 | frontend_req = FrontendPPTGenerationRequest( |
| 151 | result_path=result_path, |
| 152 | pagecontent=json.dumps(pagecontent, ensure_ascii=False), |
| 153 | chat_api_url=args.api_url, |
| 154 | api_key=args.api_key, |
| 155 | credential_scope=args.credential_scope, |
| 156 | email=args.email, |
| 157 | model=args.frontend_model, |
| 158 | language=args.language, |
| 159 | style=args.style, |
| 160 | include_images=args.include_images, |
| 161 | image_mode=args.image_mode or ("hybrid" if args.include_images else "none"), |
| 162 | image_style=args.image_style, |
| 163 | image_model=args.image_model, |
| 164 | ) |
no test coverage detected