Commit
·
2635e96
1
Parent(s):
7c18f52
Larger model.
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import mimetypes
|
|
6 |
import requests
|
7 |
import pandas as pd
|
8 |
from llama_index.core.llms import ChatMessage, TextBlock, ImageBlock, AudioBlock
|
9 |
-
from llama_index.llms.
|
10 |
from llama_index.core.agent.workflow import ReActAgent, AgentOutput
|
11 |
from llama_index.core.tools import FunctionTool
|
12 |
from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
|
@@ -37,7 +37,7 @@ class BasicAgent:
|
|
37 |
wikipedia_search_tool = FunctionTool.from_defaults(WikipediaToolSpec().search_data)
|
38 |
self._tools = [search_tool, wikipedia_load_tool, wikipedia_search_tool]
|
39 |
|
40 |
-
self._llm =
|
41 |
self._agent = ReActAgent(tools=self._tools, llm=self._llm)
|
42 |
# Modify the react prompt.
|
43 |
self._agent.update_prompts({"react_header": SYSTEM_PROMPT})
|
@@ -86,9 +86,9 @@ def get_media_content(item):
|
|
86 |
return ImageBlock(image=file_response.content)
|
87 |
elif media_type == 'text':
|
88 |
return TextBlock(text=file_response.content)
|
89 |
-
# Audio currently not supported
|
90 |
-
|
91 |
-
|
92 |
|
93 |
|
94 |
def create_question_message(item):
|
|
|
6 |
import requests
|
7 |
import pandas as pd
|
8 |
from llama_index.core.llms import ChatMessage, TextBlock, ImageBlock, AudioBlock
|
9 |
+
from llama_index.llms.google_genai import GoogleGenAI
|
10 |
from llama_index.core.agent.workflow import ReActAgent, AgentOutput
|
11 |
from llama_index.core.tools import FunctionTool
|
12 |
from llama_index.tools.duckduckgo import DuckDuckGoSearchToolSpec
|
|
|
37 |
wikipedia_search_tool = FunctionTool.from_defaults(WikipediaToolSpec().search_data)
|
38 |
self._tools = [search_tool, wikipedia_load_tool, wikipedia_search_tool]
|
39 |
|
40 |
+
self._llm = GoogleGenAI(api_key=GOOGLE_API_KEY, model="gemini-2.0-flash", max_tokens=1600)
|
41 |
self._agent = ReActAgent(tools=self._tools, llm=self._llm)
|
42 |
# Modify the react prompt.
|
43 |
self._agent.update_prompts({"react_header": SYSTEM_PROMPT})
|
|
|
86 |
return ImageBlock(image=file_response.content)
|
87 |
elif media_type == 'text':
|
88 |
return TextBlock(text=file_response.content)
|
89 |
+
# Audio currently not supported?
|
90 |
+
elif media_type == 'audio':
|
91 |
+
return AudioBlock(audio=file_response.content)
|
92 |
|
93 |
|
94 |
def create_question_message(item):
|