Spaces:
Sleeping
Sleeping
Update app.py
Browse filesUsing LiteLLMModel
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
@@ -35,7 +35,7 @@ def analyze_article(url):
|
|
| 35 |
}
|
| 36 |
|
| 37 |
@tool
|
| 38 |
-
def fetch_news(company:str, count:int=
|
| 39 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 40 |
"""A tool that gets the latest news articles for a given company.
|
| 41 |
Args:
|
|
@@ -75,13 +75,20 @@ final_answer = FinalAnswerTool()
|
|
| 75 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 76 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 77 |
|
|
|
|
| 78 |
model = HfApiModel(
|
| 79 |
max_tokens=2096,
|
| 80 |
temperature=0.5,
|
| 81 |
model_id='deepseek-ai/DeepSeek-R1', #'Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 82 |
custom_role_conversions=None,
|
| 83 |
)
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# Import tool from Hub
|
| 87 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
|
|
|
| 1 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, LiteLLMModel, load_tool, tool
|
| 2 |
import datetime
|
| 3 |
import requests
|
| 4 |
import pytz
|
|
|
|
| 35 |
}
|
| 36 |
|
| 37 |
@tool
|
| 38 |
+
def fetch_news(company:str, count:int=3)-> list: #it's import to specify the return type
|
| 39 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 40 |
"""A tool that gets the latest news articles for a given company.
|
| 41 |
Args:
|
|
|
|
| 75 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 76 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 77 |
|
| 78 |
+
"""
|
| 79 |
model = HfApiModel(
|
| 80 |
max_tokens=2096,
|
| 81 |
temperature=0.5,
|
| 82 |
model_id='deepseek-ai/DeepSeek-R1', #'Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 83 |
custom_role_conversions=None,
|
| 84 |
)
|
| 85 |
+
"""
|
| 86 |
+
model = LiteLLMModel(
|
| 87 |
+
max_tokens=100,
|
| 88 |
+
temperature=0.5,
|
| 89 |
+
model_id='anthropic/claude-3-5-sonnet-latest', #'Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 90 |
+
custom_role_conversions=None,
|
| 91 |
+
)
|
| 92 |
|
| 93 |
# Import tool from Hub
|
| 94 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|