Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,7 +88,7 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
|
|
| 88 |
class BasicAgent:
|
| 89 |
def __init__(self):
|
| 90 |
print("BasicAgent initialized.")
|
| 91 |
-
token
|
| 92 |
self.system_prompt= """You are a helpful assistant. You will answer questions based on the provided context.You will always return a valid answer, even if the question is not clear or the context is insufficient. If you cannot answer, return a default answer.Always return a valid answer after validating the source.
|
| 93 |
Always return the answer in the following format:
|
| 94 |
"ANSWER: <your answer here>".
|
|
@@ -144,9 +144,9 @@ class BasicAgent:
|
|
| 144 |
"""
|
| 145 |
|
| 146 |
model = InferenceClientModel(
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
)
|
| 151 |
self.agent= CodeAgent(
|
| 152 |
tools = [add, subtract, multiply, divide, web_search, image_generation_tool],
|
|
|
|
| 88 |
class BasicAgent:
|
| 89 |
def __init__(self):
|
| 90 |
print("BasicAgent initialized.")
|
| 91 |
+
token=os.environ["OPENROUTER_API_KEY"]
|
| 92 |
self.system_prompt= """You are a helpful assistant. You will answer questions based on the provided context.You will always return a valid answer, even if the question is not clear or the context is insufficient. If you cannot answer, return a default answer.Always return a valid answer after validating the source.
|
| 93 |
Always return the answer in the following format:
|
| 94 |
"ANSWER: <your answer here>".
|
|
|
|
| 144 |
"""
|
| 145 |
|
| 146 |
model = InferenceClientModel(
|
| 147 |
+
model_id="openrouter/deepseek-coder",
|
| 148 |
+
token=token, # Set your Hugging Face token in the environment
|
| 149 |
+
provider="openrouter" # Use openrouter as the provider
|
| 150 |
)
|
| 151 |
self.agent= CodeAgent(
|
| 152 |
tools = [add, subtract, multiply, divide, web_search, image_generation_tool],
|