You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _versions/main/guides/assistant.adoc
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ An extension can define Assistant features without depending on Chappie directly
131
131
132
132
=== Workspace participation
133
133
134
-
You can add an assistant function to a workspace item using the same approach as regular https://quarkus.io/guides/dev-ui#workspace[workspace actions], with one key difference: instead of using `.function(...)`, you use `.assistantFunction(...)`.
134
+
You can add an assistant function to a workspace item using the same approach as regular xref:dev-ui.adoc#workspace[workspace actions], with one key difference: instead of using `.function(...)`, you use `.assistantFunction(...)`.
135
135
136
136
[source,java]
137
137
----
@@ -152,13 +152,13 @@ You can add an assistant function to a workspace item using the same approach as
152
152
.displayType(DisplayType.markdown)
153
153
.filter(Patterns.JAVA_SRC));
154
154
----
155
-
<1> Use `assistantFunction` to receive the `Assistant` instance and https://quarkus.io/guides/dev-ui#input[input] parameters.
155
+
<1> Use `assistantFunction` to receive the `Assistant` instance and xref:dev-ui.adoc#input[input] parameters.
156
156
<2> Provide an optional *system message* to guide the assistant's behavior.
157
157
<3> Provide a *user message* as the primary prompt.
158
158
159
159
=== Assistant pages
160
160
161
-
To add a standalone assistant-powered page to the Dev UI, use the https://quarkus.io/guides/dev-ui#card[`CardPageBuildItem`] and `Page.assistantPageBuilder()`:
161
+
To add a standalone assistant-powered page to the Dev UI, use the xref:dev-ui.adoc#card[`CardPageBuildItem`] and `Page.assistantPageBuilder()`:
You can invoke the assistant from backend code using https://quarkus.io/guides/dev-ui#communicating-to-the-backend[standard Dev UI JSON-RPC] patterns — both against the *runtime* and *deployment* classpaths.
173
+
You can invoke the assistant from backend code using xref:dev-ui.adoc#communicating-to-the-backend[standard Dev UI JSON-RPC] patterns — both against the *runtime* and *deployment* classpaths.
174
174
175
175
==== JsonRPC against the Runtime classpath
176
176
177
-
To use the assistant in a https://quarkus.io/guides/dev-ui#jsonrpc-against-the-runtime-classpath[`JsonRpcService`] on the runtime classpath, inject the `Assistant` like this:
177
+
To use the assistant in a xref:dev-ui.adoc#jsonrpc-against-the-runtime-classpath[`JsonRpcService`] on the runtime classpath, inject the `Assistant` like this:
178
178
179
179
[source,java]
180
180
----
@@ -201,27 +201,29 @@ You can now use this assistant in any JsonRPC method, example:
201
201
202
202
==== JsonRPC against the Deployment classpath
203
203
204
-
In https://quarkus.io/guides/dev-ui#jsonrpc-against-the-deployment-classpath[deployment-time] code, use the `BuildTimeActionBuildItem` and register assistant actions via `.addAssistantAction(...)`:
204
+
In xref:dev-ui.adoc#jsonrpc-against-the-deployment-classpath[deployment-time] code, use the `BuildTimeActionBuildItem` and register assistant actions via `.addAssistantAction(...)`:
205
205
206
206
[source,java]
207
207
----
208
208
BuildTimeActionBuildItem bta = new BuildTimeActionBuildItem();
<1> Return or use a BuildProducer to create a `BuildTimeActionBuildItem`
1059
1062
<2> `BuildTimeActionBuildItem` is automatically scoped with your extension namespace
1060
-
<3> Here we add an action, that is the same as a request-response method. The method name (that can be called from js in the same way as any json-rpc service) is `generateManifests`. If there are any parameters, those will be available in a map (params)
1063
+
<3> The method name (that can be called from js in the same way as any json-rpc service) is `generateManifests`.
1064
+
<4> Here we add an function that will execute when this action is requested from the UI. If there are any parameters, those will be available in a map (params)
1061
1065
1062
1066
You can also return a `CompletableFuture`/`CompletionStage` as an action, and if you want to stream data you need to use `addSubscription` (rather than `addAction`) and return a `Flow.Publisher`. Here you can not use Uni and Multi as we need to pass data between the deployment and runtime classpaths, so sticking to JDK classes is the safe option.
1063
1067
@@ -1070,8 +1074,10 @@ Passing recorded data to the UI work the same as the above deployment classpath,
0 commit comments