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
The following examples use an HTTP client to send a POST request to Dapr's sidecar HTTP endpoint. You can also use [the Dapr SDK client instead]({{% ref "#related-links" %}}).
59
+
The following examples use the Dapr SDK client to interact with LLMs.
60
60
61
61
{{< tabpane text=true >}}
62
62
@@ -83,7 +83,7 @@ var response = await conversationClient.ConverseAsync("conversation",
83
83
DaprConversationRole.Generic)
84
84
});
85
85
86
-
Console.WriteLine("Received the following from the LLM:");
86
+
Console.WriteLine("conversation output: ");
87
87
foreach (var resp in response.Outputs)
88
88
{
89
89
Console.WriteLine($"\t{resp.Result}");
@@ -92,6 +92,77 @@ foreach (var resp in response.Outputs)
92
92
93
93
{{% /tab %}}
94
94
95
+
<!-- Java -->
96
+
{{% tab "Java" %}}
97
+
98
+
```java
99
+
//dependencies
100
+
importio.dapr.client.DaprClientBuilder;
101
+
importio.dapr.client.DaprPreviewClient;
102
+
importio.dapr.client.domain.ConversationInput;
103
+
importio.dapr.client.domain.ConversationRequest;
104
+
importio.dapr.client.domain.ConversationResponse;
105
+
importreactor.core.publisher.Mono;
106
+
107
+
importjava.util.List;
108
+
109
+
publicclassConversation {
110
+
111
+
publicstaticvoidmain(String[] args) {
112
+
String prompt ="Please write a witty haiku about the Dapr distributed programming framework at dapr.io";
0 commit comments