Compare commits
10 Commits
d94d880f6f
...
10040962ad
| Author | SHA1 | Date | |
|---|---|---|---|
| 10040962ad | |||
| ec237e0a86 | |||
| c4db1745c4 | |||
| 193041610e | |||
| 537bb136e9 | |||
| 0a157fa4f9 | |||
| 7e2492dcd6 | |||
| 0118937f77 | |||
| a3c7449dee | |||
| 2afe630c16 |
+2
-2
@@ -9,7 +9,7 @@ LLM_KEY_HUOSHAN=dc7979dc-af60-4700-XXXX-XXXXXXXXXXXX # 火山引擎模型服
|
||||
LLM_KEY_BAILIAN=sk-248f811295914adcad837XXXXXXXXXXX # 阿里云百炼模型服务平台key
|
||||
LLM_KEY_DEEPSEEK=sk-a89d0ff9421a43fca5f0xxxxxxxxxxxx # Deepseek模型服务平台key
|
||||
|
||||
SERVER_PORT = 7004 # 服务启动端口
|
||||
SERVER_ENABLE_CORS = False # 是否允许跨域
|
||||
SERVER_PORT = 7005 # 服务启动端口
|
||||
SERVER_ENABLE_CORS = True # 是否允许跨域
|
||||
SERVER_FILE_SAVE_PATH=/www/wwwroot/web/web/upload_file/ # 文件保存在服务器上的路径
|
||||
SERVER_FILE_PUBLIC_PATH=/web/upload_file/ # 文件在浏览器上的访问路径
|
||||
|
||||
@@ -23,8 +23,8 @@ ai_configs = {
|
||||
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
||||
'key': env.llm_key_huoshan,
|
||||
},
|
||||
'doubao-vision-lite': {
|
||||
'model': 'doubao-1.5-vision-lite-250315',
|
||||
'huoshan-doubao-vision': {
|
||||
'model': 'doubao-1-5-vision-pro-32k-250115',
|
||||
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
||||
'key': env.llm_key_huoshan,
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ from fastapi import FastAPI
|
||||
from sqlmodel import Field, select
|
||||
|
||||
from app.model.BasicModel import BasicModel
|
||||
from app.model.LlmDemoMdel import LlmDemoModel
|
||||
from app.model.LlmDemoModel import LlmDemoModel
|
||||
from app.utils.model_utils import FormattedDatetime
|
||||
from app.utils.mysql_utils import AsyncSessionDep
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from sqlmodel import Field
|
||||
|
||||
from app.model.BasicModel import BasicModel
|
||||
from app.utils.model_utils import FormattedDatetime, FormattedDate, FormattedDecimal
|
||||
|
||||
|
||||
class ResumeTemplateVueModel(BasicModel, table=True):
|
||||
__tablename__ = "llm_resume_template_vue"
|
||||
|
||||
source_code: str | None = Field(default=None, description="简历模板TSX代码")
|
||||
thumb_image: str | None = Field(default=None, description="简历模板缩略图")
|
||||
default_primary: str | None = Field(default=None, description="默认主题色")
|
||||
default_secondary: str | None = Field(default=None, description="默认次级色")
|
||||
@@ -0,0 +1,12 @@
|
||||
from sqlmodel import Field
|
||||
|
||||
from app.model.BasicModel import BasicModel
|
||||
from app.utils.model_utils import FormattedDatetime, FormattedDate, FormattedDecimal
|
||||
|
||||
|
||||
class ResumeUserModel(BasicModel, table=True):
|
||||
__tablename__ = "llm_resume_user"
|
||||
|
||||
source_code: str | None = Field(default=None, description="简历模板TSX代码")
|
||||
thumb_image: str | None = Field(default=None, description="简历模板缩略图")
|
||||
resume_json_string: str | None = Field(default=None, description="简历模板JSON数据")
|
||||
@@ -0,0 +1,12 @@
|
||||
from sqlmodel import Field
|
||||
|
||||
from app.model.BasicModel import BasicModel
|
||||
from app.utils.model_utils import FormattedDatetime, FormattedDate, FormattedDecimal
|
||||
|
||||
|
||||
class ResumeUserVueModel(BasicModel, table=True):
|
||||
__tablename__ = "llm_resume_user_vue"
|
||||
|
||||
source_code: str | None = Field(default=None, description="简历模板TSX代码")
|
||||
thumb_image: str | None = Field(default=None, description="简历模板缩略图")
|
||||
resume_json_string: str | None = Field(default=None, description="简历模板JSON数据")
|
||||
+11
-5
@@ -4,9 +4,12 @@ from app.controller.add_docs_route import add_docs_route
|
||||
from app.controller.add_file_route import add_file_route
|
||||
from app.controller.add_graph_proxy_route import add_graph_proxy_route
|
||||
from app.controller.add_test_route import add_test_route
|
||||
from app.model.LlmDemoMdel import LlmDemoModel
|
||||
from app.model.LlmDemoModel import LlmDemoModel
|
||||
from app.model.ResumeTemplateModel import ResumeTemplateModel
|
||||
from app.utils.add_llm_routes import add_llm_routes
|
||||
from app.model.ResumeTemplateVueModel import ResumeTemplateVueModel
|
||||
from app.model.ResumeUserModel import ResumeUserModel
|
||||
from app.model.ResumeUserVueModel import ResumeUserVueModel
|
||||
from app.utils.add_proxy_routes import add_proxy_routes
|
||||
from app.utils.add_model_routes import add_model_routes
|
||||
from app.utils.next_id import add_next_id_route
|
||||
|
||||
@@ -20,11 +23,14 @@ routes = [
|
||||
add_next_id_route, # 生成ID接口
|
||||
add_file_route, # 文件上传接口
|
||||
|
||||
lambda app: add_llm_routes(app, 'huoshan-doubao'),
|
||||
lambda app: add_llm_routes(app, 'doubao-vision-lite'),
|
||||
lambda app: add_llm_routes(app, 'bailian-qwen3.6-plus'),
|
||||
lambda app: add_proxy_routes(app, 'huoshan-doubao'),
|
||||
lambda app: add_proxy_routes(app, 'huoshan-doubao-vision'),
|
||||
lambda app: add_proxy_routes(app, 'bailian-qwen3.6-plus'),
|
||||
|
||||
lambda app: add_model_routes(app,LlmDemoModel,'/llm_demo'), # LlmDemo 测试用户模块
|
||||
lambda app: add_model_routes(app,ResumeTemplateModel,'/llm_resume_template'), # 简历模板
|
||||
lambda app: add_model_routes(app,ResumeUserModel,'/llm_resume_user'), # 用户简历
|
||||
lambda app: add_model_routes(app,ResumeTemplateVueModel,'/llm_resume_template_vue'),# 简历模板
|
||||
lambda app: add_model_routes(app,ResumeUserVueModel,'/llm_resume_user_vue'), # 用户简历
|
||||
]
|
||||
# /*@formatter:on*/
|
||||
|
||||
@@ -5,6 +5,8 @@ def next_thread_id():
|
||||
return str(uuid.uuid4())
|
||||
|
||||
|
||||
# 用于配置LangServe的add_routes函数的per_req_config_modifier参数
|
||||
# 将请求中的config参数传递给Graph
|
||||
async def PER_REQ_CONFIG_MODIFIER(config, request):
|
||||
body = await request.json()
|
||||
return {
|
||||
|
||||
@@ -58,7 +58,7 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
@router.post('/item')
|
||||
async def _item(body: ItemQuerySchema, session: AsyncSessionDep):
|
||||
"""
|
||||
获取用户详情
|
||||
获取记录详情
|
||||
"""
|
||||
query = select(clazz).where(clazz.id == body.id)
|
||||
result = await session.execute(query)
|
||||
@@ -68,19 +68,19 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
@router.post('/insert')
|
||||
async def _insert(body: InsertBodySchema, session: AsyncSessionDep):
|
||||
"""
|
||||
插入用户
|
||||
插入记录
|
||||
"""
|
||||
new_obj = body.row
|
||||
if not new_obj.id:
|
||||
new_obj.id = str(uuid.uuid4())
|
||||
session.add(new_obj)
|
||||
await session.commit()
|
||||
return new_obj
|
||||
return {"result": new_obj}
|
||||
|
||||
@router.post('/update')
|
||||
async def _update(body: UpdateBodySchema, session: AsyncSessionDep):
|
||||
"""
|
||||
更新用户
|
||||
更新记录
|
||||
"""
|
||||
edit_obj = body.row
|
||||
query = select(clazz).where(clazz.id == edit_obj.id)
|
||||
@@ -100,12 +100,12 @@ def add_model_routes(app: FastAPI, clazz: type[BasicModel], route_prefix: str):
|
||||
setattr(query_cls, field, value)
|
||||
session.add(query_cls)
|
||||
await session.commit()
|
||||
return query_cls
|
||||
return {"result": query_cls}
|
||||
|
||||
@router.post('/delete')
|
||||
async def _delete(body: clazz, session: AsyncSessionDep):
|
||||
"""
|
||||
更新用户
|
||||
删除记录
|
||||
"""
|
||||
query = select(clazz).where(clazz.id == body.id)
|
||||
result = await session.execute(query)
|
||||
|
||||
@@ -46,7 +46,7 @@ async def proxy_openai_request(request: Request, config_key: str):
|
||||
return response.json()
|
||||
|
||||
|
||||
def add_llm_routes(app: FastAPI, config_name: str):
|
||||
def add_proxy_routes(app: FastAPI, config_name: str):
|
||||
"""
|
||||
动态生成路由的辅助函数
|
||||
"""
|
||||
Generated
+1
-2
@@ -442,7 +442,6 @@ description = "Lightweight in-process concurrent programming"
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["main"]
|
||||
markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""
|
||||
files = [
|
||||
{file = "greenlet-3.3.2-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:9bc885b89709d901859cf95179ec9f6bb67a3d2bb1f0e88456461bd4b7f8fd0d"},
|
||||
{file = "greenlet-3.3.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b568183cf65b94919be4438dc28416b234b678c608cafac8874dfeeb2a9bbe13"},
|
||||
@@ -2632,4 +2631,4 @@ reference = "tsinghua"
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = "^3.11"
|
||||
content-hash = "b6818d0575955350eb3baee241d4b21a201d597808a7e9ea0a3ebd0dcb6427cf"
|
||||
content-hash = "8c1645dc7dcf8bbfe763f01d59e402eec143e53bc925a9e70ca45d47e7df56e1"
|
||||
|
||||
@@ -19,6 +19,7 @@ pydantic-settings = "2.10.1"
|
||||
psutil = "7.0.0"
|
||||
asyncmy = "0.2.10"
|
||||
sqlmodel = "0.0.24"
|
||||
greenlet = "^3.2.3"
|
||||
aiofiles = "24.1.0"
|
||||
python-multipart = "0.0.20"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user