11package example .bot ;
22
33import java .util .Arrays ;
4+ import java .util .Collections ;
45
56import com .coze .openapi .client .bots .*;
6- import com .coze .openapi .client .bots .model .BotOnboardingInfo ;
7- import com .coze .openapi .client .bots .model .BotPromptInfo ;
7+ import com .coze .openapi .client .bots .model .*;
88import com .coze .openapi .client .files .UploadFileReq ;
99import com .coze .openapi .client .files .UploadFileResp ;
1010import com .coze .openapi .service .auth .TokenAuth ;
@@ -49,6 +49,25 @@ public static void main(String[] args) {
4949 UploadFileResp avatarInfo = coze .files ().upload (UploadFileReq .of (avatarPath ));
5050 System .out .println (avatarInfo );
5151
52+ // Configuration for the bot's plugins
53+ BotPluginIdInfo pluginIdInfo =
54+ BotPluginIdInfo .builder ()
55+ .apiId (System .getenv ("PLUGIN_API_ID" ))
56+ .pluginId (System .getenv ("PLUGIN_ID" ))
57+ .build ();
58+ BotPluginIdList pluginIdList =
59+ BotPluginIdList .builder ().idList (Collections .singletonList (pluginIdInfo )).build ();
60+
61+ // Configuration for the bot's workflows
62+ BotWorkflowIdInfo workflowIdInfo =
63+ BotWorkflowIdInfo .builder ().id (System .getenv ("WORKFLOW_ID" )).build ();
64+ BotWorkflowIdList workflowIdList =
65+ BotWorkflowIdList .builder ().ids (Collections .singletonList (workflowIdInfo )).build ();
66+
67+ // Configuration for the bot's model
68+ BotModelInfoConfig modelInfoConfig =
69+ BotModelInfoConfig .builder ().modelId (System .getenv ("MODEL_ID" )).build ();
70+
5271 // build the request
5372 CreateBotReq createReq =
5473 CreateBotReq .builder ()
@@ -57,6 +76,9 @@ public static void main(String[] args) {
5776 .name ("the name of your bot" )
5877 .promptInfo (promptInfo )
5978 .onboardingInfo (onboardingInfo )
79+ .pluginIdList (pluginIdList )
80+ .workflowIdList (workflowIdList )
81+ .modelInfoConfig (modelInfoConfig )
6082 .iconFileID (avatarInfo .getFileInfo ().getID ())
6183 .build ();
6284
0 commit comments