samples: add sample code for ConversationProfile, Conversation and Participant#832
samples: add sample code for ConversationProfile, Conversation and Participant#832chingor13 merged 20 commits intogoogleapis:mainfrom deliaqi:main
Conversation
|
Here is the summary of changes. You are about to add 3 region tags.
This comment is generated by snippet-bot.
|
chingor13
left a comment
There was a problem hiding this comment.
I think according to the guidelines, you should add a static main method with sample values.
|
Hi Jeff, could you review the updated code again? Let me know if you have other comments! |
|
Try to add sample code that requires less long-alive resources first after discussing with @chingor13. The starting point can be sample code for ConversationProfile, Conversation and Participant. |
lesv
left a comment
There was a problem hiding this comment.
- Region Tags are missing
- Tests can be in a single file if that makes things easier.
- Never
System.setOut(null); - Please read SAMPLE_FORMAT
| SuggestionFeatureConfig articleSuggestionFeatureConfig = | ||
| SuggestionFeatureConfig.newBuilder() | ||
| .setSuggestionFeature( | ||
| SuggestionFeature.newBuilder().setType(Type.ARTICLE_SUGGESTION).build()) | ||
| .setSuggestionTriggerSettings( | ||
| SuggestionTriggerSettings.newBuilder() | ||
| .setNoSmalltalk(true) | ||
| .setOnlyEndUser(true) | ||
| .build()) | ||
| .setQueryConfig( | ||
| SuggestionQueryConfig.newBuilder() | ||
| .setKnowledgeBaseQuerySource( | ||
| KnowledgeBaseQuerySource.newBuilder() | ||
| .addKnowledgeBases(articleSuggestionKbName.toString())) | ||
| .setMaxResults(3) | ||
| .build()) | ||
| .build(); |
There was a problem hiding this comment.
Wow - that looks complicated. Is there an easier way to present this since we are trying to teach users here?
There was a problem hiding this comment.
Functionality-wise, it's hard to simplify it as we should include such nested configurations to make the feature work, but we can improve the readability by adding variables one by one and also add more descriptions.
| deleteConversationProfile(conversationProfileNameToDelete); | ||
| conversationProfileNameToDelete = null; |
There was a problem hiding this comment.
It looks like a failure will leave a lot of conversation Profile's around. Perhaps you'd like to make things a bit more robust.
There was a problem hiding this comment.
It could be mitigated by checking conversationProfileNameToDelete during tearDown. Do you have other suggestions?
There was a problem hiding this comment.
We often look for >24h old resources in the setUp() method and delete them. That way if we crash, they are eventually removed.
|
|
@deliaqi Please internally visit github/ and join |
Thanks, done! |
|
Assuming owlbot runs, you should be able to merge. |
Hi, this is Jiaqi Liu from CCAI - Assist and Knowledge team. We are trying to add java sample code for APIs related to CCAI-features, like answer record management and conversation management. This is the first PR for updating answer record, could you help with reviewing it? Let me know anything else needed for checking in the code. Thanks!