Commit ·
a679f34
1
Parent(s): 2982d6f
Increase the number of tokens.
Browse files
app.py
CHANGED
|
@@ -19,15 +19,6 @@ except ImportError:
|
|
| 19 |
|
| 20 |
|
| 21 |
load_dotenv()
|
| 22 |
-
# See https://discord.com/channels/879548962464493619/1360558713274109982:
|
| 23 |
-
#For anyone who has run out of free tier, you can switch to a Gemini model in Google Colab:
|
| 24 |
-
#go to https://aistudio.google.com/apikey and create a new API key
|
| 25 |
-
#insert it into Google Colab using 'Secrets' tab on the left pane
|
| 26 |
-
#make sure to grant access to the notebook!
|
| 27 |
-
#in the notebook, use:
|
| 28 |
-
#from google.colab import userdata
|
| 29 |
-
#model = LiteLLMModel(model_id="gemini/gemini-2.0-flash-lite", api_key=userdata.get('GEMINI_API_KEY'))
|
| 30 |
-
#agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model)
|
| 31 |
|
| 32 |
# --- Constants ---
|
| 33 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
@@ -42,7 +33,7 @@ class BasicAgent:
|
|
| 42 |
wikipedia_search_tool = FunctionTool.from_defaults(WikipediaToolSpec().search_data)
|
| 43 |
self._tools = [search_tool, wikipedia_load_tool, wikipedia_search_tool]
|
| 44 |
|
| 45 |
-
self._llm = Gemini(api_key=GOOGLE_API_KEY, model="models/gemini-2.0-flash-lite")
|
| 46 |
self._agent = ReActAgent(tools=self._tools, llm=self._llm)
|
| 47 |
# Modify the react prompt.
|
| 48 |
self._agent.update_prompts({"react_header": SYSTEM_PROMPT})
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
load_dotenv()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# --- Constants ---
|
| 24 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
|
|
| 33 |
wikipedia_search_tool = FunctionTool.from_defaults(WikipediaToolSpec().search_data)
|
| 34 |
self._tools = [search_tool, wikipedia_load_tool, wikipedia_search_tool]
|
| 35 |
|
| 36 |
+
self._llm = Gemini(api_key=GOOGLE_API_KEY, model="models/gemini-2.0-flash-lite", max_tokens=800)
|
| 37 |
self._agent = ReActAgent(tools=self._tools, llm=self._llm)
|
| 38 |
# Modify the react prompt.
|
| 39 |
self._agent.update_prompts({"react_header": SYSTEM_PROMPT})
|