Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ llm = LlamaCpp(
|
|
| 44 |
n_threads=4,
|
| 45 |
n_gpu_layers=0,
|
| 46 |
temperature=0.65,
|
| 47 |
-
top_p=0.
|
| 48 |
max_tokens=100,
|
| 49 |
n_batch=64,
|
| 50 |
verbose=False,
|
|
@@ -260,16 +260,29 @@ Final Answer: The answer is 42 because analysis of the given data and tool resul
|
|
| 260 |
)
|
| 261 |
|
| 262 |
react_template = """
|
|
|
|
|
|
|
| 263 |
Question: {input}
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
Action
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
"""
|
| 274 |
|
| 275 |
def create_agent_executor(llm, tools: List[Tool], tracer: Optional[Any] = None) -> AgentExecutor:
|
|
|
|
| 44 |
n_threads=4,
|
| 45 |
n_gpu_layers=0,
|
| 46 |
temperature=0.65,
|
| 47 |
+
top_p=0.8,
|
| 48 |
max_tokens=100,
|
| 49 |
n_batch=64,
|
| 50 |
verbose=False,
|
|
|
|
| 260 |
)
|
| 261 |
|
| 262 |
react_template = """
|
| 263 |
+
You are a ReAct-style reasoning agent. Follow always *exactly* this structure:
|
| 264 |
+
|
| 265 |
Question: {input}
|
| 266 |
+
|
| 267 |
+
Thought: Reflect on what is being asked. Based on previous Observations, decide your next useful step.
|
| 268 |
+
Action: <choose a tool from the provided list — WikipediaSearch, YouTubeExtractor, MediaAnalyzer, CoderAgent, SafePythonREPL, etc.>
|
| 269 |
+
Action Input: <provide only the raw input for that tool, without brackets or quotes, reasure always to give the write input based on abilities of the tool and it's supported input>
|
| 270 |
+
Observation: <summarize the important and useful result from that tool>
|
| 271 |
+
|
| 272 |
+
(Repeat the Thought / Action / Action Input / Observation pattern as needed.)
|
| 273 |
+
|
| 274 |
+
When you are ready to conclude, write your final section:
|
| 275 |
+
|
| 276 |
+
Final Answer: <write your best possible answer here, including both the main result and the short reasoning or justification that led you to it. This section must contain the full reasoning summary as one coherent response.> <<END>>
|
| 277 |
+
|
| 278 |
+
Notes:
|
| 279 |
+
- Allowed tools: {tool_names}
|
| 280 |
+
- Tool descriptions: {tools}
|
| 281 |
+
- Always use Observations from previous steps to inform the next Thought.
|
| 282 |
+
- Do not repeat identical actions.
|
| 283 |
+
- Always stop generation immediately after `<<END>>`.
|
| 284 |
+
Begin.
|
| 285 |
+
{agent_scratchpad}
|
| 286 |
"""
|
| 287 |
|
| 288 |
def create_agent_executor(llm, tools: List[Tool], tracer: Optional[Any] = None) -> AgentExecutor:
|