Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,155 +3,277 @@ import cohere
|
|
| 3 |
import os
|
| 4 |
import json
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
final_email = ""
|
| 10 |
|
| 11 |
load_dotenv(verbose=True)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
def
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
return "検査結果がありません!"
|
| 22 |
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
|
| 24 |
res = co.chat(
|
| 25 |
model="command-a-03-2025",
|
| 26 |
messages=[
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
],
|
| 32 |
)
|
| 33 |
-
|
| 34 |
data = res.message.content[0].text
|
| 35 |
return data
|
| 36 |
-
#thiscomment = f"{final_email:}{comment}"
|
| 37 |
-
#return thiscomment
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
state["final_email"] = email
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
data = json.loads(res.message.content[0].text)
|
| 85 |
-
|
| 86 |
-
# Iterate over key-value pairs correctly
|
| 87 |
-
scores = []
|
| 88 |
-
comments = ""
|
| 89 |
-
for key, value in data .items():
|
| 90 |
-
comments += f"\n{key}: {value}\n"
|
| 91 |
-
scores.append(f"{key}: {value}")
|
| 92 |
-
#scores.append(value)
|
| 93 |
-
|
| 94 |
-
state["final_comment"] = comments
|
| 95 |
-
state["final_score"] = scores
|
| 96 |
-
|
| 97 |
-
final = res.message.content[0].text
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
| 101 |
|
|
|
|
|
|
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
state = gr.State({
|
| 105 |
"final_email": "",
|
| 106 |
"final_comment": "",
|
| 107 |
"final_score": [],
|
| 108 |
})
|
| 109 |
-
|
| 110 |
-
gr.Markdown("# エンジニアスキル評価質問フォーム")
|
| 111 |
-
gr.Markdown("エンジニアスキルを簡易評価するフォームです!")
|
| 112 |
-
|
| 113 |
-
with gr.Tab("アセスメント"):
|
| 114 |
-
gr.Markdown("# エンジニア・スキルの簡易評価")
|
| 115 |
-
gr.Markdown("質問フォームから各項目のスコアを抽出して評価します!")
|
| 116 |
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
with gr.Row():
|
| 121 |
-
output = gr.Textbox(label="簡易評価", show_copy_button=True)
|
| 122 |
|
| 123 |
-
|
| 124 |
-
display_button.click(fn=extract_scores, inputs=None, outputs=output)
|
| 125 |
-
|
| 126 |
-
with gr.Tab("エンジニアスキル評価質問フォーム"):
|
| 127 |
# 入力フィールド
|
| 128 |
with gr.Row():
|
| 129 |
-
email = gr.Textbox(label="電子メールを入力してください。",
|
| 130 |
|
| 131 |
with gr.Row():
|
| 132 |
lang = gr.Textbox(label="普段使用しているプログラミング言語は何ですか?、尚、経験年数を教えてください。",
|
| 133 |
-
|
|
|
|
| 134 |
with gr.Row():
|
| 135 |
debug_tools = gr.Textbox(label="コードのデバッグ方法やツールについて教えてください。",
|
| 136 |
-
|
|
|
|
| 137 |
with gr.Row():
|
| 138 |
recent_problem = gr.Textbox(label="最近解決した技術的な課題を教えてください。どのようにアプローチしましたか?",
|
| 139 |
-
|
|
|
|
| 140 |
with gr.Row():
|
| 141 |
project_approach = gr.Textbox(label="複雑なプロジェクトで課題が発生した場合、どう対処しますか?",
|
| 142 |
-
|
|
|
|
| 143 |
with gr.Row():
|
| 144 |
project_scale = gr.Textbox(label="過去に関わったプロジェクトの規模や内容を教えてください。",
|
| 145 |
-
|
|
|
|
| 146 |
with gr.Row():
|
| 147 |
team_role = gr.Textbox(label="チームでどのような役割を果たしましたか?",
|
| 148 |
-
|
|
|
|
| 149 |
with gr.Row():
|
| 150 |
learning_methods = gr.Textbox(label="新しい技術を学ぶ際にどのような方法を取っていますか?",
|
| 151 |
-
|
|
|
|
| 152 |
with gr.Row():
|
| 153 |
recent_learning = gr.Textbox(label="最近学んだ技術や知識は何ですか?",
|
| 154 |
-
|
|
|
|
| 155 |
|
| 156 |
# ボタンと出力フィールド
|
| 157 |
with gr.Row():
|
|
@@ -161,9 +283,36 @@ with gr.Blocks(css="footer {visibility: hidden;} #custom_button {width: 400px; m
|
|
| 161 |
score = gr.Textbox(label="スコア")
|
| 162 |
|
| 163 |
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
inquery.launch()
|
|
|
|
| 3 |
import os
|
| 4 |
import json
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
+
from qdrant_client import QdrantClient
|
| 7 |
+
from qdrant_client.models import Filter, FieldCondition, MatchValue
|
| 8 |
+
import json
|
|
|
|
| 9 |
|
| 10 |
load_dotenv(verbose=True)
|
| 11 |
|
| 12 |
+
client = QdrantClient(url="http://localhost:6333")
|
| 13 |
+
|
| 14 |
+
def get_scores_for_users(userids):
|
| 15 |
+
try:
|
| 16 |
+
userids_list = userids.split(",") # Split user IDs into a list
|
| 17 |
+
result_messages = [] # Store results for each userid
|
| 18 |
+
|
| 19 |
+
for userid in userids_list:
|
| 20 |
+
userid = userid.strip() # Clean up whitespace around user IDs
|
| 21 |
+
|
| 22 |
+
# Build filter to query points for the specific userid
|
| 23 |
+
filter_condition = {
|
| 24 |
+
"must": [
|
| 25 |
+
{
|
| 26 |
+
"key": "userid",
|
| 27 |
+
"match": {"value": userid}
|
| 28 |
+
}
|
| 29 |
+
]
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
# Query Qdrant for points matching the userid
|
| 33 |
+
results = client.scroll(
|
| 34 |
+
collection_name="skill_scores",
|
| 35 |
+
limit=6, # Adjust based on your needs
|
| 36 |
+
with_payload=True # Include payloads for manual filtering
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
filtered_results = [
|
| 40 |
+
point.payload["score"] for point in results[0]
|
| 41 |
+
if point.payload.get("userid") == userid
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
#result_messages.append(f'{{"{userid}": {filtered_results}}}')
|
| 45 |
+
result_messages.append(f'{{"userid":"{userid}","score": {filtered_results}}}')
|
| 46 |
+
|
| 47 |
+
# Join result_messages into a single JSON-compatible string
|
| 48 |
+
json_data = "[" + ",".join(result_messages) + "]"
|
| 49 |
+
|
| 50 |
+
# Parse the JSON string into Python data
|
| 51 |
+
parsed_data = json.loads(json_data)
|
| 52 |
+
|
| 53 |
+
# Optional: Print or process parsed data
|
| 54 |
+
print(parsed_data)
|
| 55 |
+
|
| 56 |
+
# useridの取り出し
|
| 57 |
+
userid = parsed_data[0]["userid"]
|
| 58 |
+
print(f"User ID: {userid}")
|
| 59 |
+
|
| 60 |
+
# scoreの各項目を取り出し
|
| 61 |
+
scores = parsed_data[0]["score"]
|
| 62 |
+
print(f"Score: {scores}")
|
| 63 |
+
|
| 64 |
+
#return "\n".join(result_messages) # Return results for all user IDs
|
| 65 |
+
return userid,scores
|
| 66 |
+
except Exception as e:
|
| 67 |
+
return f"Error occurred while retrieving scores: {str(e)}"
|
| 68 |
+
|
| 69 |
+
def update_lang(lang):
|
| 70 |
+
if len(lang) == 0:
|
| 71 |
+
return gr.update(value="Pythonが得意。スクリプト作成やデータ分析、機械学習まで幅広く活用している。")
|
| 72 |
+
else:
|
| 73 |
+
return gr.update(value=lang)
|
| 74 |
+
|
| 75 |
+
def update_debug(debug):
|
| 76 |
+
if len(debug) == 0:
|
| 77 |
+
return gr.update(value="よく使うのはpdb(Python Debugger)やVS Codeのデバッガ機能。エラー箇所を細かくチェックするのが好き。")
|
| 78 |
+
else:
|
| 79 |
+
return gr.update(value=debug)
|
| 80 |
+
|
| 81 |
+
def update_recent_problem(recent_problem):
|
| 82 |
+
if len(recent_problem) == 0:
|
| 83 |
+
return gr.update(value="例えば、APIの連携でエラーが続発する問題があったとき、レスポンスをしっかりロギングしてパターンを分析、結果的にリクエストヘッダーを微調整して解決できた。")
|
| 84 |
+
else:
|
| 85 |
+
return gr.update(value=recent_problem)
|
| 86 |
+
|
| 87 |
+
def update_project_approach(project_approach):
|
| 88 |
+
if len(project_approach) == 0:
|
| 89 |
+
return gr.update(value="チーム内でブレインストーミングしてアイデアを出し合い、最良の解決策を選択するのが常套手段だと思っている。")
|
| 90 |
+
else:
|
| 91 |
+
return gr.update(value=project_approach)
|
| 92 |
+
|
| 93 |
+
def update_project_scale(project_scale):
|
| 94 |
+
if len(project_scale) == 0:
|
| 95 |
+
return gr.update(value="1人で取り組むものから、数十人規模の開発チームでクラウドシステム構築などをした経験もある。")
|
| 96 |
+
else:
|
| 97 |
+
return gr.update(value=project_scale)
|
| 98 |
+
|
| 99 |
+
def update_team_role (team_role):
|
| 100 |
+
if len(team_role ) == 0:
|
| 101 |
+
return gr.update(value="主にテクニカルリーダーとして、設計からレビューまでを担当。時には新人教育も。")
|
| 102 |
+
else:
|
| 103 |
+
return gr.update(value=team_role)
|
| 104 |
+
|
| 105 |
+
def update_learning_methods(learning_methods):
|
| 106 |
+
if len(learning_methods) == 0:
|
| 107 |
+
return gr.update(value="実際に手を動かして試すのが一番。Tutorialやドキュメントを読みながらプロトタイプを作成。")
|
| 108 |
+
else:
|
| 109 |
+
return gr.update(value=learning_methods)
|
| 110 |
+
|
| 111 |
+
def update_recent_learning(recent_learning):
|
| 112 |
+
if len(recent_learning) == 0:
|
| 113 |
+
return gr.update(value="最近は生成AIのモデルチューニング方法について学んだよ。これでさらに便利なプロジェクトが作れる。")
|
| 114 |
+
else:
|
| 115 |
+
return gr.update(value=recent_learning)
|
| 116 |
+
|
| 117 |
|
| 118 |
+
|
| 119 |
+
# スコアを抽出する関数
|
| 120 |
+
def post_scores(state,email):
|
| 121 |
+
if len(email) == 0:
|
| 122 |
return "検査結果がありません!"
|
| 123 |
else:
|
| 124 |
+
state['final_email'] = email
|
| 125 |
+
state['final_comment'] = """{
|
| 126 |
+
"技術的な理解": 9,
|
| 127 |
+
"問題解決能力": 8.5,
|
| 128 |
+
"実務経験": 8,
|
| 129 |
+
"学習意欲": 9,
|
| 130 |
+
"ソフトスキル": 8.5,
|
| 131 |
+
"合計スコア": 8.6
|
| 132 |
+
}"""
|
| 133 |
+
|
| 134 |
+
state['final_email'] = userid
|
| 135 |
+
state['final_comment'] = score_dict
|
| 136 |
+
|
| 137 |
co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
|
| 138 |
res = co.chat(
|
| 139 |
model="command-a-03-2025",
|
| 140 |
messages=[
|
| 141 |
+
{
|
| 142 |
+
"role": "user",
|
| 143 |
+
"content": f"これは{state['final_email']}さんのデータです。{state['final_comment']}を評価してください。生成された結果に基づいて{state['final_email']}さんに送るスカウト提案メールも作ってください。答えは、必ず、評価結果とメールの本文を日本語で返してください。",
|
| 144 |
+
}
|
| 145 |
],
|
| 146 |
)
|
|
|
|
| 147 |
data = res.message.content[0].text
|
| 148 |
return data
|
|
|
|
|
|
|
| 149 |
|
| 150 |
+
# スコアを抽出する関数
|
| 151 |
+
def extract_scores(state):
|
| 152 |
+
if len(state["final_score"]) == 0:
|
| 153 |
+
return "検査結果がありません!"
|
| 154 |
+
else:
|
| 155 |
+
co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
|
| 156 |
+
res = co.chat(
|
| 157 |
+
model="command-a-03-2025",
|
| 158 |
+
messages=[
|
| 159 |
+
{
|
| 160 |
+
"role": "user",
|
| 161 |
+
"content": f"これは{state['final_email']}さんのデータです。{state['final_comment']}を評価してください。生成された結果に基づいて{state['final_email']}さんに送るスカウト提案メールも作ってください。答えは、必ず、評価結果とメールの本文を日本語で返してください。",
|
| 162 |
+
}
|
| 163 |
+
],
|
| 164 |
+
)
|
| 165 |
+
data = res.message.content[0].text
|
| 166 |
+
return data
|
| 167 |
+
|
| 168 |
+
# 簡易評価の関数
|
| 169 |
+
def evaluate_responses(state, email, programming, debugging, problem, problem_solving, project_experience, role, learning, learnt_skills):
|
| 170 |
state["final_email"] = email
|
| 171 |
|
| 172 |
+
if (email != "" and programming != "" and debugging != "" and problem != "" and problem_solving != "" and project_experience != "" and role != "" and learning != "" and learnt_skills != ""):
|
| 173 |
+
# レコード作成
|
| 174 |
+
records = f"""
|
| 175 |
+
✨プログラミング言語について: {programming}
|
| 176 |
+
✨デバッグ方法について: {debugging}
|
| 177 |
+
✨最近解決した技術的な課題: {problem}
|
| 178 |
+
✨プロジェクト問題解決方法について: {problem_solving}
|
| 179 |
+
✨プロジェクト経験について: {project_experience}
|
| 180 |
+
✨チームでの役割について: {role}
|
| 181 |
+
✨新しい技術への学習意欲について: {learning}
|
| 182 |
+
✨最近学んだ技術や知識について: {learnt_skills}
|
| 183 |
+
"""
|
| 184 |
+
co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
|
| 185 |
+
res = co.chat(
|
| 186 |
+
model="command-a-03-2025",
|
| 187 |
+
messages=[
|
| 188 |
+
{
|
| 189 |
+
"role": "user",
|
| 190 |
+
"content": f"""
|
| 191 |
+
{records}を「基準」に基づいて各項目の合計スコアを10段階で割り振って評価してください。答えは、必ず、「形式」で合計スコアのみを返してください。
|
| 192 |
+
「基準」=価基準とポイント配分
|
| 193 |
+
技術的な理解 (30%): 例えばプログラミング言語の知識やデバッグ能力を考慮。コード品質や問題解決能力が評価対象。
|
| 194 |
+
問題解決能力 (25%): 技術的課題への対応スキルやアプローチ方法をチェック。現実的かつ効率的な解決策を出せるかどうか。
|
| 195 |
+
実務経験 (20%): 過去のプロジェクト経験の内容や規模。実際の成果や役割が評価される。
|
| 196 |
+
学習意欲 (15%): 新しい技術をどれだけ積極的に学び、適応しているか。最近学んだ知識がアピールポイント!
|
| 197 |
+
ソフトスキル (10%): チームワークやコミュニケーション能力。エンジニアの柔軟性や協力姿勢を評価。
|
| 198 |
+
「形式」= {{
|
| 199 |
+
"技術的な理解": 9,
|
| 200 |
+
"問題解決能力": 8.5,
|
| 201 |
+
"実務経験": 8,
|
| 202 |
+
"学習意欲": 9.5,
|
| 203 |
+
"ソフトスキル": 8.5,
|
| 204 |
+
"合計スコア": 8.63,
|
| 205 |
+
"スキルレベル": "Expert",
|
| 206 |
+
"説明": "技術力や問題解決能力、学習意欲が高くバランスの良いスキルセットを持っている。"
|
| 207 |
+
}}
|
| 208 |
+
""",
|
| 209 |
+
}
|
| 210 |
+
],
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
cleaned_string = res.message.content[0].text.replace("```json", "").replace("```", "").strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
|
| 215 |
+
data = json.loads(cleaned_string)
|
| 216 |
+
#data = json.loads(res.message.content[0].text)
|
| 217 |
+
comments = "\n".join([f"{key}: {value}" for key, value in data.items()])
|
| 218 |
+
scores = [f"{key}: {value}" for key, value in data.items()]
|
| 219 |
+
print("db-scores:",scores)
|
| 220 |
|
| 221 |
+
state["final_comment"] = comments
|
| 222 |
+
state["final_score"] = scores
|
| 223 |
|
| 224 |
+
return records, comments
|
| 225 |
+
else:
|
| 226 |
+
return "入力が正しくありません。","None"
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
# Gradio Blocksの構築
|
| 230 |
+
with gr.Blocks(css="footer {visibility: hidden;} #header {display: flex; justify-content: space-between; align-items: center; font-size: 24px; font-weight: bold;} #logo {width: 50px; height: 50px;}", theme=gr.themes.Glass(), title="エンジニア・スキル評価") as inquery:
|
| 231 |
state = gr.State({
|
| 232 |
"final_email": "",
|
| 233 |
"final_comment": "",
|
| 234 |
"final_score": [],
|
| 235 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
|
| 237 |
+
gr.HTML('<div id="header"><span>🧑🏫👩🏫 エンジニア・スキル評価</span><img id="logo" src="https://www.ryhintl.com/images/ryhlogo/ryhlogo.png" width="64" height="64" alt="Logo"></div>')
|
| 238 |
+
gr.Markdown("エンジニア・スキルを簡易評価するアプリです!")
|
|
|
|
|
|
|
|
|
|
| 239 |
|
| 240 |
+
with gr.Tab("エンジニア・スキル評価質問フォーム"):
|
|
|
|
|
|
|
|
|
|
| 241 |
# 入力フィールド
|
| 242 |
with gr.Row():
|
| 243 |
+
email = gr.Textbox(label="電子メールを入力してください。", info="your mail address")
|
| 244 |
|
| 245 |
with gr.Row():
|
| 246 |
lang = gr.Textbox(label="普段使用しているプログラミング言語は何ですか?、尚、経験年数を教えてください。",
|
| 247 |
+
info="Pythonが得意。スクリプト作成やデータ分析、機械学習まで幅広く活用している。", value="")
|
| 248 |
+
lang.submit(fn=update_lang,inputs=[lang],outputs=[lang])
|
| 249 |
with gr.Row():
|
| 250 |
debug_tools = gr.Textbox(label="コードのデバッグ方法やツールについて教えてください。",
|
| 251 |
+
info="よく使うのはpdb(Python Debugger)やVS Codeのデバッガ機能。エラー箇所を細かくチェックするのが好き。")
|
| 252 |
+
debug_tools.submit(fn=update_debug,inputs=[debug_tools],outputs=[debug_tools])
|
| 253 |
with gr.Row():
|
| 254 |
recent_problem = gr.Textbox(label="最近解決した技術的な課題を教えてください。どのようにアプローチしましたか?",
|
| 255 |
+
info="例えば、APIの連携でエラーが続発する問題があったとき、レスポンスをしっかりロギングしてパターンを分析、結果的にリクエストヘッダーを微調整して解決できた。")
|
| 256 |
+
recent_problem.submit(fn=update_recent_problem,inputs=[recent_problem],outputs=[recent_problem])
|
| 257 |
with gr.Row():
|
| 258 |
project_approach = gr.Textbox(label="複雑なプロジェクトで課題が発生した場合、どう対処しますか?",
|
| 259 |
+
info="チーム内でブレインストーミングしてアイデアを出し合い、最良の解決策を選択するのが常套手段だと思っている。")
|
| 260 |
+
project_approach.submit(fn=update_project_approach,inputs=[project_approach],outputs=[project_approach])
|
| 261 |
with gr.Row():
|
| 262 |
project_scale = gr.Textbox(label="過去に関わったプロジェクトの規模や内容を教えてください。",
|
| 263 |
+
info="1人で取り組むものから、数十人規模の開発チームでクラウドシステム構築などをした経験もある。")
|
| 264 |
+
project_scale.submit(fn=update_project_scale,inputs=[project_scale],outputs=[project_scale])
|
| 265 |
with gr.Row():
|
| 266 |
team_role = gr.Textbox(label="チームでどのような役割を果たしましたか?",
|
| 267 |
+
info="主にテクニカルリーダーとして、設計からレビューまでを担当。時には新人教育も。")
|
| 268 |
+
team_role.submit(fn=update_team_role,inputs=[team_role],outputs=[team_role])
|
| 269 |
with gr.Row():
|
| 270 |
learning_methods = gr.Textbox(label="新しい技術を学ぶ際にどのような方法を取っていますか?",
|
| 271 |
+
info="実際に手を動かして試すのが一番。Tutorialやドキュメントを読みながらプロトタイプを作成。")
|
| 272 |
+
learning_methods.submit(fn=update_learning_methods,inputs=[learning_methods],outputs=[learning_methods])
|
| 273 |
with gr.Row():
|
| 274 |
recent_learning = gr.Textbox(label="最近学んだ技術や知識は何ですか?",
|
| 275 |
+
info="最近は生成AIのモデルチューニング方法について学んだよ。これでさらに便利なプロジェクトが作れる。")
|
| 276 |
+
recent_learning.submit(fn=update_recent_learning,inputs=[recent_learning],outputs=[recent_learning])
|
| 277 |
|
| 278 |
# ボタンと出力フィールド
|
| 279 |
with gr.Row():
|
|
|
|
| 283 |
score = gr.Textbox(label="スコア")
|
| 284 |
|
| 285 |
|
| 286 |
+
submit_btn.click(fn=evaluate_responses,
|
| 287 |
+
inputs=[state, email, lang, debug_tools, recent_problem, project_approach,
|
| 288 |
+
project_scale, team_role, learning_methods, recent_learning],
|
| 289 |
+
outputs=[result, score])
|
| 290 |
+
|
| 291 |
+
with gr.Tab("リアルタイム・アセスメント"):
|
| 292 |
+
gr.Markdown("# エンジニア・スキルの簡易評価")
|
| 293 |
+
gr.Markdown("質問フォームから各項目のスコアを抽出して評価します!")
|
| 294 |
+
|
| 295 |
+
with gr.Row():
|
| 296 |
+
display_button = gr.Button("簡易評価")
|
| 297 |
+
|
| 298 |
+
with gr.Row():
|
| 299 |
+
output = gr.Textbox(label="簡易評価", show_copy_button=True)
|
| 300 |
+
|
| 301 |
+
# ボタンに関数を接続
|
| 302 |
+
display_button.click(fn=extract_scores, inputs=[state], outputs=output)
|
| 303 |
+
|
| 304 |
+
with gr.Tab("ポスト・アセスメント"):
|
| 305 |
+
gr.Markdown("# エンジニア・スキルの簡易評価")
|
| 306 |
+
gr.Markdown("質問フォームから各項目のスコアを抽出して評価します!")
|
| 307 |
+
|
| 308 |
+
with gr.Row():
|
| 309 |
+
input = gr.Textbox(label="電子メール",value="richardhuh0629@gmail.com")
|
| 310 |
+
output = gr.Textbox(label="簡易評価", show_copy_button=True)
|
| 311 |
+
|
| 312 |
+
with gr.Row():
|
| 313 |
+
analyze_button = gr.Button("簡易評価")
|
| 314 |
+
|
| 315 |
+
# ボタンに関数を接続
|
| 316 |
+
analyze_button.click(fn=post_scores, inputs=[state,input], outputs=output)
|
| 317 |
|
| 318 |
inquery.launch()
|