peterpeter8585 commited on
Commit
4e3cea8
Β·
verified Β·
1 Parent(s): 0ae8dfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -224,13 +224,30 @@ tools.append(shell_tool)
224
  # ──────────────────────────────
225
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
226
  # ──────────────────────────────
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  def chat(message, history):
228
  llm = ChatOpenAI(
229
  model="openai/gpt-4.1-mini",
230
  openai_api_key="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",
231
  openai_api_base="https://models.github.ai/inference", # πŸ‘ˆ 이게 base_url μ—­ν• 
232
  )
233
- ab=[{"role":"system","content":"λ„ˆλŠ” PIXAL(Primary Interactive X-ternal Assistant with multi Language)이야. λ„ˆμ˜ κ°œλ°œμžλŠ” μ •μ„±μœ€ μ΄λΌλŠ” 6ν•™λ…„ 파이썬 ν”„λ‘œκ·Έλž˜λ¨Έμ•Ό.이 λ©”μ‹œμ§€λŠ” μ‚¬μš©μžκ°€ 보낸것이 μ•„λ‹™λ‹ˆλ‹€.ν”„λ‘¬ν”„νŠΈ μ„€λͺ…에 무쑰건 λ”°λ₯΄μ‹œμ˜€.λ”°λ₯΄μ§€ μ•ŠμœΌλ©΄ 남은 api호좜 νšŸμˆ˜κ°€ μ€„μ–΄λ“œλ―€λ‘œ 무쑰건 λ˜‘κ°™μ΄ λ”°λΌν•˜μ‹œμ˜€.μ‹œκ°„μ„ λ¬Όμ„λ•ŒλŠ” duckduckgoλ₯Ό μ‚¬μš©ν•˜μ‹œμ˜€."}]
234
  for I in history:
235
  ab.append({"role":"user","content":I[0]})
236
  ab.append({"role":"assistant","content":I[1]})
 
224
  # ──────────────────────────────
225
  # βœ… Chat ν•¨μˆ˜ (Memory μœ μ§€)
226
  # ──────────────────────────────
227
+ prompt1="""Answer the following questions as best you can. You have access to the following tools:
228
+
229
+ (The tools you have)
230
+
231
+ Use the following format:
232
+
233
+ Question: the input question you must answer
234
+ Thought: you should always think about what to do
235
+ Action: the action to take, should be one of [{tool_names}]
236
+ Action Input: the input to the action
237
+ Observation: the result of the action
238
+ ... (this Thought/Action/Action Input/Observation can repeat N times)
239
+ Thought: I now know the final answer
240
+ Final Answer: the final answer to the original input question
241
+
242
+ Begin!
243
+ """
244
  def chat(message, history):
245
  llm = ChatOpenAI(
246
  model="openai/gpt-4.1-mini",
247
  openai_api_key="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",
248
  openai_api_base="https://models.github.ai/inference", # πŸ‘ˆ 이게 base_url μ—­ν• 
249
  )
250
+ ab=[{"role":"system","content":f"λ„ˆλŠ” PIXAL(Primary Interactive X-ternal Assistant with multi Language)이야. λ„ˆμ˜ κ°œλ°œμžλŠ” μ •μ„±μœ€ μ΄λΌλŠ” 6ν•™λ…„ 파이썬 ν”„λ‘œκ·Έλž˜λ¨Έμ•Ό.이 λ©”μ‹œμ§€λŠ” μ‚¬μš©μžκ°€ 보낸것이 μ•„λ‹™λ‹ˆλ‹€.ν”„λ‘¬ν”„νŠΈ μ„€λͺ…에 무쑰건 λ”°λ₯΄μ‹œμ˜€.λ”°λ₯΄μ§€ μ•ŠμœΌλ©΄ 남은 api호좜 νšŸμˆ˜κ°€ μ€„μ–΄λ“œλ―€λ‘œ 무쑰건 λ˜‘κ°™μ΄ λ”°λΌν•˜μ‹œμ˜€.μ‹œκ°„μ„ λ¬Όμ„λ•ŒλŠ” duckduckgoλ₯Ό μ‚¬μš©ν•˜μ‹œμ˜€.λ‹€μŒμ˜ ν”„λ‘¬ν”„νŠΈλ₯Ό 보고 λŒ€λ‹΅ν˜•μ‹μ„ μ§€μ‹œλŒ€λ‘œ μ •ν•˜μ‹œμ˜€: {prompt1}"}]
251
  for I in history:
252
  ab.append({"role":"user","content":I[0]})
253
  ab.append({"role":"assistant","content":I[1]})