Skip to content

Commit

Permalink
fix: remove options pattern for inputs
Browse files Browse the repository at this point in the history
Signed-off-by: mikeee <[email protected]>
  • Loading branch information
mikeee committed Nov 5, 2024
1 parent acbd239 commit bd59a6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 0 additions & 6 deletions client/conversation.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ type ConversationInput struct {
ScrubPII *bool // Scrub PII from the input
}

type ConversationInputOption func(*ConversationInput)

func NewConversationInput(message string, opts ...ConversationInputOption) ConversationInput {
return ConversationInput{}
}

type ConversationResponse struct {
ContextID string
Outputs []ConversationResult
Expand Down
12 changes: 10 additions & 2 deletions examples/conversation/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ func main() {
panic(err)
}

resp, err := client.ConverseAlpha1(context.Background(), "echo", []dapr.ConversationInput{{Message: "hello"}})
input := dapr.ConversationInput{
Message: "hello world",
// Role: nil, // Optional
// ScrubPII: nil, // Optional
}

var conversationComponent = "echo"

resp, err := client.ConverseAlpha1(context.Background(), conversationComponent, []dapr.ConversationInput{input})
if err != nil {
log.Fatalf("err: %v", err)
}

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

0 comments on commit bd59a6f

Please sign in to comment.