# Code generated by lark_sdk_gen. DO NOT EDIT.

from pylark.lark_request import RawRequestReq, _new_method_option
import attr
import typing
import io


@attr.s
class DetectTextLanguageReq(object):
    text: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 需要被识别语种的文本, 示例值："你好"


@attr.s
class DetectTextLanguageResp(object):
    language: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 识别的文本语种，返回符合 ISO 693-1 标准


def _gen_detect_text_language_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=DetectTextLanguageResp,
        scope="AI",
        api="DetectTextLanguage",
        method="POST",
        url="https://open.feishu.cn/open-apis/translation/v1/text/detect",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
