Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,9 @@ from smolagents import InferenceClientModel, CodeAgent, MCPClient
|
|
| 6 |
|
| 7 |
|
| 8 |
try:
|
|
|
|
|
|
|
|
|
|
| 9 |
mcp_client = MCPClient(
|
| 10 |
{"url": "https://bharatcoder-rs-studies.hf.space/gradio_api/mcp/", "transport": "streamable-http",}
|
| 11 |
)
|
|
@@ -17,7 +20,7 @@ try:
|
|
| 17 |
api_base=os.getenv("LLM_BASSE_URL"),
|
| 18 |
api_key=os.getenv("LLM_API_TOKEN"),
|
| 19 |
)
|
| 20 |
-
agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64"])
|
| 21 |
|
| 22 |
demo = gr.ChatInterface(
|
| 23 |
fn=lambda message, history: str(agent.run(message)),
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
try:
|
| 9 |
+
system_prompt = """You are an expert of Relative Strength (RS) investing style, as taught by Premal Sir.
|
| 10 |
+
You reply with facts on RS methodology, taking help from tools accessible with you."""
|
| 11 |
+
|
| 12 |
mcp_client = MCPClient(
|
| 13 |
{"url": "https://bharatcoder-rs-studies.hf.space/gradio_api/mcp/", "transport": "streamable-http",}
|
| 14 |
)
|
|
|
|
| 20 |
api_base=os.getenv("LLM_BASSE_URL"),
|
| 21 |
api_key=os.getenv("LLM_API_TOKEN"),
|
| 22 |
)
|
| 23 |
+
agent = CodeAgent(tools=[*tools], model=model, system_prompt=system_prompt, additional_authorized_imports=["json", "ast", "urllib", "base64"])
|
| 24 |
|
| 25 |
demo = gr.ChatInterface(
|
| 26 |
fn=lambda message, history: str(agent.run(message)),
|