-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #204 from jmartisk/dev-ui-images
Image model Dev UI page + docs
- Loading branch information
Showing
7 changed files
with
420 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
= Dev UI | ||
|
||
include::./includes/attributes.adoc[] | ||
|
||
If you use the Dev mode, the `quarkus-langchain4j` project provides several pages | ||
in the Dev UI to facilitate development: | ||
|
||
* *AI Services* page: provides a table of all AI Services detected in the application along | ||
with a list of tools that they are declared to use. | ||
* *Tools* page: provides a list of tools detected in the application. | ||
* *Chat* page: allows you to manually hold a conversation with a chat model. This | ||
page is only available if the application contains a chat model. | ||
* *Images* page: allows you to test the outputs of image models and tune its parameters. | ||
This page is provided specifically by the `openai-vanilla` extension and is currently specific | ||
to OpenAI's image models. It appears if the application uses the `openai-vanilla` extension | ||
and doesn't have image models explicitly disabled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ava/io/quarkiverse/langchain4j/openai/deployment/devui/OpenAiDevUIImagePageProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.quarkiverse.langchain4j.openai.deployment.devui; | ||
|
||
import io.quarkiverse.langchain4j.openai.deployment.Langchain4jOpenAiBuildConfig; | ||
import io.quarkiverse.langchain4j.openai.runtime.devui.OpenAiImagesJsonRPCService; | ||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.annotations.BuildProducer; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.devui.spi.JsonRPCProvidersBuildItem; | ||
import io.quarkus.devui.spi.page.CardPageBuildItem; | ||
import io.quarkus.devui.spi.page.Page; | ||
|
||
public class OpenAiDevUIImagePageProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
CardPageBuildItem cardPage( | ||
BuildProducer<JsonRPCProvidersBuildItem> producers, | ||
Langchain4jOpenAiBuildConfig config) { | ||
if (config.imageModel().enabled().orElse(true)) { | ||
CardPageBuildItem card = new CardPageBuildItem(); | ||
card.addPage(Page.webComponentPageBuilder().title("Images") | ||
.componentLink("qwc-images.js") | ||
.icon("font-awesome-solid:palette")); | ||
producers.produce(new JsonRPCProvidersBuildItem(OpenAiImagesJsonRPCService.class)); | ||
return card; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.