Spaces:
Sleeping
Sleeping
Qscar KIM commited on
Commit ·
571382c
1
Parent(s): 274b107
update codes
Browse files
app.py
CHANGED
|
@@ -13,21 +13,20 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
| 16 |
-
# Google AI Studio에서 발급받은 API 키를 환경 변수에서 로드
|
| 17 |
gemini_key = os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY")
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
model = LiteLLMModel(
|
| 21 |
-
model_id="gemini/gemini-1.5-flash",
|
| 22 |
api_key=gemini_key
|
| 23 |
)
|
| 24 |
|
| 25 |
-
search_tool = DuckDuckGoSearchTool()
|
| 26 |
|
| 27 |
-
#
|
| 28 |
self.alfred = CodeAgent(
|
| 29 |
-
tools=[search_tool],
|
| 30 |
-
model=model,
|
| 31 |
add_base_tools=True,
|
| 32 |
planning_interval=3
|
| 33 |
)
|
|
|
|
| 13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 14 |
class BasicAgent:
|
| 15 |
def __init__(self):
|
|
|
|
| 16 |
gemini_key = os.getenv("GEMINI_API_KEY") or os.getenv("GOOGLE_API_KEY")
|
| 17 |
|
| 18 |
+
# LiteLLM 명세에 부합하도록 모델 식별자를 gemini-1.5-flash-latest로 교정
|
| 19 |
+
self.model = LiteLLMModel(
|
| 20 |
+
model_id="gemini/gemini-1.5-flash-latest",
|
| 21 |
api_key=gemini_key
|
| 22 |
)
|
| 23 |
|
| 24 |
+
self.search_tool = DuckDuckGoSearchTool()
|
| 25 |
|
| 26 |
+
# 45점 베이스라인의 다단계 계획 수립 및 내장 인터프리터 툴 세팅 유지
|
| 27 |
self.alfred = CodeAgent(
|
| 28 |
+
tools=[self.search_tool],
|
| 29 |
+
model=self.model,
|
| 30 |
add_base_tools=True,
|
| 31 |
planning_interval=3
|
| 32 |
)
|