-
Hello, I can't quite find in the documentation nor GitHub samples how to generate images using this extension. What I'm trying to do is to write a service like this: @RegisterAiService
public interface DallEService {
@SystemMessage("""
You're a food illustrator. I'll provide you with a recipe name, description and ingredients. Please draw simple picture of the dish. Don't write any text in the picture. Generate the picture and return a url to it.
""")
@UserMessage("Name: {{recipeName}} Description: {{recipeDescription}} Ingredients: {{ingredients}}")
String generateIllustration(String recipeName, String recipeDescription, String ingredients);
} Now when I use this service I can see in the logs that it does a POST request to
Also the response says I'm using a wrong API key but it's actually the same I'm using for my usual chat requests.
I saw that there's a config value But how do I actually tell a service to use this, and generate images instead of text? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, currently AiService can not use |
Beta Was this translation helpful? Give feedback.
Hi, currently AiService can not use
dev.langchain4j.model.image.ImageModel
. Hopefully that will change soon, but until then you can useImageModel
programmatically.