17 lines
424 B
Python
17 lines
424 B
Python
|
|
from ollama_client import ask
|
||
|
|
|
||
|
|
|
||
|
|
def generate_compose(service: str) -> str:
|
||
|
|
prompt = (
|
||
|
|
"Output ONLY valid docker-compose YAML. No explanations. No markdown.\n\n"
|
||
|
|
f"Generate a docker-compose file for this service: {service}"
|
||
|
|
)
|
||
|
|
response = ask(prompt)
|
||
|
|
if response.startswith("ERROR:"):
|
||
|
|
return response
|
||
|
|
return response
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
print(generate_compose("nginx"))
|