Spaces:
Build error
Build error
| from .llm_client import generate_with_hf, generate_with_openai | |
| def synthesize_blueprint_python(parsed: dict, mapping: dict, backend: str = "hf") -> str: | |
| prompt = f""" | |
| Given this parsed Unity class and mapping rules, produce a Python Editor script using Unreal's Python API | |
| that will create a Blueprint Actor in /Game/Blueprints named BP_<ClassName> with: | |
| - A StaticMeshComponent as root | |
| - A float property 'RotationSpeed' exposed to Blueprints | |
| - A Tick override that rotates actor by RotationSpeed * DeltaTime | |
| Provide only the Python file content. | |
| Parsed: {parsed} | |
| Mapping: {mapping} | |
| """ | |
| if backend == "hf": | |
| return generate_with_hf(prompt) | |
| else: | |
| return generate_with_openai(prompt) | |