WANGRUI-ZB wangrui Kevin Hu commited on
Commit
b20530c
·
1 Parent(s): 624ceba

Fix BaiduFanyi TestRun parameter validation and debug method missing … (#4275)

Browse files

### What problem does this PR solve?

Fix BaiduFanyi TestRun parameter validation and debug method missing
errors
![Uploading Snipaste_2024-12-27_19-56-31.png…]()


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: wangrui <wangrui@haima.me>
Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>

Files changed (1) hide show
  1. agent/component/baidufanyi.py +1 -3
agent/component/baidufanyi.py CHANGED
@@ -39,9 +39,6 @@ class BaiduFanyiParam(ComponentParamBase):
39
  self.check_empty(self.appid, "BaiduFanyi APPID")
40
  self.check_empty(self.secret_key, "BaiduFanyi Secret Key")
41
  self.check_valid_value(self.trans_type, "Translate type", ['translate', 'fieldtranslate'])
42
- self.check_valid_value(self.trans_type, "Translate domain",
43
- ['it', 'finance', 'machinery', 'senimed', 'novel', 'academic', 'aerospace', 'wiki',
44
- 'news', 'law', 'contract'])
45
  self.check_valid_value(self.source_lang, "Source language",
46
  ['auto', 'zh', 'en', 'yue', 'wyw', 'jp', 'kor', 'fra', 'spa', 'th', 'ara', 'ru', 'pt',
47
  'de', 'it', 'el', 'nl', 'pl', 'bul', 'est', 'dan', 'fin', 'cs', 'rom', 'slo', 'swe',
@@ -96,3 +93,4 @@ class BaiduFanyi(ComponentBase, ABC):
96
 
97
  except Exception as e:
98
  BaiduFanyi.be_output("**Error**:" + str(e))
 
 
39
  self.check_empty(self.appid, "BaiduFanyi APPID")
40
  self.check_empty(self.secret_key, "BaiduFanyi Secret Key")
41
  self.check_valid_value(self.trans_type, "Translate type", ['translate', 'fieldtranslate'])
 
 
 
42
  self.check_valid_value(self.source_lang, "Source language",
43
  ['auto', 'zh', 'en', 'yue', 'wyw', 'jp', 'kor', 'fra', 'spa', 'th', 'ara', 'ru', 'pt',
44
  'de', 'it', 'el', 'nl', 'pl', 'bul', 'est', 'dan', 'fin', 'cs', 'rom', 'slo', 'swe',
 
93
 
94
  except Exception as e:
95
  BaiduFanyi.be_output("**Error**:" + str(e))
96
+