第一次提交:阿龙电竞 Django 后端最新版本

This commit is contained in:
XingQue
2026-06-14 02:23:24 +08:00
commit 4f7bf00224
9654 changed files with 5417000 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 内部错误。
INTERNALERROR = 'InternalError'
# 参数错误。
INVALIDPARAMETER = 'InvalidParameter'
# 参数取值错误。
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
# 超过配额限制。
LIMITEXCEEDED = 'LimitExceeded'
# 缺少参数错误。
MISSINGPARAMETER = 'MissingParameter'
# 请求的次数超过了频率限制。
REQUESTLIMITEXCEEDED = 'RequestLimitExceeded'
# 资源不存在。
RESOURCENOTFOUND = 'ResourceNotFound'
# 未授权操作。
UNAUTHORIZEDOPERATION = 'UnauthorizedOperation'
# 未知参数错误。
UNKNOWNPARAMETER = 'UnknownParameter'
# 操作不支持。
UNSUPPORTEDOPERATION = 'UnsupportedOperation'

View File

@@ -0,0 +1,256 @@
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.es.v20250101 import models
class EsClient(AbstractClient):
_apiVersion = '2025-01-01'
_endpoint = 'es.tencentcloudapi.com'
_service = 'es'
def ChatCompletions(self, request):
r"""本服务支持一系列高性能的大语言模型包括DeepSeek以及腾讯自主研发的混元大模型结合混合搜索等先进搜索技术快速高效实现RAG有效解决幻觉和知识更新问题。
本接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for ChatCompletions.
:type request: :class:`tencentcloud.es.v20250101.models.ChatCompletionsRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.ChatCompletionsResponse`
"""
try:
params = request._serialize()
options = {"Endpoint": "%s://es.ai.tencentcloudapi.com" % self.profile.httpProfile.scheme}
return self._call_and_deserialize("ChatCompletions", params, models.ChatCompletionsResponse, headers=request.headers, options=options)
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def ChunkDocument(self, request):
r"""文本切片是将长文本分割为短片段的技术用于适配模型输入、提升处理效率或信息检索平衡片段长度与语义连贯性适用于NLP、数据分析等场景。
本接口为分隔符规则切片接口,有单账号调用上限控制,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for ChunkDocument.
:type request: :class:`tencentcloud.es.v20250101.models.ChunkDocumentRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.ChunkDocumentResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("ChunkDocument", params, headers=headers)
response = json.loads(body)
model = models.ChunkDocumentResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def ChunkDocumentAsync(self, request):
r"""文本切片是将长文本分割为短片段的技术用于适配模型输入、提升处理效率或信息检索平衡片段长度与语义连贯性适用于NLP、数据分析等场景。
本接口为异步接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for ChunkDocumentAsync.
:type request: :class:`tencentcloud.es.v20250101.models.ChunkDocumentAsyncRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.ChunkDocumentAsyncResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("ChunkDocumentAsync", params, headers=headers)
response = json.loads(body)
model = models.ChunkDocumentAsyncResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetDocumentChunkResult(self, request):
r"""获取文档切片结果
:param request: Request instance for GetDocumentChunkResult.
:type request: :class:`tencentcloud.es.v20250101.models.GetDocumentChunkResultRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.GetDocumentChunkResultResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetDocumentChunkResult", params, headers=headers)
response = json.loads(body)
model = models.GetDocumentChunkResultResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetDocumentParseResult(self, request):
r"""本接口用于获取文档解析异步处理结果。
:param request: Request instance for GetDocumentParseResult.
:type request: :class:`tencentcloud.es.v20250101.models.GetDocumentParseResultRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.GetDocumentParseResultResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetDocumentParseResult", params, headers=headers)
response = json.loads(body)
model = models.GetDocumentParseResultResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetMultiModalEmbedding(self, request):
r"""Embedding是一种将高维数据映射到低维空间的技术通常用于将非结构化数据如文本、图像或音频转化为向量表示使其更容易输入机器模型进行处理并且向量之间的距离可以反映对象之间的相似性。
本接口有模型维度调用上限控制单个模型qps限制10如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for GetMultiModalEmbedding.
:type request: :class:`tencentcloud.es.v20250101.models.GetMultiModalEmbeddingRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.GetMultiModalEmbeddingResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetMultiModalEmbedding", params, headers=headers)
response = json.loads(body)
model = models.GetMultiModalEmbeddingResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def GetTextEmbedding(self, request):
r"""Embedding是一种将高维数据映射到低维空间的技术通常用于将非结构化数据如文本、图像或音频转化为向量表示使其更容易输入机器模型进行处理并且向量之间的距离可以反映对象之间的相似性。
本接口有模型维度调用上限控制单个模型qps限制20如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for GetTextEmbedding.
:type request: :class:`tencentcloud.es.v20250101.models.GetTextEmbeddingRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.GetTextEmbeddingResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("GetTextEmbedding", params, headers=headers)
response = json.loads(body)
model = models.GetTextEmbeddingResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def ParseDocument(self, request):
r"""本服务可将各类格式文档精准转换为标准格式,满足企业知识库建设、技术文档迁移、内容平台结构化存储等需求。
本接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for ParseDocument.
:type request: :class:`tencentcloud.es.v20250101.models.ParseDocumentRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.ParseDocumentResponse`
"""
try:
params = request._serialize()
options = {"Endpoint": "%s://es.ai.tencentcloudapi.com" % self.profile.httpProfile.scheme}
return self._call_and_deserialize("ParseDocument", params, models.ParseDocumentResponse, headers=request.headers, options=options)
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def ParseDocumentAsync(self, request):
r"""本服务可将各类格式文档精准转换为标准格式,满足企业知识库建设、技术文档迁移、内容平台结构化存储等需求。
本接口为异步接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for ParseDocumentAsync.
:type request: :class:`tencentcloud.es.v20250101.models.ParseDocumentAsyncRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.ParseDocumentAsyncResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("ParseDocumentAsync", params, headers=headers)
response = json.loads(body)
model = models.ParseDocumentAsyncResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def RunRerank(self, request):
r"""重排是指在 RAG 过程中,通过评估文档与查询之间的相关性,将最相关的文档放在前面,确保语言模型在生成回答时优先考虑排名靠前的上下文,提高生成结果的准确性和可信度,也可以通过这种方式进行过滤,减少大模型成本。
本接口有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
:param request: Request instance for RunRerank.
:type request: :class:`tencentcloud.es.v20250101.models.RunRerankRequest`
:rtype: :class:`tencentcloud.es.v20250101.models.RunRerankResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("RunRerank", params, headers=headers)
response = json.loads(body)
model = models.RunRerankResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))

View File

@@ -0,0 +1,216 @@
# -*- coding: utf8 -*-
# Copyright (c) 2017-2025 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from tencentcloud.common.abstract_client_async import AbstractClient
from tencentcloud.es.v20250101 import models
from typing import Dict
class EsClient(AbstractClient):
_apiVersion = '2025-01-01'
_endpoint = 'es.tencentcloudapi.com'
_service = 'es'
async def ChatCompletions(
self,
request: models.ChatCompletionsRequest,
opts: Dict = None,
) -> models.ChatCompletionsResponse:
"""
本服务支持一系列高性能的大语言模型包括DeepSeek以及腾讯自主研发的混元大模型结合混合搜索等先进搜索技术快速高效实现RAG有效解决幻觉和知识更新问题。
本接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "ChatCompletions"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ChatCompletionsResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
kwargs["opts"]["Endpoint"] = "%s://es.ai.tencentcloudapi.com" % self.profile.httpProfile.scheme
return await self.call_and_deserialize(**kwargs)
async def ChunkDocument(
self,
request: models.ChunkDocumentRequest,
opts: Dict = None,
) -> models.ChunkDocumentResponse:
"""
文本切片是将长文本分割为短片段的技术用于适配模型输入、提升处理效率或信息检索平衡片段长度与语义连贯性适用于NLP、数据分析等场景。
本接口为分隔符规则切片接口,有单账号调用上限控制,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "ChunkDocument"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ChunkDocumentResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def ChunkDocumentAsync(
self,
request: models.ChunkDocumentAsyncRequest,
opts: Dict = None,
) -> models.ChunkDocumentAsyncResponse:
"""
文本切片是将长文本分割为短片段的技术用于适配模型输入、提升处理效率或信息检索平衡片段长度与语义连贯性适用于NLP、数据分析等场景。
本接口为异步接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "ChunkDocumentAsync"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ChunkDocumentAsyncResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetDocumentChunkResult(
self,
request: models.GetDocumentChunkResultRequest,
opts: Dict = None,
) -> models.GetDocumentChunkResultResponse:
"""
获取文档切片结果
"""
kwargs = {}
kwargs["action"] = "GetDocumentChunkResult"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetDocumentChunkResultResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetDocumentParseResult(
self,
request: models.GetDocumentParseResultRequest,
opts: Dict = None,
) -> models.GetDocumentParseResultResponse:
"""
本接口用于获取文档解析异步处理结果。
"""
kwargs = {}
kwargs["action"] = "GetDocumentParseResult"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetDocumentParseResultResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetMultiModalEmbedding(
self,
request: models.GetMultiModalEmbeddingRequest,
opts: Dict = None,
) -> models.GetMultiModalEmbeddingResponse:
"""
Embedding是一种将高维数据映射到低维空间的技术通常用于将非结构化数据如文本、图像或音频转化为向量表示使其更容易输入机器模型进行处理并且向量之间的距离可以反映对象之间的相似性。
本接口有模型维度调用上限控制单个模型qps限制10如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "GetMultiModalEmbedding"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetMultiModalEmbeddingResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def GetTextEmbedding(
self,
request: models.GetTextEmbeddingRequest,
opts: Dict = None,
) -> models.GetTextEmbeddingResponse:
"""
Embedding是一种将高维数据映射到低维空间的技术通常用于将非结构化数据如文本、图像或音频转化为向量表示使其更容易输入机器模型进行处理并且向量之间的距离可以反映对象之间的相似性。
本接口有模型维度调用上限控制单个模型qps限制20如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "GetTextEmbedding"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.GetTextEmbeddingResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def ParseDocument(
self,
request: models.ParseDocumentRequest,
opts: Dict = None,
) -> models.ParseDocumentResponse:
"""
本服务可将各类格式文档精准转换为标准格式,满足企业知识库建设、技术文档迁移、内容平台结构化存储等需求。
本接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "ParseDocument"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ParseDocumentResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
kwargs["opts"]["Endpoint"] = "%s://es.ai.tencentcloudapi.com" % self.profile.httpProfile.scheme
return await self.call_and_deserialize(**kwargs)
async def ParseDocumentAsync(
self,
request: models.ParseDocumentAsyncRequest,
opts: Dict = None,
) -> models.ParseDocumentAsyncResponse:
"""
本服务可将各类格式文档精准转换为标准格式,满足企业知识库建设、技术文档迁移、内容平台结构化存储等需求。
本接口为异步接口有模型维度调用上限控制单个模型qps限制5如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "ParseDocumentAsync"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.ParseDocumentAsyncResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)
async def RunRerank(
self,
request: models.RunRerankRequest,
opts: Dict = None,
) -> models.RunRerankResponse:
"""
重排是指在 RAG 过程中,通过评估文档与查询之间的相关性,将最相关的文档放在前面,确保语言模型在生成回答时优先考虑排名靠前的上下文,提高生成结果的准确性和可信度,也可以通过这种方式进行过滤,减少大模型成本。
本接口有单账号调用上限控制,如您有提高并发限制的需求请[联系我们](https://cloud.tencent.com/act/event/Online_service) 。
"""
kwargs = {}
kwargs["action"] = "RunRerank"
kwargs["params"] = request._serialize()
kwargs["resp_cls"] = models.RunRerankResponse
kwargs["headers"] = request.headers
kwargs["opts"] = opts or {}
return await self.call_and_deserialize(**kwargs)

File diff suppressed because it is too large Load Diff