Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ class StreamingAgentCallbackHandler(BaseCallbackHandler):
|
|
| 43 |
from langchain_community.retrievers import WikipediaRetriever
|
| 44 |
from langchain.tools.retriever import create_retriever_tool
|
| 45 |
retriever = WikipediaRetriever(lang="ko",top_k_results=10)
|
| 46 |
-
wiki=Tool(retriever.
|
| 47 |
# ──────────────────────────────
|
| 48 |
# ✅ GitHub Models LLM
|
| 49 |
# ──────────────────────────────
|
|
@@ -96,35 +96,7 @@ tools.append(Tool(name="python_repl", func=python_tool.run, description="Python
|
|
| 96 |
# ──────────────────────────────
|
| 97 |
# ✅ 파일 도구
|
| 98 |
# ──────────────────────────────
|
| 99 |
-
BASE_DIR = os.path.join(os.getcwd(), "pixal_files")
|
| 100 |
-
os.makedirs(BASE_DIR, exist_ok=True)
|
| 101 |
|
| 102 |
-
def file_write(data: str) -> str:
|
| 103 |
-
try:
|
| 104 |
-
name, content = data.split("\n", 1)
|
| 105 |
-
path = os.path.join(BASE_DIR, name.strip())
|
| 106 |
-
with open(path, "w", encoding="utf-8") as f:
|
| 107 |
-
f.write(content)
|
| 108 |
-
return f"✅ 파일 저장됨: {path}"
|
| 109 |
-
except Exception as e:
|
| 110 |
-
return f"⚠️ 파일 저장 오류: {e}"
|
| 111 |
-
|
| 112 |
-
def file_read(filename: str) -> str:
|
| 113 |
-
path = os.path.join(BASE_DIR, filename.strip())
|
| 114 |
-
if not os.path.exists(path):
|
| 115 |
-
return "❌ 파일 없음"
|
| 116 |
-
with open(path, "r", encoding="utf-8") as f:
|
| 117 |
-
return f.read()
|
| 118 |
-
|
| 119 |
-
def file_list(_="") -> str:
|
| 120 |
-
return "\n".join(os.listdir(BASE_DIR))
|
| 121 |
-
|
| 122 |
-
def file_delete(filename: str) -> str:
|
| 123 |
-
path = os.path.join(BASE_DIR, filename.strip())
|
| 124 |
-
if os.path.exists(path):
|
| 125 |
-
os.remove(path)
|
| 126 |
-
return f"🗑️ 삭제 완료: {filename}"
|
| 127 |
-
return "❌ 파일 없음"
|
| 128 |
|
| 129 |
# ──────────────────────────────
|
| 130 |
# ✅ 정확한 한국 시간 함수 (Asia/Seoul)
|
|
|
|
| 43 |
from langchain_community.retrievers import WikipediaRetriever
|
| 44 |
from langchain.tools.retriever import create_retriever_tool
|
| 45 |
retriever = WikipediaRetriever(lang="ko",top_k_results=10)
|
| 46 |
+
wiki=Tool(retriever.get_relevant_documents,name="WIKI SEARCH",description="위키백과에서 필요한 정보를 불러옵니다.결괴를 검증하여 사용하시오.")
|
| 47 |
# ──────────────────────────────
|
| 48 |
# ✅ GitHub Models LLM
|
| 49 |
# ──────────────────────────────
|
|
|
|
| 96 |
# ──────────────────────────────
|
| 97 |
# ✅ 파일 도구
|
| 98 |
# ──────────────────────────────
|
|
|
|
|
|
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
# ──────────────────────────────
|
| 102 |
# ✅ 정확한 한국 시간 함수 (Asia/Seoul)
|