✨ feat: 灵台引擎 gRPC 独立服务形态(ADR-017 双形态落地)

- proto(engine/proto/liushen/v1):LingtaiEngine 九方法——GetEngineInfo(版本协商/能力位)、TransformMarkdown、RebuildExport(UNIMPLEMENTED 明示随 WP-03)、OpenStream 双向流、CheckBudget、RerankRecall、EvaluatePolicy、ValidateUrl、CheckStateTransition;RunStatus 枚举与契约一致
- 服务端参考实现(engine/server/lingtai_server.py):进程内直链 nanobind 引擎核心——双形态同核同 golden;开发档 127.0.0.1 明文(生产 mTLS,文案明示);状态转换表按 agent-runtime 第 3 节
- 集成测试 6 项:进程内随机端口起服——版本协商、双形态 golden(服务输出==进程内引擎输出,ADR-017 核心不变量首次实证)、双向流 envelope 序号单调、决策表/URL/状态机、RebuildExport UNIMPLEMENTED 明确拒绝(不伪造)
- Makefile:lingtai-proto(stub 再生)与 lingtai-server(启动服务)目标
- 注:C++ 原生二进制(hunjing-lingtai-server)随交叉编译矩阵交付;Python 参考实现保证 proto 与语义先行锁定
- 测试 102 项全绿(+6);ruff/mypy 干净
This commit is contained in:
chenxin committed 2026-09-14 10:21:54 +08:00
1 parent a39cec5287
commit 9dafb8fe72
10 files changed
+1141

No files matched your search

