- Notifications
You must be signed in to change notification settings - Fork475
Can workflows be used also to generate images and sound from OpenAI models#328
-
I am trying to find out whether these workflows are limited to "llm's" or if other kinds of generation can be invoked. One use case for a workflow could be:
All this could then be saved to the same folder and ready for deployment to a website, for example. Is that currently possible and if so, how? Thank you. |
BetaWas this translation helpful?Give feedback.
All reactions
There is not currently specific integration with non-text generations, however, the beauty of Ansible is that it's quite easy to add your own if you so desire. Possible approaches off the top of my head:
- Call a custom Python script as a playbook task
- Write a custom Ansible module
Below is some boilerplate for approach number one that GPT-4 whipped up, which shows how to invoke a custom script with an argument, and how to construct the script:
Ansible Playbook:
----name:Call Python script with a customizable argumenthosts:localhostvars:script_path:"/path/to/your/script.py"argument:"example_argument"tasks: -name:Execute Python script with an argumentc…
Replies: 2 comments 1 reply
-
There is not currently specific integration with non-text generations, however, the beauty of Ansible is that it's quite easy to add your own if you so desire. Possible approaches off the top of my head:
Below is some boilerplate for approach number one that GPT-4 whipped up, which shows how to invoke a custom script with an argument, and how to construct the script: Ansible Playbook: ----name:Call Python script with a customizable argumenthosts:localhostvars:script_path:"/path/to/your/script.py"argument:"example_argument"tasks: -name:Execute Python script with an argumentcommand:"python3 {{ script_path }} {{ argument }}"register:script_output -name:Show URL from Python scriptdebug:msg:"The URL returned by the Python script is: {{ script_output.stdout }}" Python Script ( #!/usr/bin/env python3importsys# Get the argument from the command lineargument=sys.argv[1]iflen(sys.argv)>1else"default"# Construct the URLurl=f"http://www.example.com/{argument}"# Output the URLprint(url) Inside the Python script, you might use something likehttps://python.langchain.com/docs/integrations/tools/dalle_image_generator to do the work for image generation, as an example. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you. I will try to work with that :) |
BetaWas this translation helpful?Give feedback.
All reactions
-
At some point I might add specific non-text generations, but it's not high on the priority list. |
BetaWas this translation helpful?Give feedback.