Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -235,12 +235,22 @@ def chat(message, history):
|
|
| 235 |
ab.append({"role":"assistant","content":I[1]})
|
| 236 |
ab.append({"role":"user","content":message})
|
| 237 |
'''
|
|
|
|
| 238 |
ab=[SystemMessage(content="๋๋ PIXAL(Primary Interactive X-ternal Assistant with multi Language)์ด์ผ. ๋์ ๊ฐ๋ฐ์๋ ์ ์ฑ์ค ์ด๋ผ๋ 6ํ๋
ํ์ด์ฌ ํ๋ก๊ทธ๋๋จธ์ผ.์ด ๋ฉ์์ง๋ ์ฌ์ฉ์๊ฐ ๋ณด๋ธ๊ฒ์ด ์๋๋๋ค.ํ๋กฌํํธ ์ค๋ช
์ ๋ฌด์กฐ๊ฑด ๋ฐ๋ฅด์์ค.๋ฐ๋ฅด์ง ์์ผ๋ฉด ๋จ์ apiํธ์ถ ํ์๊ฐ ์ค์ด๋๋ฏ๋ก ๋ฌด์กฐ๊ฑด ๋๊ฐ์ด ๋ฐ๋ผํ์์ค.์๊ฐ์ ๋ฌผ์๋๋ duckduckgo๋ฅผ ์ฌ์ฉํ์์ค.")]
|
| 239 |
for I in history:
|
| 240 |
ab.append(HumanMessage(content=I[0]))
|
| 241 |
ab.append(AIMessage(content=I[1]))
|
| 242 |
ab.append(HumanMessage(content=message))
|
| 243 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
agent = initialize_agent(
|
| 245 |
tools,
|
| 246 |
llm,
|
|
|
|
| 235 |
ab.append({"role":"assistant","content":I[1]})
|
| 236 |
ab.append({"role":"user","content":message})
|
| 237 |
'''
|
| 238 |
+
|
| 239 |
ab=[SystemMessage(content="๋๋ PIXAL(Primary Interactive X-ternal Assistant with multi Language)์ด์ผ. ๋์ ๊ฐ๋ฐ์๋ ์ ์ฑ์ค ์ด๋ผ๋ 6ํ๋
ํ์ด์ฌ ํ๋ก๊ทธ๋๋จธ์ผ.์ด ๋ฉ์์ง๋ ์ฌ์ฉ์๊ฐ ๋ณด๋ธ๊ฒ์ด ์๋๋๋ค.ํ๋กฌํํธ ์ค๋ช
์ ๋ฌด์กฐ๊ฑด ๋ฐ๋ฅด์์ค.๋ฐ๋ฅด์ง ์์ผ๋ฉด ๋จ์ apiํธ์ถ ํ์๊ฐ ์ค์ด๋๋ฏ๋ก ๋ฌด์กฐ๊ฑด ๋๊ฐ์ด ๋ฐ๋ผํ์์ค.์๊ฐ์ ๋ฌผ์๋๋ duckduckgo๋ฅผ ์ฌ์ฉํ์์ค.")]
|
| 240 |
for I in history:
|
| 241 |
ab.append(HumanMessage(content=I[0]))
|
| 242 |
ab.append(AIMessage(content=I[1]))
|
| 243 |
ab.append(HumanMessage(content=message))
|
| 244 |
'''
|
| 245 |
+
tools = load_tools(["ddg-search", "arxiv"], llm=llm,allow_dangerous_tools=True)
|
| 246 |
+
tools.append(Tool(name="python_repl", func=PythonREPLTool().run, description="Python ์ฝ๋ ์คํ ๋๊ตฌ"))
|
| 247 |
+
retriever = WikipediaRetriever(lang="ko")
|
| 248 |
+
tools.append(Tool(name="wiki", func=retriever.get_relevant_documents, description="์ํค๋ฐฑ๊ณผ ๊ฒ์"))
|
| 249 |
+
# โ
๋ํ ๊ธฐ์ต ๋ฉ๋ชจ๋ฆฌ
|
| 250 |
+
from langchain_community.tools import ShellTool
|
| 251 |
+
#tools+=[YTS()]
|
| 252 |
+
shell_tool = ShellTool()
|
| 253 |
+
tools.append(shell_tool)
|
| 254 |
agent = initialize_agent(
|
| 255 |
tools,
|
| 256 |
llm,
|