protected override void Execute(CodeActivityContext context) { string word1 = Word1.Get(context); string word2 = Word2.Get(context); string apiKey = APIKey.Get(context); string seKey = SecretKey.Get(context); try { var client = new Baidu.Aip.Nlp.Nlp(apiKey, seKey); //修改超时时间 client.Timeout = 60000; //带参数调用词义相似度 string result = client.WordSimEmbedding(word1, word2).ToString(); Result.Set(context, result); } catch (Exception e) { SharedObject.Instance.Output(SharedObject.enOutputType.Error, "有一个错误产生", e.Message); } }