Skip to content

Commit bd59a6f

Browse files
committed
fix: remove options pattern for inputs
Signed-off-by: mikeee <[email protected]>
1 parent acbd239 commit bd59a6f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

client/conversation.go

-6
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ type ConversationInput struct {
3535
ScrubPII *bool // Scrub PII from the input
3636
}
3737

38-
type ConversationInputOption func(*ConversationInput)
39-
40-
func NewConversationInput(message string, opts ...ConversationInputOption) ConversationInput {
41-
return ConversationInput{}
42-
}
43-
4438
type ConversationResponse struct {
4539
ContextID string
4640
Outputs []ConversationResult

examples/conversation/main.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@ func main() {
2727
panic(err)
2828
}
2929

30-
resp, err := client.ConverseAlpha1(context.Background(), "echo", []dapr.ConversationInput{{Message: "hello"}})
30+
input := dapr.ConversationInput{
31+
Message: "hello world",
32+
// Role: nil, // Optional
33+
// ScrubPII: nil, // Optional
34+
}
35+
36+
var conversationComponent = "echo"
37+
38+
resp, err := client.ConverseAlpha1(context.Background(), conversationComponent, []dapr.ConversationInput{input})
3139
if err != nil {
3240
log.Fatalf("err: %v", err)
3341
}
3442

35-
fmt.Println(resp.Outputs)
43+
fmt.Printf("conversation output: %s", resp.Outputs[1].Result)
3644
}

0 commit comments

Comments
 (0)