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. |
Beta Was this translation helpful? Give feedback.
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 argument
hosts: localhost
vars:
script_path: "/path/to/your/script.py"
argument: "example_argument"
tasks:
- name: Execute Python script with an argument
command: "python3 {{ script_path }} {{ argument }}"
register: script_output
- name: Show URL from Python script
debug:
msg: "The URL returned by the Python script is: {{ script_output.stdout }}" Python Script ( #!/usr/bin/env python3
import sys
# Get the argument from the command line
argument = sys.argv[1] if len(sys.argv) > 1 else "default"
# Construct the URL
url = f"http://www.example.com/{argument}"
# Output the URL
print(url) Inside the Python script, you might use something like https://python.langchain.com/docs/integrations/tools/dalle_image_generator to do the work for image generation, as an example. |
Beta Was this translation helpful? Give feedback.
-
At some point I might add specific non-text generations, but it's not high on the priority list. |
Beta Was this translation helpful? Give feedback.
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: