Hello everyone!
How could I have an agent accepts as a prompt a file? (Like you send a file to ChatGPT interface and it read its content)?
By the way, since I’m using a Teams and it has no support for Playground yet, I presume I would need to create a frontend to allow this input from the user. I’m currently testing on Streamlit, but still need to add the file to the coordinator Agent context.
Thank you, and CONGRATS for this awesome framework !!
Hey!
Great question, and thank you for the kind words about Agno! We’re thrilled you’re enjoying the framework!
The playground support for teams is in works and will be out soon. Thank you for expressing the interest.
For accepting file as a prompt to agent:
Please refer
we can do this from terminal.
Incase you have any doubts, pls feel free to reach out
Hey @Monali thanks for your attention! I still haven’t found a way to use .xslx tools though, any ideia?
Hey @henriquetoledos , We just release support for teams in playground, try it out.
Unfortunately we don’t support xlsx knowledge base yet, I recommend converting xlsx to csv format and using csv kb.
Here is docs on how to use csv knowledge base - CSV Knowledge Base - Agno
Incase you have any doubts, feel free to reach out
Sorry, i have a trouble with load csv local file, here is my code:
"‘’’
from pathlib import Path
from agno.agent import Agent
from agno.knowledge.csv import CSVKnowledgeBase
from agno.vectordb.lancedb import LanceDb
from agno.embedder.google import GeminiEmbedder
from agno.models.google import Gemini
from dotenv import load_dotenv
import os
load_dotenv()
GOOGLE_API_KEY = os.getenv(“GOOGLE_API_KEY”)
if not GOOGLE_API_KEY:
raise ValueError(“GOOGLE_API_KEY not found in environment variables”)
model = Gemini(id=“gemini-2.0-flash”)
csv_dir = Path(“./titanic/titanic.csv”)
embedder = GeminiEmbedder()
vector_db = LanceDb(uri=“lancedb_data”, table_name=“titanic_csv”, embedder=embedder)
knowledge_base = CSVKnowledgeBase(path=csv_dir, vector_db=vector_db)
knowledge_base.load(recreate=True)
agent = Agent(model, knowledge=knowledge_base, search_knowledge=True)
agent.print_response(“What is the data about ?”)
‘’‘’
and it’s getting error like this:
"‘’
Traceback (most recent call last):
File “D:\9_Lab\2_DA\load_csvAgent.py”, line 26, in
vector_db = LanceDb(uri=“lancedb_data”, table_name=“titanic_csv”, embedder=embedder)
File “D:\9_Lab\2_DA\da_env\Lib\site-packages\agno\vectordb\lancedb\lance_db.py”, line 87, in init
self.table = self.connection.open_table(name=table_name)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File “D:\9_Lab\2_DA\da_env\Lib\site-packages\lancedb\db.py”, line 478, in open_table
return LanceTable.open(
~~~~~~~~~~~~~~~^
self,
^^^^^
…<2 lines>…
index_cache_size=index_cache_size,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “D:\9_Lab\2_DA\da_env\Lib\site-packages\lancedb\table.py”, line 1580, in open
tbl = cls(db, name, **kwargs)
File “D:\9_Lab\2_DA\da_env\Lib\site-packages\lancedb\table.py”, line 1566, in init
self._table = LOOP.run(
~~~~~~~~^
connection._conn.open_table(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
…<3 lines>…
)
^
)
^
File “D:\9_Lab\2_DA\da_env\Lib\site-packages\lancedb\background_loop.py”, line 25, in run
return asyncio.run_coroutine_threadsafe(future, self.loop).result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File “C:\Program Files\Python313\Lib\concurrent\futures_base.py”, line 456, in result
return self.__get_result()
~~~~~~~~~~~~~~~~~^^
File “C:\Program Files\Python313\Lib\concurrent\futures_base.py”, line 401, in __get_result
raise self._exception
File “D:\9_Lab\2_DA\da_env\Lib\site-packages\lancedb\db.py”, line 837, in open_table
table = await self._inner.open_table(name, storage_options, index_cache_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Table ‘titanic_csv’ was not found
‘’‘’
I have read your documents about the CSV Knowledge Base - Agno, however i still really vague. Can you guide me how to fix it ?
I am looking forward to hearing from you.
Thank you !