Skip to content

Commit 6286e36

Browse files
authored
feat: conversation alpha2 implementation (#766)
* feat: first conversation alpha2 implementation renames the previous example to alpha1 Signed-off-by: Mike Nguyen <[email protected]> * feat: fix conversation alpha 2 outputs Signed-off-by: Mike Nguyen <[email protected]> * fix: cleanup some lint issues and handle tools properly Signed-off-by: Mike Nguyen <[email protected]> * chore: remove builder Signed-off-by: Mike Nguyen <[email protected]> * fix: linter Signed-off-by: Mike Nguyen <[email protected]> * chore: go mod tidy Signed-off-by: Mike Nguyen <[email protected]> * chore(tests): increase timeout Signed-off-by: Mike Nguyen <[email protected]> * fix(tests): conversation-alpha2 run command Also reduces timeouts Signed-off-by: Mike Nguyen <[email protected]> * doc: example typo Signed-off-by: Mike Nguyen <[email protected]> --------- Signed-off-by: Mike Nguyen <[email protected]>
1 parent ef0713a commit 6286e36

File tree

12 files changed

+586
-10
lines changed

12 files changed

+586
-10
lines changed

.github/workflows/validate_examples.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ jobs:
164164
[
165165
"actor",
166166
"configuration",
167-
"conversation",
167+
"conversation-alpha1",
168+
"conversation-alpha2",
168169
"crypto",
169170
"jobs",
170171
"grpc-service",

client/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ type Client interface {
241241
// ConverseAlpha1 interacts with a conversational AI model.
242242
ConverseAlpha1(ctx context.Context, request conversationRequest, options ...conversationRequestOption) (*ConversationResponse, error)
243243

244+
// ConverseAlpha2 interacts with a conversational AI model.
245+
ConverseAlpha2(ctx context.Context, request ConversationRequestAlpha2,
246+
options ...conversationRequestOptionAlpha2) (*ConversationResponseAlpha2, error)
247+
244248
// GrpcClient returns the base grpc client if grpc is used and nil otherwise
245249
GrpcClient() pb.DaprClient
246250

client/client_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,22 @@ func (s *testDaprServer) DeleteJobAlpha1(ctx context.Context, in *pb.DeleteJobRe
538538
return &pb.DeleteJobResponse{}, nil
539539
}
540540

541+
// TODO: remove in 1.17
542+
//
543+
//nolint:staticcheck
544+
func (s *testDaprServer) ConverseAlpha1(ctx context.Context, in *pb.ConversationRequest) (*pb.ConversationResponse,
545+
error,
546+
) {
547+
return &pb.ConversationResponse{}, nil
548+
}
549+
550+
func (s *testDaprServer) ConverseAlpha2(ctx context.Context, in *pb.ConversationRequestAlpha2) (*pb.
551+
ConversationResponseAlpha2,
552+
error,
553+
) {
554+
return &pb.ConversationResponseAlpha2{}, nil
555+
}
556+
541557
func TestGrpcClient(t *testing.T) {
542558
protoClient := pb.NewDaprClient(nil)
543559
client := &GRPCClient{protoClient: protoClient}

0 commit comments

Comments
 (0)