Issue with Google_Adk agent
- Follow up to earlier question today. After doing some more testing of my agent that consumes a class from a tool call that points to a chroma vector db. When we were on the call I displayed that issue where my chroma vector db wasn't returning any data from my call but when I ran the class with an instance locally it queried and returned results from chroma db without issue. I'm using persistentclient db with a path of ./chroma_db. I did a test and when I run locally the collection has a size of 225 but when the agent calls from adk_web run however it has a size of 0. Could it be an issue of path the adk_web agent is calling or something with permissions the agent doesn't have. Very odd issue. Pretty straight forward class. I have snippet of code below. Any suggestions??? The AI Agent calls getTechInfo2. And I did take your advice and add description to the tool
class EmbedFeedsnew:
def __init__(self, collection_name="arcade_issues"):
self.client = chromadb.PersistentClient("./chroma_db")
self.embedder = OpenAIEmbeddingFunction(
api_key=os.getenv("OPENAI_API_KEY"),
model_name="text-embedding-3-small"
)
self.collection = self.client.get_or_create_collection(
name="rollomarkdown",
embedding_function=self.embedder
)
def getTechinfo2(self,criteria:str) -> dict :
# Directory containing your markdown files
markdown_directory = "files"
# Initialize ChromaDB client (using persistent client for saving to disk)
chroma_client = self.client
# Define the OpenAI embedding function
#embedding_function = OpenAIEmbeddingFunction(api_key=os.environ.get("OPENAI_API_KEY"), model_name="text-embedding-3-small")
embedding_function = self.embedder
# Create or get a ChromaDB collection
#collection = chroma_client.get_or_create_collection(name="rollomarkdown", embedding_function=embedding_function)
collection = self.collection
# Example query
query_text = criteria
print(f"The query test is: {query_text}")
results = collection.query(
query_texts=[criteria],
n_results=1 # Get the top 2 most relevant results
)
1
2 comments
Marc Juretus
3
Issue with Google_Adk agent
AI Developer Accelerator
skool.com/ai-developer-accelerator
Master AI & software development to build apps and unlock new income streams. Transform ideas into profits. 💡➕🤖➕👨‍💻🟰💰
Leaderboard (30-day)
Powered by