增加模型可配置功能

This commit is contained in:
2025-04-08 14:10:12 +08:00
parent 2b349a7b5d
commit 01ed406dfa
2 changed files with 35 additions and 8 deletions
+24
View File
@@ -0,0 +1,24 @@
# 数据库配置
# DB_URL=postgresql+psycopg://ai:ai@localhost:5532/ai
# OpenAI API配置
API_KEY=sk-oftybjqntjpxlhkcxkieluljb
EMBEDDING_MODEL=BAAI/bge-large-zh-v1.5
EMBEDDING_BASE_URL=https://api.siliconflow.cn/v1
MODEL_LIST=Qwen2.5-72B=openai:Qwen/Qwen2.5-72B-Instruct&gpt-4o=openai:gpt-4o
# 模型配置
MODEL_BASE_URL=https://api.siliconflow.cn/v1
# 文件路径配置
KNOWLEDGE_SOURCE_DIR=data
MEMORY_DB_FILE=tmp/agent_memory.db
VECTOR_DB_PATH=tmp/lancedb
SESSION_STORAGE_PATH=tmp/agent_sessions_json
# 知识库加载控制
LOAD_KNOWLEDGE=true
AGNO_MONITOR=true
AGNO_TELEMETRY=true
AGNO_DEBUG=true
+11 -8
View File
@@ -1,3 +1,4 @@
import os
from typing import List
import streamlit as st
@@ -83,14 +84,16 @@ def show_tabs():
# if tabs[index]["name"] == selected_tab:
# set_current_page(value["name"])
model_options = {
"Qwen2.5-72B": "openai:Qwen/Qwen2.5-72B-Instruct",
"o3-mini": "openai:o3-mini",
"gpt-4o": "openai:gpt-4o",
"gemini-2.0-flash-exp": "google:gemini-2.0-flash-exp",
"claude-3-5-sonnet": "anthropic:claude-3-5-sonnet-20241022",
"llama-3.3-70b": "groq:llama-3.3-70b-versatile",
}
# model_options = {
# "Qwen2.5-72B": "openai:Qwen/Qwen2.5-72B-Instruct",
# "o3-mini": "openai:o3-mini",
# "gpt-4o": "openai:gpt-4o",
# "gemini-2.0-flash-exp": "google:gemini-2.0-flash-exp",
# "claude-3-5-sonnet": "anthropic:claude-3-5-sonnet-20241022",
# "llama-3.3-70b": "groq:llama-3.3-70b-versatile",
# }
model_options = dict(item.split('=') for item in os.getenv("MODEL_LIST", "Qwen2.5-72B=openai:Qwen/Qwen2.5-72B-Instruct").split('&'))
def get_modul_option(id: int = 0) -> str:
"""Return the selected module option"""