仪评指标联分析模块

This commit is contained in:
BBIT-Kai
2025-09-24 13:59:00 +08:00
parent 0ab82b00d6
commit d2775f60a7
28 changed files with 1106 additions and 181 deletions
+3
View File
@@ -0,0 +1,3 @@
SERVER_PATH_OSS = "s1.ronsunny.cn"
F8_SERVER_USER_ID = "da33efb9-776a-443b-b1ec-dbbbf08793d7"
+8 -3
View File
@@ -6,6 +6,8 @@ from langchain_openai import ChatOpenAI
from openai import OpenAI
import os
from langchain_openai import OpenAIEmbeddings
from langchain_community.embeddings import DashScopeEmbeddings
# 通义千文Key
tongyiKey = "sk-9464b2498c184982a9fe9d2c2e725ab5"
# DeepSeekKey
@@ -18,13 +20,16 @@ llmThink = ChatOpenAI(
api_key=tongyiKey,
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
model="qwen-max",
stream = False
)
from langchain_community.embeddings import DashScopeEmbeddings
embeddings = DashScopeEmbeddings(
llmEmbeddings = DashScopeEmbeddings(
model="text-embedding-v3",
dashscope_api_key= tongyiKey,
)
llmVision = ChatOpenAI(
api_key=tongyiKey,
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
model="qwen-vl-plus",
)
# from langchain_deepseek import ChatDeepSeek
# llm = ChatDeepSeek(
+3 -3
View File
@@ -1,10 +1,10 @@
from langchain_milvus import BM25BuiltInFunction, Milvus
from config.llm import embeddings
from config.llm import llmEmbeddings
URI = "http://10.10.10.9:19530"
knVectorstore = Milvus(
embedding_function=embeddings,
embedding_function=llmEmbeddings,
connection_args={"uri": URI, "token": "root:Milvus", "db_name": "bbit_ai_lab"},
collection_name="knowledge",
index_params={"index_type": "FLAT", "metric_type": "L2"},
@@ -19,7 +19,7 @@ knVectorstore = Milvus(
drop_old=False, # set to True if seeking to drop the collection with that name if it exists
)
memVectorstore = Milvus(
embedding_function=embeddings,
embedding_function=llmEmbeddings,
connection_args={"uri": URI, "token": "root:Milvus", "db_name": "bbit_ai_lab"},
collection_name="memory",
index_params={"index_type": "FLAT", "metric_type": "L2"},
+27
View File
@@ -0,0 +1,27 @@
from datetime import timedelta
from minio import Minio
# MinIO 客户端初始化
minio_client = Minio(
"s1.ronsunny.cn:9000",
access_key="minioadmin",
secret_key="minioadmin",
secure=False,
)
def push_file(bucket_name, object_name, file_bytes, contents, content_type):
minio_client.put_object(
bucket_name,
object_name,
file_bytes,
length=len(contents),
content_type=content_type,
)
def get_temp_url(bucket_name, object_name):
return minio_client.presigned_get_object(
bucket_name, object_name, expires=timedelta(seconds=3600)
)