Annotation Interface ImageUrl
This annotation is useful when an AiService is meant to describe an image as the value of the method parameter annotated
with @ImageUrl
will be used as an
ImageContent
.
The following code contains an example of how this can be used:
invalid input: '{@code
@RegisterAiService(chatMemoryProviderSupplier = RegisterAiService.NoChatMemoryProviderSupplier.class)
public interface ImageDescriber {
@UserMessage("This is image was reported on a GitHub issue. If this is a snippet of Java code, please respond"
+ " with only the Java code. If it is not, respond with 'NOT AN IMAGE'")
Report describe(@ImageUrl String url);
}
</pre>
There can be at most one instance of {@code ImageUrl} per method and the supported types are the following:
<ul>
<li>String</li>
<li>URL</li>
<li>URI</li>
<li>dev.langchain4j.data.image.Image</li>
</ul>'