fix: 修复知识库不能创建的问题
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import aiohttp
|
||||
from astrbot import logger
|
||||
from ..provider import RerankProvider
|
||||
from ..register import register_provider_adapter
|
||||
from ..entities import ProviderType, RerankResult
|
||||
@@ -44,6 +45,11 @@ class VLLMRerankProvider(RerankProvider):
|
||||
response_data = await response.json()
|
||||
results = response_data.get("results", [])
|
||||
|
||||
if not results:
|
||||
logger.warning(
|
||||
f"Rerank API 返回了空的列表数据。原始响应: {response_data}"
|
||||
)
|
||||
|
||||
return [
|
||||
RerankResult(
|
||||
index=result["index"],
|
||||
|
||||
@@ -718,10 +718,10 @@ export default {
|
||||
|
||||
createCollection(name, emoji, description) {
|
||||
// 如果 this.newKB.embedding_provider_id 是 Object
|
||||
if (typeof this.newKB.embedding_provider_id === 'object') {
|
||||
if (this.newKB.embedding_provider_id && typeof this.newKB.embedding_provider_id === 'object') {
|
||||
this.newKB.embedding_provider_id = this.newKB.embedding_provider_id.id || '';
|
||||
}
|
||||
if (typeof this.newKB.rerank_provider_id === 'object') {
|
||||
if (this.newKB.rerank_provider_id && typeof this.newKB.rerank_provider_id === 'object') {
|
||||
this.newKB.rerank_provider_id = this.newKB.rerank_provider_id.id || '';
|
||||
}
|
||||
axios.post('/api/plug/alkaid/kb/create_collection', {
|
||||
|
||||
Reference in New Issue
Block a user