Whitespace-only changes.
@@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: liushen/v1/liushen.proto
# Protobuf Python Version: 7.35.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(
_runtime_version.Domain.PUBLIC,
7,
35,
1,
'',
'liushen/v1/liushen.proto'
)
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18liushen/v1/liushen.proto\x12\nliushen.v1\"\x16\n\x14GetEngineInfoRequest\"p\n\x15GetEngineInfoResponse\x12\x11\n\tabi_major\x18\x01 \x01(\r\x12\x16\n\x0eparser_version\x18\x02 \x01(\t\x12\x16\n\x0e\x65ngine_version\x18\x03 \x01(\t\x12\x14\n\x0c\x63\x61pabilities\x18\x04 \x03(\t\",\n\x18TransformMarkdownRequest\x12\x10\n\x08markdown\x18\x01 \x01(\t\"3\n\x19TransformMarkdownResponse\x12\x16\n\x0e\x63\x61nonical_json\x18\x01 \x01(\t\".\n\x14RebuildExportRequest\x12\x16\n\x0e\x63\x61nonical_json\x18\x01 \x01(\t\")\n\x15RebuildExportResponse\x12\x10\n\x08markdown\x18\x01 \x01(\t\"E\n\x0bStreamFrame\x12\x17\n\rblock_started\x18\x02 \x01(\tH\x00\x12\x14\n\ntext_delta\x18\x03 \x01(\tH\x00\x42\x07\n\x05\x66rame\"!\n\x0bStreamEvent\x12\x12\n\nevent_json\x18\x01 \x01(\t\"3\n\x12\x43heckBudgetRequest\x12\x0c\n\x04used\x18\x01 \x01(\x03\x12\x0f\n\x07maximum\x18\x02 \x01(\x03\"6\n\x13\x43heckBudgetResponse\x12\x0f\n\x07\x61llowed\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\".\n\x13RerankRecallRequest\x12\x17\n\x0f\x63\x61ndidates_json\x18\x01 \x01(\t\"+\n\x14RerankRecallResponse\x12\x13\n\x0branked_json\x18\x01 \x01(\t\"C\n\x15\x45valuatePolicyRequest\x12\x16\n\x0e\x61utonomy_level\x18\x01 \x01(\x05\x12\x12\n\nrisk_level\x18\x02 \x01(\x05\"*\n\x16\x45valuatePolicyResponse\x12\x10\n\x08\x64\x65\x63ision\x18\x01 \x01(\x05\"!\n\x12ValidateUrlRequest\x12\x0b\n\x03url\x18\x01 \x01(\t\"6\n\x13ValidateUrlResponse\x12\x0f\n\x07\x61llowed\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\"e\n\x1b\x43heckStateTransitionRequest\x12#\n\x04\x66rom\x18\x01 \x01(\x0e\x32\x15.liushen.v1.RunStatus\x12!\n\x02to\x18\x02 \x01(\x0e\x32\x15.liushen.v1.RunStatus\"=\n\x1c\x43heckStateTransitionResponse\x12\r\n\x05valid\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t*\xc2\x01\n\tRunStatus\x12\x1a\n\x16RUN_STATUS_UNSPECIFIED\x10\x00\x12\x15\n\x11RUN_STATUS_QUEUED\x10\x01\x12\x16\n\x12RUN_STATUS_RUNNING\x10\x02\x12\x1f\n\x1bRUN_STATUS_WAITING_APPROVAL\x10\x03\x12\x18\n\x14RUN_STATUS_COMPLETED\x10\x04\x12\x15\n\x11RUN_STATUS_FAILED\x10\x05\x12\x18\n\x14RUN_STATUS_CANCELLED\x10\x06\x32\x98\x06\n\rLingtaiEngine\x12T\n\rGetEngineInfo\x12 .liushen.v1.GetEngineInfoRequest\x1a!.liushen.v1.GetEngineInfoResponse\x12`\n\x11TransformMarkdown\x12$.liushen.v1.TransformMarkdownRequest\x1a%.liushen.v1.TransformMarkdownResponse\x12T\n\rRebuildExport\x12 .liushen.v1.RebuildExportRequest\x1a!.liushen.v1.RebuildExportResponse\x12\x42\n\nOpenStream\x12\x17.liushen.v1.StreamFrame\x1a\x17.liushen.v1.StreamEvent(\x01\x30\x01\x12N\n\x0b\x43heckBudget\x12\x1e.liushen.v1.CheckBudgetRequest\x1a\x1f.liushen.v1.CheckBudgetResponse\x12Q\n\x0cRerankRecall\x12\x1f.liushen.v1.RerankRecallRequest\x1a .liushen.v1.RerankRecallResponse\x12W\n\x0e\x45valuatePolicy\x12!.liushen.v1.EvaluatePolicyRequest\x1a\".liushen.v1.EvaluatePolicyResponse\x12N\n\x0bValidateUrl\x12\x1e.liushen.v1.ValidateUrlRequest\x1a\x1f.liushen.v1.ValidateUrlResponse\x12i\n\x14\x43heckStateTransition\x12\'.liushen.v1.CheckStateTransitionRequest\x1a(.liushen.v1.CheckStateTransitionResponseb\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'liushen.v1.liushen_pb2', _globals)
if not _descriptor._USE_C_DESCRIPTORS:
DESCRIPTOR._loaded_options = None
_globals['_RUNSTATUS']._serialized_start=1047
_globals['_RUNSTATUS']._serialized_end=1241
_globals['_GETENGINEINFOREQUEST']._serialized_start=40
_globals['_GETENGINEINFOREQUEST']._serialized_end=62
_globals['_GETENGINEINFORESPONSE']._serialized_start=64
_globals['_GETENGINEINFORESPONSE']._serialized_end=176
_globals['_TRANSFORMMARKDOWNREQUEST']._serialized_start=178
_globals['_TRANSFORMMARKDOWNREQUEST']._serialized_end=222
_globals['_TRANSFORMMARKDOWNRESPONSE']._serialized_start=224
_globals['_TRANSFORMMARKDOWNRESPONSE']._serialized_end=275
_globals['_REBUILDEXPORTREQUEST']._serialized_start=277
_globals['_REBUILDEXPORTREQUEST']._serialized_end=323
_globals['_REBUILDEXPORTRESPONSE']._serialized_start=325
_globals['_REBUILDEXPORTRESPONSE']._serialized_end=366
_globals['_STREAMFRAME']._serialized_start=368
_globals['_STREAMFRAME']._serialized_end=437
_globals['_STREAMEVENT']._serialized_start=439
_globals['_STREAMEVENT']._serialized_end=472
_globals['_CHECKBUDGETREQUEST']._serialized_start=474
_globals['_CHECKBUDGETREQUEST']._serialized_end=525
_globals['_CHECKBUDGETRESPONSE']._serialized_start=527
_globals['_CHECKBUDGETRESPONSE']._serialized_end=581
_globals['_RERANKRECALLREQUEST']._serialized_start=583
_globals['_RERANKRECALLREQUEST']._serialized_end=629
_globals['_RERANKRECALLRESPONSE']._serialized_start=631
_globals['_RERANKRECALLRESPONSE']._serialized_end=674
_globals['_EVALUATEPOLICYREQUEST']._serialized_start=676
_globals['_EVALUATEPOLICYREQUEST']._serialized_end=743
_globals['_EVALUATEPOLICYRESPONSE']._serialized_start=745
_globals['_EVALUATEPOLICYRESPONSE']._serialized_end=787
_globals['_VALIDATEURLREQUEST']._serialized_start=789
_globals['_VALIDATEURLREQUEST']._serialized_end=822
_globals['_VALIDATEURLRESPONSE']._serialized_start=824
_globals['_VALIDATEURLRESPONSE']._serialized_end=878
_globals['_CHECKSTATETRANSITIONREQUEST']._serialized_start=880
_globals['_CHECKSTATETRANSITIONREQUEST']._serialized_end=981
_globals['_CHECKSTATETRANSITIONRESPONSE']._serialized_start=983
_globals['_CHECKSTATETRANSITIONRESPONSE']._serialized_end=1044
_globals['_LINGTAIENGINE']._serialized_start=1244
_globals['_LINGTAIENGINE']._serialized_end=2036
# @@protoc_insertion_point(module_scope)
@@ -0,0 +1,459 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings
from liushen.v1 import liushen_pb2 as liushen_dot_v1_dot_liushen__pb2
GRPC_GENERATED_VERSION = '1.83.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False
try:
from grpc._utilities import first_version_is_lower
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
_version_not_supported = True
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ ' but the generated code in liushen/v1/liushen_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
)
class LingtaiEngineStub:
"""灵台引擎独立服务形态(契约 docs/contracts/lingtai-service.md)。
部署内部网络专用;错误映射见契约第 6 节。字段语义与进程内 C ABI JSON 边界同源。
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetEngineInfo = channel.unary_unary(
'/liushen.v1.LingtaiEngine/GetEngineInfo',
request_serializer=liushen_dot_v1_dot_liushen__pb2.GetEngineInfoRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.GetEngineInfoResponse.FromString,
_registered_method=True)
self.TransformMarkdown = channel.unary_unary(
'/liushen.v1.LingtaiEngine/TransformMarkdown',
request_serializer=liushen_dot_v1_dot_liushen__pb2.TransformMarkdownRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.TransformMarkdownResponse.FromString,
_registered_method=True)
self.RebuildExport = channel.unary_unary(
'/liushen.v1.LingtaiEngine/RebuildExport',
request_serializer=liushen_dot_v1_dot_liushen__pb2.RebuildExportRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.RebuildExportResponse.FromString,
_registered_method=True)
self.OpenStream = channel.stream_stream(
'/liushen.v1.LingtaiEngine/OpenStream',
request_serializer=liushen_dot_v1_dot_liushen__pb2.StreamFrame.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.StreamEvent.FromString,
_registered_method=True)
self.CheckBudget = channel.unary_unary(
'/liushen.v1.LingtaiEngine/CheckBudget',
request_serializer=liushen_dot_v1_dot_liushen__pb2.CheckBudgetRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.CheckBudgetResponse.FromString,
_registered_method=True)
self.RerankRecall = channel.unary_unary(
'/liushen.v1.LingtaiEngine/RerankRecall',
request_serializer=liushen_dot_v1_dot_liushen__pb2.RerankRecallRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.RerankRecallResponse.FromString,
_registered_method=True)
self.EvaluatePolicy = channel.unary_unary(
'/liushen.v1.LingtaiEngine/EvaluatePolicy',
request_serializer=liushen_dot_v1_dot_liushen__pb2.EvaluatePolicyRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.EvaluatePolicyResponse.FromString,
_registered_method=True)
self.ValidateUrl = channel.unary_unary(
'/liushen.v1.LingtaiEngine/ValidateUrl',
request_serializer=liushen_dot_v1_dot_liushen__pb2.ValidateUrlRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.ValidateUrlResponse.FromString,
_registered_method=True)
self.CheckStateTransition = channel.unary_unary(
'/liushen.v1.LingtaiEngine/CheckStateTransition',
request_serializer=liushen_dot_v1_dot_liushen__pb2.CheckStateTransitionRequest.SerializeToString,
response_deserializer=liushen_dot_v1_dot_liushen__pb2.CheckStateTransitionResponse.FromString,
_registered_method=True)
class LingtaiEngineServicer:
"""灵台引擎独立服务形态(契约 docs/contracts/lingtai-service.md)。
部署内部网络专用;错误映射见契约第 6 节。字段语义与进程内 C ABI JSON 边界同源。
"""
def GetEngineInfo(self, request, context):
"""版本、ABI major、parser version、能力位
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TransformMarkdown(self, request, context):
"""Markdown → canonical ContentBlock JSON
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RebuildExport(self, request, context):
"""canonical Block → 可移植 Markdown 重建(预留:实现随 WP-03 导出)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def OpenStream(self, request_iterator, context):
"""双向流:宿主喂增量,服务回 content.block.* envelope JSON
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CheckBudget(self, request, context):
"""计划 DAG 预算核算(最小:标量预算)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def RerankRecall(self, request, context):
"""候选确定性重排
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EvaluatePolicy(self, request, context):
"""四维裁决(autonomy × risk)
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ValidateUrl(self, request, context):
"""URL 协议白名单校验
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CheckStateTransition(self, request, context):
"""Run/Turn 状态转换合法性
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_LingtaiEngineServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetEngineInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetEngineInfo,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.GetEngineInfoRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.GetEngineInfoResponse.SerializeToString,
),
'TransformMarkdown': grpc.unary_unary_rpc_method_handler(
servicer.TransformMarkdown,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.TransformMarkdownRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.TransformMarkdownResponse.SerializeToString,
),
'RebuildExport': grpc.unary_unary_rpc_method_handler(
servicer.RebuildExport,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.RebuildExportRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.RebuildExportResponse.SerializeToString,
),
'OpenStream': grpc.stream_stream_rpc_method_handler(
servicer.OpenStream,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.StreamFrame.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.StreamEvent.SerializeToString,
),
'CheckBudget': grpc.unary_unary_rpc_method_handler(
servicer.CheckBudget,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.CheckBudgetRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.CheckBudgetResponse.SerializeToString,
),
'RerankRecall': grpc.unary_unary_rpc_method_handler(
servicer.RerankRecall,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.RerankRecallRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.RerankRecallResponse.SerializeToString,
),
'EvaluatePolicy': grpc.unary_unary_rpc_method_handler(
servicer.EvaluatePolicy,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.EvaluatePolicyRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.EvaluatePolicyResponse.SerializeToString,
),
'ValidateUrl': grpc.unary_unary_rpc_method_handler(
servicer.ValidateUrl,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.ValidateUrlRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.ValidateUrlResponse.SerializeToString,
),
'CheckStateTransition': grpc.unary_unary_rpc_method_handler(
servicer.CheckStateTransition,
request_deserializer=liushen_dot_v1_dot_liushen__pb2.CheckStateTransitionRequest.FromString,
response_serializer=liushen_dot_v1_dot_liushen__pb2.CheckStateTransitionResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'liushen.v1.LingtaiEngine', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
server.add_registered_method_handlers('liushen.v1.LingtaiEngine', rpc_method_handlers)
# This class is part of an EXPERIMENTAL API.
class LingtaiEngine:
"""灵台引擎独立服务形态(契约 docs/contracts/lingtai-service.md)。
部署内部网络专用;错误映射见契约第 6 节。字段语义与进程内 C ABI JSON 边界同源。
"""
@staticmethod
def GetEngineInfo(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/GetEngineInfo',
liushen_dot_v1_dot_liushen__pb2.GetEngineInfoRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.GetEngineInfoResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def TransformMarkdown(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/TransformMarkdown',
liushen_dot_v1_dot_liushen__pb2.TransformMarkdownRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.TransformMarkdownResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def RebuildExport(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/RebuildExport',
liushen_dot_v1_dot_liushen__pb2.RebuildExportRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.RebuildExportResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def OpenStream(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(
request_iterator,
target,
'/liushen.v1.LingtaiEngine/OpenStream',
liushen_dot_v1_dot_liushen__pb2.StreamFrame.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.StreamEvent.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def CheckBudget(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/CheckBudget',
liushen_dot_v1_dot_liushen__pb2.CheckBudgetRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.CheckBudgetResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def RerankRecall(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/RerankRecall',
liushen_dot_v1_dot_liushen__pb2.RerankRecallRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.RerankRecallResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def EvaluatePolicy(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/EvaluatePolicy',
liushen_dot_v1_dot_liushen__pb2.EvaluatePolicyRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.EvaluatePolicyResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def ValidateUrl(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/ValidateUrl',
liushen_dot_v1_dot_liushen__pb2.ValidateUrlRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.ValidateUrlResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def CheckStateTransition(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(
request,
target,
'/liushen.v1.LingtaiEngine/CheckStateTransition',
liushen_dot_v1_dot_liushen__pb2.CheckStateTransitionRequest.SerializeToString,
liushen_dot_v1_dot_liushen__pb2.CheckStateTransitionResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)