Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can workflows be used also to generate images and sound from OpenAI models#328

Answeredbythehunmonkgroup
kiil asked this question inQ&A
Discussion options

lwe is great and the ansible playbook workflows arevery useful.

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:

  1. first to generate some text,
  2. and then, based on the generated text, generate an accompanying image
  3. and then further a text-to-speech sound file based also on the text

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.

You must be logged in to vote

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:

  1. Call a custom Python script as a playbook task
  2. 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

Comment options

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:

  1. Call a custom Python script as a playbook task
  2. 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 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 (script.py):

#!/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.

You must be logged in to vote
1 reply
@kiil
Comment options

Thank you. I will try to work with that :)

Answer selected bykiil
Comment options

At some point I might add specific non-text generations, but it's not high on the priority list.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@kiil@thehunmonkgroup

[8]ページ先頭

©2009-2025 Movatter.jp