DZW/example.py
st2411020202 3bdbf1f462 build: 更新项目配置和依赖管理
添加.python-version文件指定Python版本
将依赖从requirements.txt迁移至pyproject.toml
添加python-dotenv依赖用于环境变量管理
新增.env-example作为环境变量配置模板
生成uv.lock锁定依赖版本
添加example.py作为功能示例
2026-01-08 23:39:49 +08:00

64 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
"""
AI面试助手示例文件
展示如何使用AI面试助手的核心功能
"""
import streamlit as st
import os
from dotenv import load_dotenv
# 加载环境变量
load_dotenv()
def main():
"""示例主函数"""
st.title("AI面试助手 - 使用示例")
# 展示环境变量配置
st.subheader("环境变量配置")
st.write("请确保已配置以下环境变量(在.env文件中")
st.code("""
# Streamlit配置
STREAMLIT_SERVER_PORT=8501
STREAMLIT_SERVER_ADDRESS=localhost
# 应用配置
APP_NAME=AI面试助手
APP_VERSION=1.0.0
# 历史记录目录
HISTORY_DIR=interview_history
""")
# 功能演示
st.subheader("功能演示")
# 1. 面试者信息收集
st.write("## 1. 面试者信息收集")
with st.form("candidate_info_form"):
name = st.text_input("姓名")
email = st.text_input("邮箱")
education = st.text_input("学历")
experience = st.text_input("工作经验")
submitted = st.form_submit_button("提交信息")
if submitted:
st.success(f"信息已提交:{name} - {email}")
# 2. 职位选择
st.write("## 2. 职位选择")
job_options = ["Python开发", "产品经理", "前端开发", "后端开发", "UI/UX设计"]
selected_job = st.selectbox("选择目标职位", job_options)
st.write(f"您选择的职位:{selected_job}")
# 3. 面试官类型选择
st.write("## 3. 面试官类型选择")
interviewer_types = ["严谨型", "亲和型", "压力型", "技术型", "管理型"]
selected_interviewer = st.selectbox("选择面试官类型", interviewer_types)
st.write(f"您选择的面试官类型:{selected_interviewer}")
st.success("示例功能演示完成!")
if __name__ == "__main__":
main()