MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / __init__

Method __init__

pdf2zh/translator.py:202–208  ·  view source on GitHub ↗
(self, lang_in, lang_out, model, ignore_cache=False, **kwargs)

Source from the content-addressed store, hash-verified

200 lang_map = {"zh": "zh-Hans"}
201
202 def __init__(self, lang_in, lang_out, model, ignore_cache=False, **kwargs):
203 super().__init__(lang_in, lang_out, model, ignore_cache)
204 self.session = requests.Session()
205 self.endpoint = "https://www.bing.com/translator"
206 self.headers = {
207 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0", # noqa: E501
208 }
209
210 def find_sid(self):
211 response = self.session.get(self.endpoint)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected